/* EL-DESKTOP R21 2026-10-02: desktop UX/CRO pass 2 (research: /workspace/desktop-r21/RESEARCH.md).
   EVERY rule sits inside @media (min-width: 1024px), so phones and tablets are untouched.
   The file is also linked with media="(min-width: 1024px)", so mobile never applies it.
   Rollback: remove the <css src="css/el-desktop-r21.css" .../> line from Magento_Theme/layout/default_head_blocks.xml. See CHECKOUT-R6-CHANGES.md R21.
   Numbered blocks can be deleted one by one. */

/* ---------- 1. Home (P0): products above the fold at 1280/1366 (first image was at y=681) ---------- */
@media (min-width: 1024px) {
  html body.cms-index-index .column.main > section:first-child > div {
    padding-top: 1.75rem !important;
    padding-bottom: 1.75rem !important;
    align-items: center;
  }
  html body.cms-index-index .column.main > section:first-child > div > div.max-w-2xl > * + * { margin-top: 1rem !important; }
  html body.cms-index-index .column.main > section:first-child > div > div.hidden img { width: 9rem !important; }
  html body.cms-index-index .column.main > section.el-home-trust { margin-top: 1rem !important; }
  html body.cms-index-index .column.main > section.el-home-trust + section { padding-top: 1.5rem !important; }
}
@media (min-width: 1280px) {
  /* one-line H1 ("Shop the pieces we have in hand.") */
  html body.cms-index-index .column.main > section:first-child > div > div.max-w-2xl { max-width: 58rem !important; }
  html body.cms-index-index .column.main > section:first-child h1 { white-space: nowrap; }
}

/* ---------- 2a. Header (P0) 1024–1279px: the action cluster overflowed the window (Bag chip off-screen, document 1241px wide at 1024).
   Phone number moves out of the bar (it stays in the footer, PDP and bag), nav gaps tighten. ---------- */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  html body #header .el-bar-row > .order-3 > a.hidden { display: none !important; }
  html body #header .navigation > div { padding-left: 0.75rem !important; padding-right: 0.5rem !important; }
  html body #header .navigation nav > ul { column-gap: 0.625rem !important; }
  html body #header .el-bar-row > .order-3 { gap: 0.375rem !important; }
  html body #header .el-bar-row { padding-left: 1rem !important; padding-right: 1rem !important; }
  html body #header .el-logo-wrap img { max-width: 96px; height: auto; }
  /* Bag chip keeps its icon + count badge; the word "Bag" stays as the button's accessible name via the label span being visually hidden */
  html body #header #menu-cart-icon .el-bag-chip-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- 2b. Header (P1) >=1366px: a labelled search field instead of a bare icon (same button, same panel).
   (1280–1365 has no room for it without crowding the nav, so the icon stays there.) ---------- */
@media (min-width: 1366px) {
  html body #header .navigation > div { padding-left: 0.75rem !important; padding-right: 0.5rem !important; }
  html body #header .navigation nav > ul { column-gap: 1rem !important; }
  html body #header #menu-search-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-start !important;
    gap: 0.375rem;
    width: auto !important;
    min-width: 0 !important;
    height: 40px !important;
    padding: 0 0.75rem 0 0.625rem !important;
    border: 1px solid rgba(255, 250, 240, 0.32);
    border-radius: 999px;
    transition: border-color .15s ease, background-color .15s ease;
  }
  html body #header #menu-search-icon svg { width: 18px !important; height: 18px !important; flex: 0 0 auto; }
  html body #header #menu-search-icon::after {
    content: "Search";
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
    color: rgba(255, 250, 240, 0.85);
  }
  html body #header #menu-search-icon:hover,
  html body #header #menu-search-icon[aria-expanded="true"] { border-color: #b49766; background: rgba(255, 250, 240, 0.06); }
}

