/* Styli-inspired desktop header for Zosouq (lg+ only) */

@media (min-width: 1024px) {
  :root {
    --zs-topbar: #1a1a1a;
    --zs-dark: #2d2d2d;
    --zs-subnav: #f4f4f4;
    --zs-border: #ececec;
  }

  /* ── Top utility bar ── */
  .zs-topbar {
    background: var(--zs-topbar) !important;
    color: #fff !important;
    min-height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    font-size: 13px !important;
    line-height: 18px;
    letter-spacing: 0.04em;
  }

  .zs-topbar-inner {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
  }

  .zs-topbar-left {
    display: flex;
    align-items: center;
    gap: 28px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .zs-topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .zs-topbar-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    color: #fff;
    font-size: 13px;
  }

  .zs-topbar-item svg {
    flex-shrink: 0;
    opacity: 0.95;
  }

  .zs-topbar-right .zs-lang-btn {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
  }

  .zs-topbar-right .zs-kw {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
  }

  .zs-topbar > span:first-child:not(.zs-topbar-inner) {
    display: none !important;
  }

  /* ── Sticky header shell ── */
  header.sticky {
    background: #fff !important;
    backdrop-filter: none !important;
    border-bottom: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  }

  header.sticky > div.max-w-\[1400px\],
  header.sticky > div[class*="max-w"] {
    max-width: 1180px !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  /* Main row: logo+tabs | search | icons */
  header .zs-main-row,
  header div[class*="h-16"],
  header div[class*="sm:h-[72px]"] {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    min-height: 56px !important;
    height: auto !important;
    grid-template-columns: none !important;
    padding: 0 !important;
  }

  header img[alt="Zosouq"] {
    height: 40px !important;
    max-height: 40px !important;
    width: auto !important;
  }

  header .lg\:hidden {
    display: none !important;
  }

  .zs-left-cluster {
    display: flex !important;
    align-items: center !important;
    min-width: 0;
    flex: 1 1 auto;
    overflow: visible;
  }

  .zs-cat-tabs {
    display: flex !important;
    align-items: center;
    margin-left: 16px;
    gap: 0;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .zs-cat-tabs::-webkit-scrollbar {
    display: none;
  }

  .zs-cat-tabs a {
    padding: 16px 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--zs-dark);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease;
  }

  .zs-cat-tabs a:hover,
  .zs-cat-tabs a.is-active {
    background: #f1f1f1;
    color: #000;
  }

  /* Search */
  header form.hidden.sm\:flex,
  header form[class*="sm:flex"] {
    display: flex !important;
    width: 320px !important;
    max-width: 320px !important;
    flex: 0 0 320px !important;
    margin: 0 8px 0 auto !important;
  }

  header form[class*="sm:flex"] > div {
    width: 100%;
  }

  header form[class*="sm:flex"] input[type="text"] {
    background: #fff !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 2px !important;
    height: 40px !important;
    padding: 8px 40px 8px 14px !important;
    font-size: 14px !important;
    box-shadow: none !important;
  }

  header form[class*="sm:flex"] input[type="text"]:focus {
    border-color: #c4c4c4 !important;
    box-shadow: none !important;
    outline: none !important;
  }

  /* Right icons */
  header .justify-end {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex: 0 0 auto !important;
    margin-left: 0 !important;
    width: auto !important;
  }

  header .justify-end > a,
  header .justify-end > button {
    width: 40px !important;
    height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--zs-dark) !important;
    padding: 0 !important;
  }

  header .justify-end > a svg,
  header .justify-end > button svg {
    width: 26px !important;
    height: 26px !important;
  }

  header .justify-end > button[title*="Arabic"],
  header .justify-end > button[title*="English"],
  header .justify-end > button[title*="Switch"] {
    display: none !important;
  }

  /* Hide my-orders icon on desktop header to match Styli (account/wishlist/cart only) — keep wishlist+cart */
  /* keep my-orders if present */

  /* ── Subnav strip ── */
  header nav.hidden.lg\:block,
  header nav[class*="lg:block"] {
    display: block !important;
    background: var(--zs-subnav) !important;
    border-top: 1px solid var(--zs-border) !important;
    border-bottom: 1px solid var(--zs-border) !important;
  }

  header nav[class*="lg:block"] > div {
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 0 16px 0 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    overflow-x: auto;
    scrollbar-width: none;
    min-height: 48px;
  }

  header nav[class*="lg:block"] > div::-webkit-scrollbar {
    display: none;
  }

  header nav[class*="lg:block"] a,
  header nav[class*="lg:block"] .zs-extra-link {
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 14px 12px !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 0.04em;
    color: var(--zs-dark) !important;
    gap: 0 !important;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex !important;
    align-items: center;
  }

  header nav[class*="lg:block"] a:hover,
  header nav[class*="lg:block"] .zs-extra-link:hover {
    color: #000 !important;
    background: transparent !important;
    text-decoration: underline;
    text-underline-offset: 4px;
  }

  header nav[class*="lg:block"] a img,
  header nav[class*="lg:block"] a > div.w-7,
  header nav[class*="lg:block"] a > div[class*="w-7"],
  header nav[class*="lg:block"] a svg,
  header nav[class*="lg:block"] span.w-px {
    display: none !important;
  }

  header nav[class*="lg:block"] a[href^="/category/"] {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  .zs-cat-tabs {
    display: none !important;
  }

  body:not(.zs-crm) #root > div > .text-white.text-center,
  body:not(.zs-crm) .zs-topbar {
    display: none !important;
  }

  body:not(.zs-crm) header.sticky {
    background: #fff !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border-bottom: 0 !important;
  }

  body:not(.zs-crm) header.sticky > div[class*="max-w"] {
    display: grid !important;
    grid-template-columns: 32px auto minmax(0, 1fr) 32px;
    grid-template-areas:
      "menu logo search wish"
      "tabs tabs tabs tabs";
    align-items: center;
    column-gap: 10px;
    row-gap: 0;
    padding: 12px 15px 0 !important;
    max-width: none !important;
  }

  body:not(.zs-crm) header div[class*="h-16"],
  body:not(.zs-crm) header div[class*="h-16"] > .flex.items-center.min-w-0,
  body:not(.zs-crm) header .justify-end {
    display: contents !important;
    height: auto !important;
    min-height: 0 !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  body:not(.zs-crm) header .zs-mh-menu,
  body:not(.zs-crm) header button.lg\:hidden {
    grid-area: menu;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 1px solid #e8e8e8 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #000 !important;
  }

  body:not(.zs-crm) header button.lg\:hidden svg,
  body:not(.zs-crm) header .zs-mh-menu svg {
    width: 14px !important;
    height: 14px !important;
  }

  body:not(.zs-crm) header .zs-mh-logo {
    grid-area: logo;
    margin: 0 !important;
    display: flex !important;
    align-items: center;
  }

  body:not(.zs-crm) header img[alt="Zosouq"] {
    height: 28px !important;
    max-height: 28px !important;
    width: auto !important;
  }

  body:not(.zs-crm) header form.hidden.sm\:flex,
  body:not(.zs-crm) header form[class*="sm:flex"] {
    display: none !important;
  }

  body:not(.zs-crm) header .zs-mh-search,
  body:not(.zs-crm) header div[class*="sm:hidden"][class*="pb-2"] {
    grid-area: search;
    min-width: 0;
    width: auto !important;
    padding: 0 !important;
    display: block !important;
  }

  body:not(.zs-crm) header .zs-mh-search form > div.relative,
  body:not(.zs-crm) header div[class*="sm:hidden"] form > div.relative {
    display: flex !important;
    align-items: center;
    height: 36px;
    border: 1px solid #e4dfd4;
    border-radius: 20px;
    background: #f3f1ec;
    padding: 0 12px 0 10px;
  }

  body:not(.zs-crm) header div[class*="sm:hidden"] input[type="text"] {
    height: 36px !important;
    padding: 0 0 0 8px !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 14px !important;
    color: #2d2d2d !important;
    width: 100% !important;
  }

  body:not(.zs-crm) header div[class*="sm:hidden"] button[type="submit"] {
    position: static !important;
    transform: none !important;
    order: -1;
    width: 20px;
    height: 20px;
    padding: 0;
    flex-shrink: 0;
    color: #2d2d2d !important;
  }

  body:not(.zs-crm) header .justify-end > button,
  body:not(.zs-crm) header .justify-end > a[href="/cart"],
  body:not(.zs-crm) header .justify-end > a[href="/my-orders"],
  body:not(.zs-crm) header .justify-end > a[href="/orders"] {
    display: none !important;
  }

  body:not(.zs-crm) header .zs-mh-wish,
  body:not(.zs-crm) header a[href="/wishlist"] {
    grid-area: wish;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 1px solid #e8e8e8 !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: #2d2d2d !important;
    justify-self: end;
  }

  body:not(.zs-crm) header a[href="/wishlist"] svg {
    width: 18px !important;
    height: 18px !important;
  }

  .zs-mweb-tabs {
    grid-area: tabs;
    width: auto;
    display: block;
    text-align: center;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-bottom: 1px solid #ececec;
    margin: 0 -15px;
    padding: 0 6px;
    font-family: "Noto Sans", Inter, sans-serif;
  }

  .zs-mweb-tabs::-webkit-scrollbar {
    display: none;
  }

  .zs-mweb-tabs a {
    display: inline-block;
    margin: 0 10px;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: #a2a2a2;
    vertical-align: middle;
    flex: none;
    min-width: 0;
  }

  .zs-mweb-tabs a span {
    display: inline-block;
    line-height: 20px;
    margin-bottom: 2px;
    border-bottom: 2px solid transparent;
  }

  .zs-mweb-tabs a.is-on {
    font-weight: 600;
    color: #2d2d2d;
    box-shadow: none;
  }

  .zs-mweb-tabs a.is-on span {
    margin-bottom: 0;
    border-bottom: 2px solid #000;
  }

  body.zs-cats-on header.sticky {
    display: none !important;
  }
}

/* Slightly tighter tabs on mid desktop */
@media (min-width: 1024px) and (max-width: 1280px) {
  .zs-cat-tabs a {
    padding: 16px 8px;
    font-size: 12px;
  }

  header form[class*="sm:flex"] {
    width: 260px !important;
    max-width: 260px !important;
    flex-basis: 260px !important;
  }

  .zs-topbar-item:nth-child(3) {
    display: none;
  }
}
