.shop-page {
  --shop-paper: #f3f0ec;
  --shop-soft: #ece7df;
  --shop-surface: #fcfaf7;
  --shop-shadow: 0 14px 44px #4e392514;
  background: radial-gradient(ellipse at 22% 0, #fffcf6, transparent 56%), var(--shop-paper);
}
.shop-page [hidden] { display: none !important; }
.shop-header, .shop-main { max-width: 1480px; margin-inline: auto; padding-inline: 112px 48px; }
.shop-header { display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 24px; padding-block: 26px 30px; }
.shop-header { --brand-width: 144px; --brand-mobile-width: 102px; }
.shop-header-tools, .shop-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.shop-breadcrumb { font-size: 12px; color: var(--muted); }
.shop-breadcrumb a:hover { color: var(--accent); }
.icon-button { position: relative; display: grid; place-items: center; width: 46px; height: 46px; flex-shrink: 0; background: var(--shop-soft); border: 0; border-radius: 15px; }
.icon-button svg { width: 21px; height: 21px; }
#cart-count { position: absolute; top: -4px; left: -4px; min-width: 20px; padding: 0 4px; border-radius: 20px; background: var(--accent); color: var(--accent-ink); font-size: 11px; }
.shop-main { padding-bottom: 30px; }
.shop-page h1 { white-space: normal; line-height: 1.45; }
.shop-hero { display: grid; grid-template-columns: .85fr 1.35fr; min-height: 430px; background: var(--shop-surface); border-radius: 28px; overflow: clip; box-shadow: var(--shop-shadow); animation: home-entry 350ms var(--settle) both; }
.slide-copy { padding: 44px; align-self: center; }
.slide-copy > p { margin: 0 0 12px; color: var(--accent-text); font-weight: 600; font-size: 15px; }
.slide-copy h1 { font-size: clamp(30px, 3.3vw, 47px); font-weight: 760; margin: 0 0 30px; }
.shop-action, .soft-button { display: inline-flex; justify-content: center; align-items: center; gap: 12px; min-height: 48px; padding: 10px 20px; border: 0; border-radius: 15px; text-align: center; font-size: 14px; transition: background 380ms, color 380ms, transform 380ms var(--settle); }
.shop-action { background: #292724; color: white; }
.soft-button { background: var(--shop-soft); }
.shop-action:hover:not(:disabled), .soft-button:hover:not(:disabled), .icon-button:hover { background: #e9b292; color: #292724; }
.shop-action:disabled, .soft-button:disabled { cursor: default; opacity: .5; }
.shop-action svg, .soft-button svg { width: 19px; height: 19px; flex: 0 0 auto; }
.slide-media { position: relative; min-width: 0; min-height: 430px; background: #e8e0d4; }
#slide-photo { position: absolute; inset: 0; }
#slide-photo img, .product-thumb img, .category-card img, #product-photo img, #gallery-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
#slide-photo img:not(.initial-slide) { animation: shop-fade 350ms var(--settle) both; }
@keyframes shop-fade { from { opacity: .25; } to { opacity: 1; } }
.slide-arrow { position: absolute; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 45px; height: 45px; border: 0; border-radius: 50%; background: #fff9; backdrop-filter: blur(12px); font-size: 29px; line-height: 1; }
#prev-slide { right: 16px; } #next-slide { left: 16px; }
#slide-dots { display: flex; position: absolute; bottom: 9px; right: 50%; translate: 50% 0; }
#slide-dots button { display: grid; place-items: center; width: 24px; height: 44px; padding: 0; border: 0; border-radius: 16px; background: transparent; }
#slide-dots button::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px #0005; }
#slide-dots button[aria-current="true"]::before { background: var(--accent-text); }
#slide-number { position: absolute; right: 16px; bottom: 16px; padding: 4px 12px; border-radius: 24px; background: #fff9; color: #292724; font-size: 12px; }
.collections { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin: 32px auto 38px; }
.collections a { display: inline-grid; place-items: center; min-height: 48px; padding: 10px 24px; background: var(--shop-surface); border-radius: 26px; box-shadow: 0 7px 25px #4e39250a; font-size: 14px; transition: background 360ms; }
.collections a:first-child { background: #292724; color: white; }
.collections a:hover { background: #e9b292; color: #292724; }
.shop-section { margin-top: 36px; }
.shop-section h2, .related-section h2 { font-size: clamp(21px, 2.35vw, 31px); margin: 0 0 20px; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.section-heading a { display: inline-flex; gap: 7px; align-items: center; min-height: 44px; font-size: 13px; white-space: nowrap; }
.section-heading svg { width: 17px; height: 17px; }
#shop-categories { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.category-card, .product-card { min-width: 0; display: block; border-radius: 20px; background: var(--shop-surface); box-shadow: 0 8px 30px #4e39250c; overflow: clip; transition: transform 600ms var(--settle), box-shadow 600ms var(--settle); }
.category-card > div, .product-thumb { aspect-ratio: 1.12; background: #e8e0d4; overflow: clip; }
.category-card > span { display: block; padding: 13px 12px; text-align: center; font-size: 16px; font-weight: 640; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.product-card a { display: block; height: 100%; }
.product-card-copy { padding: 15px 18px 18px; }
.product-card-copy h3 { margin: 0 0 8px; font-size: 17px; line-height: 1.65; }
.product-card-copy p { margin: 0; font-size: 14px; color: var(--accent-text); }
.product-card-copy .unavailable { color: var(--muted); }
.product-card--quick { display: flex; flex-direction: column; }
.product-card--quick a { height: auto; flex: 1; }
.quick-add { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 0 12px 12px; padding: 5px 6px; border: 0; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-size: .8125rem; font-weight: 650; transition: background 200ms; }
.quick-add > span:first-child { font-size: 1.15em; line-height: 1; }
.quick-add:not(:disabled):hover { background: var(--accent-soft); }
.quick-add:disabled { background: var(--shop-soft); color: var(--muted); cursor: default; }
.quick-add:disabled > span:first-child { display: none; }
.shop-section { content-visibility: auto; contain-intrinsic-block-size: auto 250px; }
.shop-section [data-awaiting] { min-block-size: 210px; }
.category-card:focus-visible, .product-card a:focus-visible { outline-offset: -4px; }
@media (hover:hover) {
  .category-card:hover, .product-card:hover { transform: translateY(-4px); box-shadow: 0 13px 30px #4e39251b; }
}
.shop-footer { margin-top: 40px; padding-block: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; color: var(--muted); font-size: 11px; }
.list-title { margin: 6px 0 26px; font-size: clamp(28px, 3.6vw, 44px); }
.listing-layout { display: grid; grid-template-columns: minmax(205px, 260px) minmax(0, 1fr); gap: 26px; align-items: start; }
.filter-panel { background: var(--shop-surface); border-radius: 18px; box-shadow: var(--shop-shadow); padding: 13px 16px; }
.filter-panel:not([open]) { inline-size: fit-content; max-inline-size: 100%; padding: 0 13px; }
.filter-panel summary { cursor: pointer; min-height: 44px; font-size: .875rem; font-weight: 650; line-height: 44px; border-radius: 11px; }
.filter-panel fieldset, .product-color-set { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.filter-panel legend { margin-bottom: 8px; padding: 0; font-weight: 650; font-size: 14px; }
.filter-panel legend small { font-weight: 400; color: var(--muted); }
.filter-panel label { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; }
.filter-panel label span { display: inline-flex; align-items: center; gap: 8px; }
.filter-panel input[type="checkbox"] { accent-color: var(--accent-text); width: 16px; height: 16px; margin: 0; }
.price-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-range label { flex-direction: column; align-items: start; }
.price-range input { width: 100%; min-width: 0; border: 0; border-radius: 12px; color: var(--ink); background: var(--shop-soft); font: inherit; padding: 8px 10px; }
.availability-filter { margin-bottom: 12px; }
.filter-panel .soft-button { width: 100%; font-size: 13px; }
.listing-toolbar { display: flex; gap: 12px; align-items: center; }
.shop-search { display: flex; min-width: 0; flex: 1; gap: 9px; align-items: center; padding: 0 13px; min-height: 48px; background: var(--shop-surface); border-radius: 15px; }
.shop-search svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted); }
.shop-search input { width: 100%; min-width: 0; min-height: 44px; border: 0; background: transparent; font-size: 14px; }
.shop-search:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.shop-search input:focus { outline: none; }
.sort-label { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13px; }
.sort-control { position: relative; min-inline-size: 124px; }
.sort-control[open] { z-index: 3; }
.sort-control summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding-inline: 12px; border-radius: 14px; background: var(--shop-soft); cursor: pointer; list-style: none; }
.sort-control summary::-webkit-details-marker { display: none; }
.sort-chevron { width: 7px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; rotate: 45deg; translate: 0 -2px; }
.sort-control[open] .sort-chevron { rotate: 225deg; translate: 0 2px; }
.sort-options { position: absolute; inset-block-start: calc(100% + 7px); inset-inline-end: 0; min-inline-size: max(100%, 150px); margin: 0; padding: 6px; border: 0; border-radius: 17px; background: #fcfaf6; box-shadow: 0 10px 32px #4e392530; }
.sort-options label { display: block; position: relative; cursor: pointer; }
.sort-options input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.sort-options span { display: flex; align-items: center; min-block-size: 44px; padding-inline: 11px; border-radius: 11px; }
.sort-options input:checked + span { background: #f5e4d7; color: var(--accent-text); font-weight: 650; }
.sort-options label:hover span { background: #f2ebe3; }
.sort-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.listing-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-block: 13px; min-height: 36px; }
#active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
#active-filters button { border: 0; border-radius: 20px; min-height: 38px; background: var(--accent-soft); padding: 4px 12px; font-size: 12px; }
#result-count { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.empty-shop { text-align: center; background: var(--shop-surface); padding: 42px 20px; border-radius: 22px; }
.empty-shop h1, .empty-shop h2 { font-size: 24px; }
.product-layout { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(0, 1.65fr); gap: 24px; align-items: start; }
.purchase-panel { padding: 25px; background: var(--shop-surface); border-radius: 25px; box-shadow: var(--shop-shadow); grid-column: 1; grid-row: 1 / span 2; }
#product-category { color: var(--accent-text); font-size: 13px; }
#product-name { font-size: clamp(25px, 2.8vw, 39px); font-weight: 760; margin: 8px 0 12px; }
#product-description { font-size: 14px; color: var(--muted); margin: 0 0 20px; }
#product-price { display: block; font-size: 26px; }
#product-stock { margin: 4px 0 16px; font-size: 13px; color: var(--muted); }
.product-color-set legend, .quantity-row { font-size: 14px; }
#color-name { color: var(--muted); font-size: 12px; margin-inline-start: 8px; }
#product-colors { display: flex; gap: 6px; padding-top: 5px; }
#product-colors label { position: relative; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; }
#product-colors input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.swatch { display: inline-block; width: 19px; height: 19px; border-radius: 50%; background: var(--swatch); box-shadow: 0 1px 7px #29272425; }
#product-colors .swatch { width: 30px; height: 30px; }
#product-colors input:checked + .swatch, #product-colors input:focus-visible + .swatch { outline: 2px solid var(--accent-text); outline-offset: 4px; }
.quantity-row { display: flex; gap: 14px; align-items: center; margin-bottom: 17px; }
.qty-stepper { display: flex; align-items: center; background: var(--shop-soft); border-radius: 13px; }
.qty-stepper output { min-width: 30px; text-align: center; }
.qty-stepper button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 19px; }
.qty-stepper button:disabled { opacity: .35; cursor: default; }
#add-product, #ask-product { width: 100%; margin-bottom: 9px; }
.product-facts { display: grid; gap: 10px; margin-top: 18px; }
.product-facts details { background: #f1ede7; border-radius: 15px; padding: 10px 15px; }
.product-facts summary { cursor: pointer; font-size: 14px; font-weight: 640; min-height: 28px; }
.product-facts p, .product-facts dl { font-size: 13px; color: var(--muted); margin: 9px 0 4px; }
.product-facts dl > div { display: grid; grid-template-columns: 1fr 1.5fr; gap: 8px; padding-block: 4px; }
.product-facts dd { margin: 0; }
.product-gallery { grid-column: 2; min-width: 0; }
#product-photo { aspect-ratio: 1.5; border-radius: 23px; background: #e8e0d4; overflow: clip; }
#product-photo.square-photo img { object-fit: contain; }
#gallery-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
#gallery-thumbs:not(:empty) { margin-top: 12px; }
#gallery-thumbs button { display: block; padding: 0; aspect-ratio: 1.25; overflow: clip; border: 0; border-radius: 14px; background: #e8e0d4; }
#gallery-thumbs button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
#gallery-note { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.related-section { grid-column: 2; min-width: 0; margin-top: 6px; }
#shop-cart { width: min(480px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; padding: 24px; border: 0; border-radius: 24px; background: var(--shop-surface); color: var(--ink); box-shadow: var(--shop-shadow); }
#shop-cart[open] { animation: surface-rise 420ms var(--settle) both; }
#shop-cart::backdrop { background: #24221e55; backdrop-filter: blur(7px); }
.cart-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cart-heading h2 { margin: 0; font-size: 24px; }
#cart-items { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
#cart-items li { display: grid; grid-template-columns: 64px minmax(0, 1fr) 44px; gap: 10px; align-items: center; background: var(--shop-soft); border-radius: 14px; padding: 8px; }
#cart-items img { display: block; width: 64px; height: 58px; object-fit: cover; border-radius: 9px; }
#cart-items a { font-size: 14px; font-weight: 620; }
#cart-items small { display: block; font-size: 12px; color: var(--muted); }
#cart-items button { min-height: 44px; border: 0; background: transparent; display: grid; place-items: center; }
#cart-items .cart-empty { display: block; padding: 14px; font-size: 14px; }
.cart-footer p { display: flex; justify-content: space-between; gap: 10px; }
.cart-footer button { width: 100%; }
.cart-footer > a { width: 100%; margin-bottom: 9px; }
@media (min-width: 901px) { .filter-panel summary { display: none; } }
@media (max-width: 1100px) {
  .shop-header, .shop-main { padding-inline: 88px 28px; }
  .slide-copy { padding: 27px; }
  .listing-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 17px; }
  .listing-layout .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-layout { grid-template-columns: minmax(275px, .9fr) minmax(0, 1.4fr); }
}
@media (max-width: 900px) {
  .listing-layout, .product-layout { grid-template-columns: minmax(0, 1fr); }
  .purchase-panel, .product-gallery, .related-section { grid-column: auto; grid-row: auto; }
  .product-gallery { grid-row: 1; }
  .shop-hero, .slide-media { min-height: 350px; }
  .filter-panel[open] { padding-block: 8px 12px; }
}
@media (max-width: 680px) {
  .shop-page { height: 100dvh; overflow: hidden; }
  .shop-scroll { height: calc(100dvh - 70px - env(safe-area-inset-bottom)); overflow: auto; }
  .shop-header, .shop-main { padding-inline: 17px; }
  .shop-header { padding-block: 18px 22px; align-items: flex-start; gap: 12px; }
  .shop-header-tools { gap: 8px; }
  .shop-breadcrumb { gap: 5px; font-size: 10px; }
  .shop-header .icon-button { width: 44px; height: 44px; }
  .shop-main { padding-bottom: 20px; }
  .shop-hero { grid-template-columns: 1fr; border-radius: 22px; }
  .slide-copy { padding: 24px; }
  .slide-copy h1 { margin-bottom: 19px; font-size: 29px; }
  .slide-media { grid-row: 1; min-height: 0; aspect-ratio: 1.35; }
  .collections { justify-content: start; gap: 8px; margin: 22px 0; }
  .collections a { min-height: 44px; padding: 7px 13px; font-size: 12px; }
  #shop-categories, .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .category-card > span, .product-card-copy h3 { font-size: 13px; }
  .product-card-copy { padding: 10px 11px 13px; }
  .product-card-copy p { font-size: 12px; }
  .quick-add { margin-inline: 8px; font-size: .75rem; }
  .listing-toolbar { flex-wrap: wrap; }
  .shop-search { flex-basis: 100%; }
  .shop-search input { font-size: 16px; }
  .product-layout { gap: 18px; }
  .purchase-panel { padding: 20px; }
  #product-photo { aspect-ratio: 1.15; }
  #gallery-thumbs { gap: 8px; }
  .shop-footer { flex-direction: column; }
}

.quick-add:not(:disabled):hover { background: var(--accent-soft-hover); }
.quick-add-count {
  display: inline-grid;
  place-items: center;
  min-inline-size: 22px;
  min-block-size: 22px;
  padding-inline: 4px;
  border-radius: 50px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.quick-add[data-counted] { justify-content: space-between; padding-inline: 8px; }
.quick-add > span:first-child { flex: none; }
.skeleton-product-details .skeleton-media { margin-block-start: 20px; aspect-ratio: 2.8; }

@media (min-width: 681px) and (hover: hover) and (pointer: fine) {
  #cart-count, .quick-add-count { background: var(--accent-fill); }
}

/* ============ P02 storefront additions (server cart + PDP variants) = */
#cart-items li { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.cart-thumb { width: 44px; height: 44px; border-radius: 10px; background: #eeebe5 center/cover no-repeat; background-image: linear-gradient(135deg, #e5ded3, #cfc7ba); display: block; }
.cart-line-title { display: block; font-size: 14px; font-weight: 620; }
#cart-items small { margin-top: 2px; }
.cart-line-stepper { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; }
.cart-line-stepper button { min-width: 34px; min-height: 34px; width: 34px; height: 34px; border: 0; border-radius: 9px; background: #e9e4db; color: inherit; font: inherit; font-weight: 700; }
.cart-line-stepper button:disabled { opacity: .45; cursor: default; }
.cart-line-stepper output { font-size: 13px; min-width: 20px; text-align: center; }
.cart-error { margin: 0 0 10px; padding: 10px 14px; border-radius: 12px; background: #f6e5da; color: var(--accent-text); font-size: 13px; }
.cart-error[hidden] { display: none; }
.cart-price-changed { color: var(--accent-text); }
#product-status { font-size: 13px; }
.inquiry-note { font-size: 13px; color: var(--accent-text); background: #f6e5da; padding: 10px 14px; border-radius: 12px; }
.product-option-set { border: 0; padding: 0; margin: 14px 0 0; }
.product-option-set legend { font-size: 13px; font-weight: 650; padding: 0; }
.option-chips, #product-colors { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.option-chips label, #product-colors label { position: relative; }
#product-colors input, .option-chips input { position: absolute; opacity: 0; pointer-events: none; }
.option-chip { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 12px; background: #ece7de; font-size: 13px; font-weight: 620; cursor: pointer; transition: background 200ms ease, transform 200ms var(--settle); }
.option-chips input:checked + .option-chip { background: #f6dccb; color: var(--accent-text); }
.option-chips input:focus-visible + .option-chip { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.option-chips input:disabled + .option-chip { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.option-unavailable .option-chip { opacity: .4; text-decoration: line-through; }
.option-chips label:has(input:checked:not(:disabled)) .option-chip { transform: translateY(-1px); }
.quick-cart-status { font-size: 12px; }
#product-price { font-size: clamp(1.15rem, 3vw, 1.5rem); }
#product-stock { color: var(--muted); }