/* ---------- 3. PDP (P1): gallery ≈58% / buy box ≈42% (main image 488px → ≈590px at 1440), zoom cue ---------- */
@media (min-width: 1024px) {
  html body.catalog-product-view .product-info-main > section.grid:first-child {
    grid-template-columns: minmax(0, 1.3fr) minmax(22.5rem, 1fr) !important;
  }
  html body.catalog-product-view #gallery #gallery-main button { cursor: zoom-in; }
  html body.catalog-product-view #gallery .snap-pager a.snap-marker,
  html body.catalog-product-view #gallery .snap-pager button.snap-marker { transition: box-shadow .15s ease; }
  html body.catalog-product-view #gallery .snap-pager a.snap-marker:hover,
  html body.catalog-product-view #gallery .snap-pager button.snap-marker:hover { box-shadow: 0 0 0 1px #b49766; }
}

/* ---------- 4. PDP (P1): buy box says each thing once ---------- */
@media (min-width: 1024px) {
  /* "How we authenticate" is also on the auth plate a few lines below */
  html body.catalog-product-view .el-pdp-buycard .el-price-trust-link { display: none !important; }
  /* "Ask a question" chip duplicates the help-line link (same dialog). The #el-ask wrapper (dialog + "Sell yours") stays */
  html body.catalog-product-view .el-pdp-buycard #el-ask > button.el-pdp-chip { display: none !important; }
}

/* buy box is narrower after block 3: keep each trust chip on one line (the 2nd drops to its own row only if both can't fit) */
@media (min-width: 1024px) {
  html body.catalog-product-view .el-pdp-buycard .el-pdp-assure { flex-wrap: wrap !important; }
  html body.catalog-product-view .el-pdp-buycard .el-pdp-assure li { flex: 1 1 auto !important; white-space: nowrap; font-size: 0.875rem !important; }
  html body.catalog-product-view .el-pdp-buycard .el-pdp-help { font-size: 0.9375rem !important; }
}

/* ---------- 5. PDP (P1): slim sticky purchase bar under the header once the inline Add to bag is off screen.
   Re-uses the existing #el-sticky-atc-bar + its IntersectionObserver (.is-visible); it was display:none at >=1000px. ---------- */
@media (min-width: 1024px) {
  html body > #el-sticky-atc-bar.is-visible {
    display: flex !important;
    position: fixed !important;
    top: var(--el-r21-hdr, 86px) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    z-index: 35 !important;
    align-items: center !important;
    gap: 1.25rem !important;
    margin: 0 !important;
    padding: 0.625rem max(1.5rem, calc((100vw - 78rem) / 2 + 1.5rem)) !important;
    background: #fffaf0 !important;
    border-bottom: 1px solid rgba(25, 23, 20, 0.12) !important;
    box-shadow: 0 10px 24px rgba(25, 23, 20, 0.08) !important;
    box-sizing: border-box !important;
  }
  html body > #el-sticky-atc-bar .el-sticky-atc__meta { display: flex !important; align-items: center !important; gap: 0.875rem !important; min-width: 0 !important; flex: 1 1 auto !important; }
  html body > #el-sticky-atc-bar .el-sticky-atc__thumb { width: 3rem !important; height: 3rem !important; object-fit: cover !important; background: #f3ece1 !important; border-radius: 4px !important; flex-shrink: 0 !important; }
  html body > #el-sticky-atc-bar .el-sticky-atc__text { min-width: 0 !important; display: flex !important; align-items: baseline !important; gap: 1rem !important; }
  html body > #el-sticky-atc-bar .el-sticky-atc__title { margin: 0 !important; color: #191714 !important; font-size: 0.9375rem !important; font-weight: 500 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  html body > #el-sticky-atc-bar .el-sticky-atc__price { margin: 0 !important; color: #191714 !important; font-size: 1rem !important; font-weight: 700 !important; white-space: nowrap !important; }
  html body > #el-sticky-atc-bar #product-addtocart-button-sticky,
  html body > #el-sticky-atc-bar .el-sticky-notify {
    flex: 0 0 auto !important; width: auto !important; max-width: none !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 0.5rem !important;
    min-width: 15rem !important; min-height: 2.875rem !important; padding: 0.5rem 1.5rem !important;
    border-radius: 0 !important; letter-spacing: 0.08em !important; text-transform: uppercase !important; font-weight: 700 !important; font-size: 0.875rem !important;
    text-decoration: none !important; box-sizing: border-box !important;
  }
  html body > #el-sticky-atc-bar #product-addtocart-button-sticky { background: #1F6B45 !important; border: 1px solid #1F6B45 !important; color: #fff !important; }
  html body > #el-sticky-atc-bar #product-addtocart-button-sticky * { color: #fff !important; }
  html body > #el-sticky-atc-bar #product-addtocart-button-sticky svg { width: 20px !important; height: 20px !important; }
  html body > #el-sticky-atc-bar #product-addtocart-button-sticky:hover { background: #17563A !important; border-color: #17563A !important; }
  html body > #el-sticky-atc-bar .el-sticky-notify { background: #b49766 !important; border: 1px solid #b49766 !important; color: #191714 !important; }
}

