/* ALECXA Dancewear — shop page (filter bar, product cards, color picker).
   Loaded after catalog.css, only on the shop page. */

/* ── Layout ──────────────────────────────────────────── */
.shop { padding: 26px var(--page-pad) 76px; }
.shop-side { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(24px, 3vw, 44px); align-items: start; }
.site-header { min-height: 0; padding-bottom: 22px; }

/* ── Swatch (shared) ─────────────────────────────────── */
.swatch { display: inline-block; flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%; background: var(--swatch, #ddd); box-shadow: inset 0 0 0 1px rgba(46,32,25,.16); }
.swatch-none { background: repeating-linear-gradient(45deg, #e9e0d6 0 4px, #f7f3ed 4px 8px); }

/* ── Filters sidebar ─────────────────────────────────── */
.side-filters { position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.4); }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--ink); }
.side-close { display: none; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; }
/* The whole sidebar scrolls if the screen is short... */
.side-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.side-section { padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.side-section:last-child { border-bottom: 0; }
.side-section[hidden] { display: none; }
.side-heading { width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 0 12px; border: 0; background: none; font-family: var(--sans); font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); text-align: left; cursor: pointer; }
.side-heading .pill-caret { margin-left: auto; transform: translateY(1px) rotate(-135deg); }
.side-section.is-collapsed .side-heading { padding-bottom: 0; }
.side-section.is-collapsed .pill-caret { transform: translateY(-2px) rotate(45deg); }
.side-section.is-collapsed .side-body { display: none; }
/* ...and each long list scrolls on its own, so the sidebar never gets too long */
.side-body { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.side-body::-webkit-scrollbar, .side-scroll::-webkit-scrollbar { width: 6px; }
.side-body::-webkit-scrollbar-thumb, .side-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.side-actions { display: none; }

.pill-caret { width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.4px 1.4px 0; transition: transform .2s; opacity: .7; }
.pill-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: 0; }
.pill-count[hidden] { display: none; }
.pop-empty { margin: 0; font-family: var(--sans); font-size: 12px; color: var(--muted); }

/* Category list */
.category-tabs { display: flex; flex-direction: column; gap: 2px; max-height: 190px; overflow-y: auto; margin: 0 -8px; }
.cat-tab { display: flex; align-items: center; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; font-family: var(--sans); font-size: 13px; color: #5c4e46; text-align: left; cursor: pointer; transition: all .15s ease; }
.cat-tab:hover { background: var(--warm-glow); color: var(--ink); }
.cat-tab.is-active { background: var(--ink); color: #fffaf5; font-weight: 500; }

/* Sizes */
.size-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; padding: 1px; }
.size-chip { min-width: 42px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; font-family: var(--sans); font-size: 12px; letter-spacing: .04em; color: var(--ink); cursor: pointer; transition: all .15s ease; }
.size-chip:hover { border-color: var(--accent); }
.size-chip.is-selected { background: var(--ink); border-color: var(--ink); color: #fffaf5; }

/* Colors */
.color-list { display: flex; flex-direction: column; gap: 2px; max-height: 216px; overflow-y: auto; margin: 0 -8px; padding-right: 2px; }
.color-option { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 5px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; font-family: var(--sans); font-size: 13px; color: #5c4e46; text-align: left; cursor: pointer; transition: all .15s ease; }
.color-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-option .swatch { width: 20px; height: 20px; }
.color-option:hover { background: var(--warm-glow); color: var(--ink); }
.color-option.is-selected { border-color: var(--accent); background: var(--warm-glow); color: var(--ink); font-weight: 500; }
.color-option.is-selected .swatch { box-shadow: inset 0 0 0 1px rgba(46,32,25,.16), 0 0 0 2px var(--paper), 0 0 0 3.5px var(--accent); }

/* Price */
.price-box { padding: 0 2px; }
.price-now { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.price-now strong { color: var(--ink); font-size: 15px; font-weight: 600; margin-left: 3px; }
.price-ends { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--sans); font-size: 11px; color: var(--muted); }

/* ── Toolbar above the products ──────────────────────── */
.shop-toolbar { display: flex; align-items: center; gap: 10px; }
.search-wrap { position: relative; flex: 1 1 220px; max-width: 360px; }
.search-wrap svg { position: absolute; left: 13px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; pointer-events: none; }
.search-wrap input { width: 100%; height: 38px; padding: 0 14px 0 36px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); color: var(--ink); font-family: var(--sans); font-size: 13px; transition: border-color .2s, background .2s; }
.search-wrap input::placeholder { color: #a39489; }
.search-wrap input:hover, .search-wrap input:focus { border-color: var(--accent-light); background: #fff; }
.filter-pill, .sort-pill select { height: 38px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.55); color: #51443c; font-family: var(--sans); font-size: 12px; letter-spacing: .04em; cursor: pointer; transition: all .2s ease; }
.filter-pill:hover, .sort-pill select:hover { border-color: var(--accent-light); background: #fff; }
.filter-open { display: none; align-items: center; gap: 8px; padding: 0 16px; white-space: nowrap; }
.filter-open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.filter-open.has-value { border-color: var(--accent); color: var(--accent-dark); font-weight: 500; }
.sort-pill { position: relative; display: block; margin-left: auto; }
.sort-pill select { appearance: none; -webkit-appearance: none; padding: 0 32px 0 16px; max-width: 190px; }
.sort-pill::after { content: ""; position: absolute; right: 15px; top: 50%; width: 6px; height: 6px; border: solid #51443c; border-width: 0 1.4px 1.4px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; opacity: .7; }

/* Active filter chips */
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 12px; }
.active-filters[hidden] { display: none; }
.active-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 9px 0 12px; border: 0; border-radius: 999px; background: var(--paper-deep); font-family: var(--sans); font-size: 11px; color: var(--ink); cursor: pointer; transition: background .15s; }
.active-chip span { font-size: 15px; line-height: 1; color: var(--muted); }
.active-chip:hover { background: #e6dbcf; }
.clear-all { height: 28px; padding: 0 8px; border: 0; background: none; font-family: var(--sans); font-size: 11px; color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ── Results ─────────────────────────────────────────── */
.result-count { margin: 14px 0 16px; font-family: var(--sans); font-size: 12px; letter-spacing: .04em; color: #86776e; }
.result-count span:first-child { font-weight: 600; color: var(--ink); }

.shop .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 18px; }

/* ── Product card ────────────────────────────────────── */
.product-card { outline-offset: 4px; }
.product-card.no-anim { animation: none; }
.product-card.no-anim .product-photo img { animation: img-in .35s ease both; }
@keyframes img-in { from { opacity: 0; } to { opacity: 1; } }
.shop .product-photo { border-radius: 10px; }
.shop .product-card.out-of-stock .product-photo { opacity: 1; }
.shop .product-card.out-of-stock .product-photo img { opacity: .55; filter: grayscale(.3); }
.photo-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: clamp(48px, 7vw, 84px); color: var(--accent-light); opacity: .55; }
.photo-badge { position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(46,32,25,.82); color: #fffaf5; font-family: var(--sans); font-size: 9px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }

.shop .product-details { padding: 12px 2px 0; }
.product-category { margin: 0 0 4px; font-family: var(--sans); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.shop .product-name { font-size: 16px; margin: 0; }
.shop .product-price { margin: 4px 0 0; font-family: var(--sans); font-size: 13px; font-weight: 500; color: #4d4039; }

.card-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 8px 0 0 -4px; }
.swatch-btn { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.swatch-btn .swatch { width: 18px; height: 18px; transition: transform .15s ease, box-shadow .15s ease; }
.swatch-btn:hover .swatch { transform: scale(1.15); }
.swatch-btn.is-selected .swatch { box-shadow: inset 0 0 0 1px rgba(46,32,25,.16), 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); }
.swatch-btn.is-out .swatch { opacity: .35; }
.swatch-more { margin-left: 4px; font-family: var(--sans); font-size: 11px; color: var(--muted); }
.card-color-name { margin: 6px 0 0; font-family: var(--sans); font-size: 11px; color: var(--ink); font-weight: 500; }
.card-sizes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.card-size { min-width: 26px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; font-family: var(--sans); font-size: 10px; line-height: 1.5; text-align: center; color: #5c4e46; }
.card-size.is-out { color: #b9aca2; border-style: dashed; text-decoration: line-through; }

/* ── Product dialog ──────────────────────────────────── */
.product-dialog { border-radius: 14px; }
.pd-slider .photo-empty { font-size: 120px; }
.pd-label-value { margin-left: 8px; color: var(--ink); font-weight: 600; letter-spacing: .04em; text-transform: none; font-size: 12px; }
.pd-hint { margin: 10px 0 0; font-family: var(--sans); font-size: 11px; color: var(--muted); }
.pd-hint[hidden] { display: none; }
.pd-colors { gap: 8px; }
.pd-color-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 5px 13px 5px 7px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-family: var(--sans); font-size: 12px; color: var(--ink); cursor: pointer; transition: all .15s ease; }
.pd-color-btn .swatch { width: 24px; height: 24px; }
.pd-color-btn:hover { border-color: var(--accent); }
.pd-color-btn.is-selected { border-color: var(--ink); background: #fff; box-shadow: 0 0 0 1px var(--ink); font-weight: 500; }
.pd-color-btn.is-out { color: #a39489; }
.pd-color-btn.is-out .swatch { opacity: .4; }
.pd-size-tag { min-width: 46px; text-align: center; border-radius: 8px; }
.pd-size-tag.is-out { color: #b9aca2; border-style: dashed; text-decoration: line-through; }
.pd-stock { font-family: var(--sans); font-size: 13px; }

/* ── Wide / tablet ───────────────────────────────────── */
@media (min-width: 1500px) { .shop .product-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .shop .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 14px; } .shop-side { grid-template-columns: 210px minmax(0, 1fr); } }

/* ── Small screens: sidebar becomes a slide-in drawer ── */
@media (max-width: 900px) {
  .shop-side { display: block; }
  .filter-open { display: inline-flex; }
  .side-filters { position: fixed; z-index: 22; top: 0; bottom: 0; left: 0; width: min(330px, 88vw); max-height: none; border: 0; border-radius: 0; background: var(--paper); transform: translateX(-102%); visibility: hidden; transition: transform .3s cubic-bezier(.2,.7,.2,1), visibility 0s .3s; }
  .side-filters.is-open { transform: translateX(0); visibility: visible; transition: transform .3s cubic-bezier(.2,.7,.2,1); box-shadow: 0 0 0 100vmax rgba(38,25,18,.38); }
  .side-head { padding: 16px 18px 14px; }
  .side-close { display: inline-block; }
  .side-scroll { padding: 0 18px; }
  .side-actions { display: grid; grid-template-columns: auto 1fr; gap: 8px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .side-actions .button { min-height: 44px; }
  .size-chip { min-width: 48px; height: 40px; }
  .cat-tab, .color-option { min-height: 40px; }
  .category-tabs { max-height: 210px; }
  .color-list { max-height: 250px; }
}

@media (max-width: 760px) {
  .shop { padding-top: 16px; padding-bottom: 45px; }
  .shop-toolbar { flex-wrap: wrap; gap: 8px; }
  .search-wrap { flex: 1 1 100%; max-width: none; }
  .filter-open { flex: 1 1 0; justify-content: center; }
  .sort-pill { flex: 1.2 1 0; min-width: 0; margin-left: 0; }
  .sort-pill select { width: 100%; max-width: none; text-overflow: ellipsis; }
  .result-count { margin: 12px 0; }
  .shop .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .shop .product-name { font-size: 14px; }
  .swatch-btn { width: 30px; height: 30px; }
  .card-swatches { margin-left: -6px; gap: 0; }
  .pd-slider .photo-empty { font-size: 90px; }
}
