/* =====================================================
   STORE SHELF: CURATED (demo)
   -----------------------------------------------------
   After curated.supply: the shelf carries on from the hero's paper instead
   of dropping into black, products sit small on white with air around them,
   and "All" reads as rows with a purpose. Store rules kept: no borders,
   rings or panels on a card, hover only lifts the card and zooms the photo,
   tags keep their 5px corners.
   ===================================================== */
.shelf_area {
    --sh-paper: #ECEBE7;
    --sh-ink: #0B0B0C;
    --sh-ink-2: #3F3F46;
    --sh-ink-3: #6B6B73;
    background: var(--sh-paper);
    padding: 34px 0 90px;
}

/* ---- categories ---- */
.shelf_area #product_filter_bar { margin: 0 auto 34px; }
.shelf_area .filter_chip {
    background: #FFFFFF;
    color: var(--sh-ink-2);
    border: 0;
    font-family: 'Inter', 'Inter Fallback', sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    padding: 9px 18px;
}
.shelf_area .filter_chip:hover { color: var(--sh-ink); background: #FFFFFF; }
.shelf_area .filter_chip.active { background: var(--sh-ink); color: #FFFFFF; font-weight: 600; }
.shelf_area .filter_chip:focus-visible { outline: 2px solid var(--sh-ink); }

/* ---- the grid ---- */
.shelf_area #products_grid { padding-bottom: 0; gap: 34px 22px; }
.shelf_area #products_grid.is-rows { display: block; }

.shelf_row + .shelf_row { margin-top: 64px; }
.shelf_row_head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 18px;
}
.shelf_row_title {
    margin: 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 30px;
    line-height: 1;
    letter-spacing: 0.005em;
    text-transform: uppercase;
    color: var(--sh-ink);
}
.shelf_row_all {
    background: none;
    border: 0;
    padding: 4px 0;
    font: 500 14px/1 'Inter', 'Inter Fallback', sans-serif;
    color: var(--sh-ink-3);
    cursor: pointer;
    transition: color .2s ease;
}
.shelf_row_all:hover { color: var(--sh-ink); }
.shelf_row_grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 34px 22px;
}

/* ---- a card: the photo on white, the words on the paper ---- */
.shelf_area .products_box {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}
.shelf_area .products_box:hover,
.shelf_area .products_box:focus,
.shelf_area .products_box:focus-visible { box-shadow: none; border: 0; }
.shelf_area .products_box:focus-visible .product_image_wrapper { outline: 2px solid var(--sh-ink); outline-offset: 3px; }
.shelf_area .product_image_wrapper {
    background: #FFFFFF;
    border-radius: 16px;
    overflow: hidden;
}
/* Pack shots float small in the middle, as on curated: more air, less crop. */
.shelf_area .tile-light .product_image,
.shelf_area .tile-dark .product_image { padding: 16%; object-fit: contain; }
.shelf_area .product_info {
    background: transparent;
    padding: 12px 2px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    row-gap: 3px;
    align-items: baseline;
}
.shelf_area .product_meta {
    grid-column: 1 / -1;
    font: 400 12.5px/1.3 'Inter', 'Inter Fallback', sans-serif;
    color: var(--sh-ink-3);
}
.shelf_area .product_name {
    font-family: 'Inter', 'Inter Fallback', sans-serif;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--sh-ink);
    -webkit-line-clamp: 2;
}
.shelf_area .product_price {
    font-family: 'Inter', 'Inter Fallback', sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--sh-ink);
    white-space: nowrap;
}
.shelf_area .products_box.is_sold_out .product_price,
.shelf_area .products_box.is_coming_soon .product_price { color: var(--sh-ink-3); }

/* ---- Back Soon, on the same paper ---- */
.shelf_area #products_unavailable { margin-top: 72px; }
.shelf_area #products_unavailable .unavailable_head { border-bottom: 0; padding-bottom: 0; }
.shelf_area #products_unavailable .unavailable_head h2 { color: var(--sh-ink); font-size: 30px; font-weight: 900; }
.shelf_area #products_unavailable .unavailable_head p { color: var(--sh-ink-3); }
.shelf_area #products_unavailable_grid { opacity: 1; }
.shelf_area #products_unavailable_grid .product_image { filter: grayscale(1); opacity: .7; }
.shelf_area #products_empty_state { color: var(--sh-ink-3); }

