/* ════════════════════════════════════════════════════════════════════════
   store.css — redesigned catalog for store.html.
   2-column layout (filter sidebar + product grid), minimalist Sephora/Guerlain
   style cards. Loaded AFTER style.css (which provides the navbar/footer chrome).
   ════════════════════════════════════════════════════════════════════════ */

/* ── Cinematic dark hero ──────────────────────────────────────────────────
   Immersive dark canvas with ambient light pools + a faint engineering grid,
   then a razor-sharp hard edge into the white catalog below. */
.store-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  color: #fff;
  background: #080a10;
  padding: clamp(44px, 8vh, 76px) 24px;
}
/* ambient light pools */
.store-hero::before {
  content: '';
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(58% 80% at 50% -12%, rgba(64, 110, 223, 0.28), transparent 62%),
    radial-gradient(42% 60% at 86% 18%, rgba(0, 178, 199, 0.12), transparent 60%),
    radial-gradient(46% 66% at 8% 96%, rgba(96, 92, 196, 0.14), transparent 62%),
    linear-gradient(180deg, #0b0e16 0%, #06080d 100%);
}
/* faint engineering grid, faded toward the edges via a radial mask */
.store-hero::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(ellipse 72% 62% at 50% 42%, #000 28%, transparent 76%);
  mask-image: radial-gradient(ellipse 72% 62% at 50% 42%, #000 28%, transparent 76%);
}
.store-hero__inner { position: relative; max-width: 860px; margin: 0 auto; }

/* Luxury label tag with hairline flanks */
.store-hero__tag {
  display: inline-flex; align-items: center; gap: 16px;
  margin-bottom: 14px;
  font-size: 11px; font-weight: 500; letter-spacing: .32em; text-transform: uppercase;
  color: #93a6cc;
}
.store-hero__tag::before,
.store-hero__tag::after { content: ''; width: 34px; height: 1px; }
.store-hero__tag::before { background: linear-gradient(90deg, transparent, rgba(147, 166, 204, .7)); }
.store-hero__tag::after  { background: linear-gradient(90deg, rgba(147, 166, 204, .7), transparent); }

/* Massive commanding headline (metallic top-light gradient) */
.store-hero__title {
  margin: 0 0 14px;
  font-size: clamp(30px, 4.5vw, 50px);
  font-weight: 700; line-height: 1.08; letter-spacing: -.02em;
  color: #fff; /* fallback if background-clip:text is unsupported */
  background: linear-gradient(180deg, #ffffff 32%, #aab4cc 100%);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .store-hero__title { -webkit-background-clip: text; background-clip: text; color: transparent; }
}

.store-hero__subtitle {
  max-width: 540px; margin: 0 auto;
  font-size: clamp(15px, 1.4vw, 17px); line-height: 1.75; color: #98a1b4;
}

@media (max-width: 560px) {
  .store-hero { padding: 40px 18px; }
  .store-hero__tag { letter-spacing: .26em; gap: 10px; }
  .store-hero__tag::before, .store-hero__tag::after { width: 20px; }
}

/* 2-column layout */
.catalog {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 28px 100px;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 48px;
  align-items: start;
}

/* ── Sidebar filters (collapsible accordion sections) ─────────────────── */
.cat-sidebar { position: sticky; top: 24px; }
.filter-group { margin-bottom: 2px; }

/* Clickable section header with a rotating chevron */
.filter-group__title {
  display: flex; align-items: center; gap: 9px;
  width: 100%; margin: 0; padding: 15px 2px;
  background: none; border: none; border-bottom: 1px solid #ececec; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: #111; text-align: left;
  transition: color .2s ease;
}
.filter-group__title:hover { color: #1f44c2; }
/* Active-filter count for the section (visible even when collapsed) */
.filter-group__badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  background: #1f44c2; color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0; line-height: 1;
}
.filter-group__badge[hidden] { display: none; }
.filter-group__chev {
  margin-left: auto; font-size: 11px; color: #b3b3b3; flex-shrink: 0;
  transition: transform .38s cubic-bezier(.4, 0, .2, 1), color .2s ease;
}
.filter-group__title:hover .filter-group__chev { color: #1f44c2; }
.filter-group.is-open .filter-group__chev { transform: rotate(180deg); }

/* Smooth collapse via the grid-rows 0fr → 1fr technique (no JS height math). */
.filter-group__content {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .38s cubic-bezier(.4, 0, .2, 1);
}
.filter-group.is-open .filter-group__content { grid-template-rows: 1fr; }
.filter-group__inner { overflow: hidden; min-height: 0; padding-top: 6px; }

/* Long lists scroll inside the section instead of pushing the page. */
.filter-list { list-style: none; margin: 0; padding: 4px 0; max-height: 270px; overflow-y: auto; }
.filter-list::-webkit-scrollbar { width: 5px; }
.filter-list::-webkit-scrollbar-thumb { background: #e0ddd7; border-radius: 3px; }
.filter-list::-webkit-scrollbar-track { background: transparent; }

.filter-cat {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; background: none; border: none; text-align: left; cursor: pointer;
  font: inherit; font-size: 14px; color: #555; padding: 8px 0;
}
.filter-cat:hover { color: #000; }
.filter-cat.is-active { color: #000; font-weight: 600; }
.filter-cat__count { color: #b3b3b3; font-size: 12px; font-weight: 400; }

.filter-check { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; font-size: 14px; color: #555; }
.filter-check:hover { color: #000; }
.filter-check input { width: 16px; height: 16px; accent-color: #111; cursor: pointer; }
.filter-check .filter-cat__count { margin-left: auto; }

.price-range { display: flex; align-items: center; gap: 10px; }
.price-range input {
  width: 100%; padding: 9px 10px; border: 1px solid #ddd; font: inherit; font-size: 13px; color: #111;
}
.price-range input:focus { outline: none; border-color: #111; }
.price-range span { color: #bbb; }

.filter-clear {
  background: none; border: none; cursor: pointer; padding: 0;
  font: inherit; font-size: 13px; color: #888; text-decoration: underline; text-underline-offset: 3px;
}
.filter-clear:hover { color: #111; }

/* ── Grid header bar ──────────────────────────────────────────────────── */
.catalog-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-bottom: 18px; margin-bottom: 30px; border-bottom: 1px solid #ececec;
}
.catalog-bar__count { font-size: 13px; color: #777; letter-spacing: .02em; }
.sortby { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: #777; }
.sortby select {
  font: inherit; font-size: 13px; color: #111; cursor: pointer;
  border: 1px solid #ddd; background: #fff; padding: 9px 12px;
}
.sortby select:focus { outline: none; border-color: #111; }

/* ── Product grid + minimalist card ───────────────────────────────────── */
.pgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 22px; min-width: 0; }
.pgrid-empty { grid-column: 1 / -1; text-align: center; color: #888; padding: 60px 0; font-size: 15px; }
.link-btn { background: none; border: none; color: #111; text-decoration: underline; cursor: pointer; font: inherit; }

/* ── Premium pagination (stark white / bold black, matches the store) ──── */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 64px; flex-wrap: wrap; }
.page-btn {
  min-width: 44px; height: 44px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: #111;
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .2s ease, color .2s ease;
}
.page-btn:hover:not(.is-active):not(:disabled) { background: #f3f2ef; }   /* subtle hover */
.page-btn.is-active { background: #000; color: #fff; cursor: default; }    /* solid black square */
.page-btn:disabled { color: #cfccc7; cursor: not-allowed; }
.page-btn--nav { font-size: 12px; }
.page-dots { min-width: 30px; text-align: center; color: #b3aea6; font-weight: 600; user-select: none; }

.pcard { display: flex; flex-direction: column; background: #fff; min-width: 0; }

.pcard__media { position: relative; aspect-ratio: 1 / 1; background: #f6f6f4; overflow: hidden; }
.pcard__media a { display: block; width: 100%; height: 100%; }
.pcard__media img { width: 100%; height: 100%; object-fit: contain; padding: 14px; transition: transform .5s ease; }
.pcard:hover .pcard__media img { transform: scale(1.04); }


/* Strictly centered text block */
.pcard__body { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px 8px 0; }
.pcard__brand { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #222; }
.pcard__title {
  margin: 7px 0 10px; font-size: 13px; font-weight: 400; line-height: 1.45; color: #555;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.9em;
}
.pcard__title a { color: inherit; text-decoration: none; }
.pcard__title a:hover { color: #000; }
.pcard__price { font-size: 14px; font-weight: 700; color: #111; margin-bottom: 16px; }
.pcard__price-old { color: #9b9b9b; font-weight: 500; text-decoration: line-through; margin-right: 9px; }
.pcard__price-now { color: #111; font-weight: 700; }

/* Promotion badge — top-left on the image, brand blue, refined */
.pcard__badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 6px 13px;
  background: #1f44c2;
  color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  border-radius: 3px;
  box-shadow: 0 6px 16px rgba(31, 68, 194, .32);
}

/* Full-width solid black button */
.pcard__btn {
  margin-top: auto; width: 100%;
  background: #000; color: #fff; border: none;
  padding: 13px 12px; font: inherit; font-size: 12px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  transition: background .2s ease;
}
.pcard__btn:hover { background: #222; }
.pcard__btn.is-added { background: #1f7a44; }

/* ── Skeleton ─────────────────────────────────────────────────────────── */
.sk { position: relative; overflow: hidden; background: #eee; }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); animation: sksh 1.2s infinite; }
@keyframes sksh { 100% { transform: translateX(100%); } }
.pcard--sk .pcard__media { padding: 0; }
.sk-line { display: block; height: 12px; border-radius: 3px; margin: 8px auto; }

/* ── Responsive: columns 4 → 3 → 2 ────────────────────────────────────── */
@media (max-width: 1100px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) {
  .catalog { grid-template-columns: 1fr; gap: 28px; }
  .cat-sidebar { position: static; }
  .pgrid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 620px) {
  .pgrid { grid-template-columns: repeat(2, 1fr); gap: 30px 14px; }
  .catalog { padding: 20px 16px 70px; }
  .pagination { gap: 4px; margin-top: 44px; }
  .page-btn { min-width: 38px; height: 38px; font-size: 13px; }
}

/* ════════════════════════════════════════════════════════════════════════
   MOBILE STOREFRONT — off-canvas filter drawer + category chips + sticky bar.
   Everything in this section only activates ≤ 900px; desktop is untouched.
   ════════════════════════════════════════════════════════════════════════ */

/* Mobile-only chrome is hidden by default (desktop). */
.cat-sidebar__head,
.cat-sidebar__apply,
.filters-toggle,
.cat-chips,
.cat-overlay { display: none; }

@media (max-width: 900px) {
  /* One column on mobile → plain block layout. This avoids any grid-track
     blow-out (e.g. large product images forcing a column far wider than the
     screen, which made the cards huge). */
  .catalog { display: block; padding: 14px 16px 88px; }
  .catalog-main { min-width: 0; }

  /* ── Horizontal category chips rail ─────────────────────────────────── */
  .cat-chips {
    display: flex; gap: 9px; overflow-x: auto;
    margin: 0 -16px 4px; padding: 4px 16px 14px;
    scroll-snap-type: x proximity;
    -ms-overflow-style: none; scrollbar-width: none;
  }
  .cat-chips::-webkit-scrollbar { display: none; }
  .cat-chip {
    flex: 0 0 auto; scroll-snap-align: start;
    padding: 9px 17px; border-radius: 999px;
    border: 1px solid #e4e2dd; background: #fff;
    font: inherit; font-size: 13px; font-weight: 500; color: #4a4a4a;
    white-space: nowrap; cursor: pointer;
    transition: background .22s ease, color .22s ease, border-color .22s ease, transform .12s ease;
  }
  .cat-chip:active { transform: scale(.95); }
  .cat-chip.is-active {
    background: #0c0c0c; border-color: #0c0c0c; color: #fff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  }

  /* ── Sticky glass toolbar (the catalog-bar, repurposed) ─────────────── */
  .catalog-bar {
    position: sticky; top: 80px; z-index: 30;
    margin: 0 -16px 18px; padding: 11px 16px;
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
    border-top: 1px solid #f1f0ec; border-bottom: 1px solid #ececec;
    gap: 10px;
  }
  .catalog-bar__count { display: none; }

  .filters-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 17px; border: 1px solid #dcdcdc; border-radius: 999px;
    background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: #111;
    cursor: pointer; white-space: nowrap;
    transition: border-color .2s ease, color .2s ease, background .2s ease;
  }
  .filters-toggle i { font-size: 13px; }
  .filters-toggle:active { background: #f3f2ef; }
  .filters-toggle.has-filters { border-color: #1f44c2; color: #1f44c2; }
  .filters-toggle__count {
    display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
    background: #1f44c2; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1;
  }
  /* Class selector beats the [hidden] UA rule, so re-assert it. */
  .filters-toggle__count[hidden] { display: none; }

  .sortby { gap: 7px; font-size: 12px; color: #888; }
  .sortby select { padding: 10px 12px; border-radius: 10px; border-color: #dcdcdc; }

  /* ── Off-canvas filter drawer ───────────────────────────────────────── */
  .cat-sidebar {
    position: fixed; top: 0; left: 0; z-index: 2100;
    width: min(87vw, 370px); height: 100%; padding: 0;
    background: #fff; box-shadow: 28px 0 80px rgba(0, 0, 0, .26);
    display: flex; flex-direction: column; overflow: hidden;
    transform: translateX(-100%);
    transition: transform .44s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
  }
  body.filters-open .cat-sidebar { transform: translateX(0); }

  .cat-sidebar__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px; border-bottom: 1px solid #ececec; flex-shrink: 0;
  }
  .cat-sidebar__title {
    margin: 0; font-size: 18px; font-weight: 700; color: #0c0c0c;
    display: inline-flex; align-items: center; gap: 11px;
  }
  .cat-sidebar__title i { color: #1f44c2; font-size: 15px; }
  .cat-sidebar__close {
    width: 40px; height: 40px; display: grid; place-items: center;
    border: none; background: none; font-size: 21px; color: #111; cursor: pointer;
    border-radius: 50%; transition: background .2s ease, transform .3s ease;
  }
  .cat-sidebar__close:active { background: #f3f2ef; transform: rotate(90deg); }

  .cat-sidebar__body { flex: 1; overflow-y: auto; padding: 22px 20px; overscroll-behavior: contain; }
  .cat-sidebar__body::-webkit-scrollbar { width: 5px; }
  .cat-sidebar__body::-webkit-scrollbar-thumb { background: #dcd9d3; border-radius: 3px; }
  .filter-group { margin-bottom: 4px; }
  .filter-list { max-height: 244px; }

  .cat-sidebar__apply {
    display: block; flex-shrink: 0;
    padding: 14px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid #ececec; background: #fff;
    box-shadow: 0 -10px 24px rgba(0, 0, 0, .05);
  }
  .cat-apply-btn {
    width: 100%; padding: 16px; border: none; border-radius: 13px;
    background: linear-gradient(120deg, #141414, #000); color: #fff; cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .22); transition: transform .14s ease;
  }
  .cat-apply-btn:active { transform: scale(.99); }

  /* Drawer dim/blur overlay */
  .cat-overlay {
    display: block; position: fixed; inset: 0; z-index: 2050;
    background: rgba(10, 12, 18, .5);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s ease;
  }
  body.filters-open { overflow: hidden; }
  body.filters-open .cat-overlay { opacity: 1; visibility: visible; }

  /* ── Touch-friendly product cards ───────────────────────────────────── */
  .pcard__media { border-radius: 14px; }
  .pcard__btn { border-radius: 11px; padding: 12px; transition: background .2s ease, transform .12s ease; }
  .pcard__btn:active { transform: scale(.98); }
}

/* Phones: thinner navbar (64px) → re-anchor the sticky toolbar; tighter cards. */
@media (max-width: 768px) {
  .catalog-bar { top: 64px; }
}
@media (max-width: 620px) {
  .pgrid { gap: 26px 14px; }
  .pcard__body { padding-top: 13px; }
  .pcard__title { font-size: 12.5px; margin: 6px 0 8px; }
  .pcard__btn { font-size: 11.5px; letter-spacing: .06em; }
  .store-hero__title { font-size: clamp(28px, 8vw, 40px); }
}

@media (prefers-reduced-motion: reduce) {
  .cat-sidebar, .cat-overlay, .cat-chip, .cat-apply-btn, .pcard__btn { transition: none !important; }
}