/* ---------- 6. PDP (P1): tab labels the same size; (P2) related links as tiles ---------- */
@media (min-width: 1024px) {
  html:root body .el-dossier .el-tabs .el-tab-bar label,
  html:root body .el-dossier .el-tabs .el-tab-bar label .el-tab-lg { font-size: 0.8125rem !important; letter-spacing: 0.08em !important; font-weight: 500 !important; }
  html body.catalog-product-view .el-crosslinks > p a::after { content: " \2192"; color: #b49766; }
  html body.catalog-product-view .el-crosslinks-list {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
  }
  html body.catalog-product-view .el-crosslinks-list > li { margin: 0 !important; }
  html body.catalog-product-view .el-crosslinks-list > li > a {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    height: 100%; min-height: 4rem; padding: 0.875rem 1rem; box-sizing: border-box;
    background: #fffaf0; border: 1px solid rgba(25, 23, 20, 0.14);
    font-size: 0.875rem; line-height: 1.35; text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
  }
  html body.catalog-product-view .el-crosslinks-list > li > a::after { content: "\2192"; color: #b49766; flex: 0 0 auto; }
  html body.catalog-product-view .el-crosslinks-list > li > a:hover { border-color: rgba(180, 151, 102, 0.75); box-shadow: 0 8px 20px rgba(25, 23, 20, 0.07); text-decoration: underline; text-underline-offset: 3px; }
}

/* ---------- 7. CMS / legal (P1): readable measure (was the full 1232px line), list markers ---------- */
@media (min-width: 1024px) {
  html body.cms-page-view:not(.cms-index-index) .column.main > p,
  html body.cms-page-view:not(.cms-index-index) .column.main > ul,
  html body.cms-page-view:not(.cms-index-index) .column.main > ol,
  html body.cms-page-view:not(.cms-index-index) .column.main > h2,
  html body.cms-page-view:not(.cms-index-index) .column.main > h3,
  html body.cms-page-view:not(.cms-index-index) .column.main > table { max-width: 46rem; }
  html body.cms-page-view:not(.cms-index-index) .column.main > ul { list-style: disc; padding-left: 1.25rem; }
  html body.cms-page-view:not(.cms-index-index) .column.main > ol { list-style: decimal; padding-left: 1.25rem; }
  html body.cms-page-view:not(.cms-index-index) .column.main > ul > li::marker,
  html body.cms-page-view:not(.cms-index-index) .column.main > ol > li::marker { color: #b49766; }
  html body.cms-page-view:not(.cms-index-index) .column.main > h2 { margin-top: 2rem !important; }
}

/* ---------- 8. Legal / FAQ / content heroes (P1): the full-bleed dark band kept a 20px inset, so "Terms & conditions" etc. sat
   ~8px from the window edge while the logo and the page sheet start at the content column (97px at 1440). Align the band's text to it. ---------- */
@media (min-width: 1024px) {
  html body .column.main .el-dark-hero.el-bleed {
    padding-left: max(1.5rem, calc((100vw - 77rem) / 2)) !important;
    padding-right: max(1.5rem, calc((100vw - 77rem) / 2)) !important;
    box-sizing: border-box;
  }
  /* FAQ answers ran the full 1216px line */
  html body .column.main .el-sheet .el-faq { max-width: 50rem; }
}