/* ---- phones: each row slides sideways, the next card peeking in ---- */
@media (max-width: 640px) {
    /* The row runs to the screen's edges by exactly the shelf's side padding:
       one number for both, so a row can never stick out past the screen and
       let the whole page be dragged sideways (it once did, by 10px). */
    .shelf_area { padding: 24px 0 64px; --shelf-pad: 16px; }
    .shelf_area #products_grid { padding-left: var(--shelf-pad); padding-right: var(--shelf-pad); }
    .shelf_row + .shelf_row { margin-top: 44px; }
    .shelf_row_title { font-size: 25px; }
    .shelf_row_head { margin-bottom: 14px; }
    .shelf_row_grid {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 62%;
        grid-template-columns: none;
        gap: 14px;
        overflow-x: auto;
        overscroll-behavior-x: contain;    /* a swipe at the row's end stays in the row */
        scroll-snap-type: x mandatory;
        margin: 0 calc(-1 * var(--shelf-pad));
        padding: 0 var(--shelf-pad) 4px;
        scroll-padding: 0 var(--shelf-pad);
        scrollbar-width: none;
    }
    .shelf_row_grid::-webkit-scrollbar { display: none; }
    .shelf_row_grid .products_box { scroll-snap-align: start; }
    .shelf_area .product_name, .shelf_area .product_price { font-size: 14px; }
}
@media (min-width: 641px) and (max-width: 1024px) {
    .shelf_row_grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- in the sheet: what goes with it, and the way to the next one ---- */
#product_modal .modal_pairs { margin-top: 26px; }
#product_modal .pairs_list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
#product_modal .pair_item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 8px 12px 8px 8px;
    border: 0;
    border-radius: 14px;
    background: var(--pd-soft, rgba(255,255,255,.06));
    color: var(--pd-ink, #fff);
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: transform .3s var(--lx-out, ease), background .2s ease;
}
#product_modal .pair_item:hover { transform: translateY(-2px); }
#product_modal .pair_img {
    width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: #FFFFFF;
    display: block;
}
#product_modal .pair_img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; box-sizing: border-box; display: block; }
#product_modal .pair_img.tile-photo img { object-fit: cover; padding: 0; }
#product_modal .pair_text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#product_modal .pair_meta { font-size: 12px; color: var(--pd-ink-3, #a1a1aa); }
#product_modal .pair_name { font-size: 14px; font-weight: 500; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#product_modal .pair_price { font-size: 14px; font-weight: 600; white-space: nowrap; }

#product_modal .modal_flip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 18px;
}
#product_modal .flip_btn {
    display: flex; flex-direction: column; gap: 3px;
    padding: 12px 14px;
    border: 0; border-radius: 14px;
    background: var(--pd-soft, rgba(255,255,255,.06));
    color: var(--pd-ink, #fff);
    text-align: left; cursor: pointer; font: inherit; min-width: 0;
    transition: transform .3s var(--lx-out, ease);
}
#product_modal .flip_btn:hover { transform: translateY(-2px); }
#product_modal .flip_next { text-align: right; align-items: flex-end; }
#product_modal .flip_dir { font-size: 12px; color: var(--pd-ink-3, #a1a1aa); }
#product_modal .flip_name { font-size: 13.5px; font-weight: 500; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (prefers-reduced-motion: reduce) {
    #product_modal .pair_item, #product_modal .flip_btn { transition: none; }
    #product_modal .pair_item:hover, #product_modal .flip_btn:hover { transform: none; }
}
.shelf_area .product_meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The store never moves sideways under a finger, whatever is ever too wide:
   the shelf clips anything that runs past it (clip, unlike hidden, doesn't
   make the shelf a scroll box), and on phones the page itself can't be
   panned left or right. The rows keep their own sideways swipe. */
.shelf_area { overflow-x: hidden; overflow-x: clip; }
@media (max-width: 900px) {
    html, body { overflow-x: hidden; }
}
