/* Desktop homepage only. Mobile and tablet retain their existing presentation. */
.uc-home-rail { display: none; }
.home-category-row .home-category-desktop { display: none; }
.uc-compact-logo { display: none; }

@media (min-width: 1024px) {
  body {
    --uc-ink: #0f172a;
    --uc-muted: #64748b;
    --uc-line: #e2e8f0;
    --uc-surface: #f8fafc;
    --uc-content-width: 1360px;
    --uc-left-gutter: 112px;
    --uc-right-gutter: 40px;
    background: #fafafa;
    color: var(--uc-ink);
  }
  body:has(.uc-home-rail) { background: #fafafa; }
  body .text-primary, body .text-accent, body .text-gray-900, body .text-gray-800 { color: var(--uc-ink); }
  body .text-gray-600 { color: #475569; }
  body .text-gray-500 { color: var(--uc-muted); }
  body .bg-primary { background-color: var(--uc-ink); }
  body [class~="bg-primary/10"] { background-color: #f1f5f9; }

  /* Search and page content share the same edges and center line. */
  header:has(.uc-desktop-header) {
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }
  .uc-desktop-header .uc-desktop-header-row {
    width: calc(100% - var(--uc-left-gutter) - var(--uc-right-gutter));
    max-width: var(--uc-content-width);
    margin-left: max(var(--uc-left-gutter), calc((100% - var(--uc-content-width) + var(--uc-left-gutter) - var(--uc-right-gutter)) / 2));
    padding: 24px 0 16px;
    display: grid;
    grid-template-columns: 170px minmax(280px, 1fr) 170px;
    align-items: center;
    gap: 24px;
  }
  .uc-desktop-header-row > a { position: fixed; top: 20px; left: 24px; width: 64px; height: 64px; z-index: 1; display: grid; place-items: center; }
  .uc-desktop-header-row > a span { display: none; }
  .uc-compact-logo { display: block; width: 64px; height: 64px; object-fit: contain; }
  .uc-desktop-header-row > div:nth-child(2) { grid-column: 2; width: 100%; max-width: 540px; justify-self: center; }
  .uc-desktop-header-row #search-input {
    min-height: 64px;
    padding: 16px 24px 16px 58px;
    background: #fff;
    border: 1px solid #fff;
    box-shadow: 0 16px 48px rgb(15 23 42 / 13%), 0 2px 8px rgb(15 23 42 / 3%);
    font-size: 14px;
    color: var(--uc-ink);
  }
  .uc-desktop-header-row #search-input::placeholder { color: var(--uc-muted); }
  .uc-desktop-header-row #search-input:focus { background: #fff; border-color: #94a3b8; }
  .uc-desktop-header-row #search-input + button { left: 12px; right: auto; width: 38px; height: 38px; background: transparent; color: var(--uc-muted); }
  .uc-desktop-header-row #search-input + button:hover { background: var(--uc-line); }
  .uc-desktop-header .uc-desktop-actions { grid-column: 3; justify-self: end; }
  .uc-desktop-actions > a { display: none; }
  .uc-desktop-actions > div:first-child { padding: 4px; border-color: var(--uc-line); background: var(--uc-surface); }
  .uc-desktop-actions .currency-toggle { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding-inline: 13px; color: var(--uc-muted); box-shadow: none; }
  .uc-desktop-actions .currency-toggle.bg-primary { background: var(--uc-ink); color: #fff; }
  .uc-desktop-actions .currency-toggle:not(.bg-primary):hover { color: var(--uc-ink); background: #e2e8f0; }

  /* Leave the search and brand floating above the content after scrolling. */
  body.uc-header-scrolled header:has(.uc-desktop-header) {
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
  }
  .uc-header-scrolled .uc-desktop-header-row > a {
    pointer-events: auto;
  }
  .uc-header-scrolled .uc-desktop-header-row > div:nth-child(2) {
    position: fixed;
    top: 20px;
    left: 50%;
    width: min(512px, calc(100vw - 200px));
    transform: translateX(-50%);
    pointer-events: auto;
  }
  .uc-header-scrolled .uc-desktop-actions { visibility: hidden; pointer-events: none; }

  /* Icon navigation with labels on hover and keyboard focus. */
  .uc-home-rail {
    position: fixed;
    z-index: 45;
    left: 24px;
    top: 120px;
    bottom: 28px;
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .uc-rail-group { display: flex; flex-direction: column; gap: 6px; padding: 7px; border: 1px solid #fff; border-radius: 32px; background: #fff; box-shadow: 0 12px 36px rgb(15 23 42 / 12%), 0 2px 6px rgb(15 23 42 / 3%); }
  .uc-home-rail a { position: relative; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #94a3b8; text-decoration: none; transition: color .18s; }
  .uc-home-rail a > i { font-size: 20px; }
  .uc-home-rail a:hover { color: var(--uc-ink); background: transparent; }
  .uc-home-rail a[aria-current="page"] { color: var(--uc-ink); background: transparent; }
  .uc-rail-utilities { margin-top: auto; }
  .uc-rail-avatar { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: #e2e8f0; color: var(--uc-ink); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--uc-line); }
  .uc-rail-avatar > span { font-size: 13px; font-weight: 600; }
  .uc-rail-avatar img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
  .uc-rail-label { position: absolute; left: calc(100% + 14px); top: 50%; transform: translateY(-50%) translateX(-4px); padding: 8px 12px; background: var(--uc-ink); color: #fff; font-size: 12px; white-space: nowrap; border-radius: 8px; pointer-events: none; visibility: hidden; opacity: 0; transition: opacity .15s, transform .15s; box-shadow: 0 4px 16px rgb(15 23 42 / 10%); }
  .uc-home-rail a:hover .uc-rail-label, .uc-home-rail a:focus-visible .uc-rail-label { opacity: 1; visibility: visible; transform: translateY(-50%) translateX(0); }
  .uc-rail-cart-count, .uc-home-rail .uc-notification-count { position: absolute; top: -1px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid #fff; border-radius: 999px; background: var(--uc-ink); color: #fff; font-size: 9px; line-height: 13px; text-align: center; }
  .uc-rail-cart-count.hidden, .uc-home-rail [hidden] { display: none; }

  main.page-transition-enter { display: flex; flex-direction: column; padding: 0 var(--uc-right-gutter) 64px var(--uc-left-gutter); }
  main.page-transition-enter > * { order: 5; }
  main.page-transition-enter > section:has(.home-category-row) { order: 1; margin-bottom: 20px; }
  main.page-transition-enter > section:has(#hero-carousel-container) { order: 2; padding-top: 0; margin-bottom: 44px; }
  #homepage-discovery-sections.hidden { display: none; }
  main.page-transition-enter > #homepage-discovery-sections { order: 4; }
  main.page-transition-enter > .container, #homepage-discovery-sections > .container { width: 100%; max-width: var(--uc-content-width); margin-inline: auto; padding-inline: 0; }
  .home-category-wrap { margin: 0; padding: 0; max-width: none; }
  main .home-category-row { justify-content: center; align-items: center; gap: 18px; padding: 4px 0 8px; overflow: visible; }
  .home-category-row > button:not(.home-category-desktop) { display: none; }
  .home-category-row .home-category-desktop { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 4px 6px; border: 0; background: transparent; color: #475569; box-shadow: none; font-size: 12px; font-weight: 500; }
  .home-category-row .home-category-desktop img { flex-shrink: 0; width: 44px; height: 44px; padding: 4px; border: 1px solid #e2e8f0; border-radius: 50%; background: #f1f5f9; object-fit: contain; }
  .home-category-row .home-category-desktop:hover, .home-category-row .home-category-desktop[aria-pressed="true"] { background: transparent; color: var(--uc-ink); border-color: transparent; box-shadow: none; }
  .home-category-row .home-category-desktop[aria-pressed="true"] span { text-decoration: underline; text-underline-offset: 6px; }
  .home-category-row .home-category-all { width: 44px; padding: 0; border-radius: 50%; color: #94a3b8; font-size: 20px; }
  .home-category-row button { min-height: 40px; padding: 9px 17px; background: transparent; color: #475569; border-color: transparent; font-size: 12px; font-weight: 500; box-shadow: none; }
  .home-category-row button:hover { background: #f1f5f9; color: var(--uc-ink); }
  .home-category-row button[aria-pressed="true"] { background: var(--uc-ink); color: #fff; border-color: var(--uc-ink); box-shadow: none; }

  /* The CMS owns slide backgrounds; desktop foregrounds adapt for contrast. */
  #hero-carousel-container { border-radius: 28px; box-shadow: none; }
  #hero-track > div { min-height: 400px; padding: 48px 56px; }
  #hero-track > div > div:first-child { flex: 0 1 52%; padding-right: 24px; }
  #hero-track > div > div:nth-child(2) { width: 44%; align-items: center; justify-content: center; }
  #hero-track h2 { margin-bottom: 18px; color: var(--uc-ink); font-size: clamp(36px, 3.6vw, 60px); line-height: 1.08; letter-spacing: -.045em; }
  #hero-track p { max-width: 380px; margin-bottom: 28px; color: #475569; font-size: 14px; line-height: 1.7; }
  #hero-track a, #hero-track button { min-height: 46px; padding: 12px 24px; background: var(--uc-ink); color: #fff; box-shadow: none; font-size: 13px; }
  #hero-track a:hover, #hero-track button:hover { background: #334155; }
  #hero-track > [data-hero-tone="dark"] :is(h2, p) { color: #fff; }
  #hero-track > [data-hero-tone="dark"] :is(a, button) { background: #fff; color: var(--uc-ink); }
  #hero-track > [data-hero-tone="dark"] :is(a, button):hover { background: #e2e8f0; }
  #hero-track img { max-height: 300px; width: 100%; object-fit: contain; filter: drop-shadow(0 20px 24px rgb(0 0 0 / 20%)); }

  #homepage-discovery-sections h2, #catalog-heading { color: var(--uc-ink); font-size: 22px; line-height: 1.3; letter-spacing: -.03em; }

  #homepage-discovery-sections > section { margin-bottom: 48px; }
  .section-products-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 24px !important; }
  #homepage-discovery-sections .bs-carousel { gap: 24px; }
  .bs-carousel > article { width: calc((100% - 72px) / 4); min-width: 180px; }
  article[data-product-id] > div:first-child { border-radius: 20px; border-color: #f1f5f9; background: var(--uc-surface); box-shadow: none; }
  main article[data-product-id].group:hover h3 { color: #475569; }
  article[data-product-id] .add-to-wishlist { background: #fff; border: 1px solid var(--uc-line); box-shadow: none; }
  article[data-product-id] .add-to-wishlist i { color: var(--uc-ink); }
  section[aria-labelledby="catalog-heading"] { order: 5; margin-bottom: 0; padding-block: 0; background: transparent; border-radius: 0; }
  #catalog-filter-btn, #catalog-load-more { border-color: var(--uc-line); box-shadow: none; }
  #catalog-filter-btn:hover, #catalog-load-more:hover { background: #f1f5f9; }
  #catalog-error, #catalog-error button { color: #475569; }
  #catalog-error button { background: #f1f5f9; }
  #scrollToTop { background: #fff; border: 1px solid var(--uc-line); color: var(--uc-ink); box-shadow: 0 4px 16px rgb(15 23 42 / 5%); }
  #uc-filter-modal #uc-dual-track { background: var(--uc-ink); }
  body #uc-filter-modal .uc-range-input::-webkit-slider-thumb { background: #0f172a; box-shadow: 0 2px 8px rgb(15 23 42 / 15%); }
  body #uc-filter-modal .uc-range-input::-moz-range-thumb { background: #0f172a; box-shadow: 0 2px 8px rgb(15 23 42 / 15%); }
  .uc-home-rail a:focus-visible, main :is(a, button):focus-visible, .uc-desktop-header :is(a, button, input):focus-visible, #uc-filter-modal :focus-visible { outline: 2px solid #64748b; outline-offset: 4px; }
}

@media (min-width: 1600px) {
  #hero-track > div { min-height: 440px; padding-inline: 64px; }
  #hero-track img { max-height: 340px; }
}

@media (min-width: 1024px) and (max-height: 650px) {
  .uc-home-rail { top: 100px; bottom: 16px; gap: 8px; }
  .uc-rail-group { gap: 2px; padding: 5px; }
  .uc-home-rail a { width: 42px; height: 42px; }
  .uc-rail-utilities { margin-top: 0; }
}
