/* ==========================================================
   NISSI — jewelry (collection) page  ·  "Night boutique"
   ========================================================== */
.nav>a[aria-current=page]::after{transform:scaleX(1)}

/* head */
.page-head{position:relative;isolation:isolate;padding:clamp(28px,4vw,52px) 0 clamp(24px,3.4vw,40px);background:var(--bg-deep);border-bottom:1px solid var(--line)}
.page-head__desc{max-width:46ch;color:var(--muted);font-size:1.125rem}
.page-head__desc p{max-width:none;font-size:inherit}
.page-head__desc p+p{margin-top:.7em}
/* a Collection with a Background image: the photo behind the heading, darkened for the text */
.page-head.has-bg{padding:clamp(72px,11vw,150px) 0 clamp(32px,5vw,64px);overflow:hidden;color:#fff;border-bottom:0}
.page-head__bg{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover}
.page-head.has-bg::after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(5,31,25,.5) 0%,rgba(5,31,25,.72) 100%)}
.page-head.has-bg h1,.page-head.has-bg .crumbs,.page-head.has-bg .crumbs a,.page-head.has-bg p,.page-head.has-bg .page-head__desc{color:#fff}
.page-head.has-bg .crumbs a:hover{color:var(--gold-foil)}
.page-head__inner{display:flex;align-items:flex-end;justify-content:space-between;gap:2rem;flex-wrap:wrap}
.page-head p{max-width:34ch;color:var(--muted);font-size:1.125rem}
.crumbs{display:flex;gap:.6rem;font-size:.9375rem;color:var(--muted);margin-bottom:1rem}
.crumbs a:hover{color:var(--gold-hi)}

.tabs{display:flex;gap:.25rem;overflow-x:auto;scrollbar-width:none;margin-left:-.9rem;padding-right:1rem;min-width:0}
.tabs::-webkit-scrollbar{display:none}
.tab{position:relative;flex:none;min-height:56px;padding:0 .9rem;font-size:1rem;font-weight:400;color:var(--muted);white-space:nowrap;transition:color .25s}
.tab small{font-size:.875rem;margin-left:.35rem;opacity:.8}
.tab::after{content:"";position:absolute;left:.9rem;right:.9rem;bottom:-1px;height:2px;background:var(--accent);transform:scaleX(0);transform-origin:left;transition:transform .35s var(--ease)}
.tab:hover{color:var(--ink)}
.tab[aria-pressed=true]{color:var(--ink)}
.tab[aria-pressed=true]::after{transform:scaleX(1)}
.tab.is-off{opacity:.45}

/* count (and the Filters button on small screens) */
.catalog{padding-bottom:clamp(56px,8vw,104px)}
.meta{display:none}   /* only the Filters button lives here, and only on small screens */
.meta__filters{display:none;align-items:center;gap:.6rem;min-height:48px;padding:0 1.2rem;border:1px solid var(--accent);color:var(--accent);font-size:.8125rem;font-weight:500;letter-spacing:.18em;text-transform:uppercase}
.meta__filters b{display:inline-grid;place-items:center;min-width:20px;height:20px;border-radius:10px;background:var(--accent);color:#fff;font-size:.6875rem;letter-spacing:0}

/* layout */
.layout{display:grid;grid-template-columns:272px 1fr;gap:clamp(32px,4vw,64px);align-items:start;padding-top:clamp(24px,2.6vw,36px)}
.filters__reset-row{padding:18px 0 4px}
.results{min-width:0}
/* desktop: the filters stay in view while the grid scrolls (their own list scrolls when taller than the screen), and a line separates them from the grid */
@media (min-width:1001px){
  .layout{--fpad:clamp(20px,2.4vw,36px);grid-template-columns:calc(256px + var(--fpad)) minmax(0,1fr);column-gap:0}
  .filters{position:sticky;top:calc(var(--header-h) + 24px);max-height:calc(100svh - var(--header-h) - 48px);overflow-y:auto;overscroll-behavior:contain;padding-right:var(--fpad);scrollbar-width:thin;scrollbar-color:transparent transparent}
  .filters:hover{scrollbar-color:var(--line) transparent}
  .admin-bar .filters{top:calc(var(--header-h) + 24px + var(--wp-admin--admin-bar--height,32px));max-height:calc(100svh - var(--header-h) - 48px - var(--wp-admin--admin-bar--height,32px))}
  .results{border-left:1px solid var(--line-soft);padding-left:var(--fpad)}
}
.filters__head,.filters__foot,.filters-scrim{display:none}
.fgroup{border-bottom:1px solid var(--line-soft)}
.fgroup summary{list-style:none;display:flex;justify-content:space-between;align-items:center;min-height:56px;font-size:1.0625rem;font-weight:500}
.fgroup summary::-webkit-details-marker{display:none}
@media (min-width:1001px){
  .filters__body>.fgroup:first-child summary{min-height:36px;align-items:flex-start}
  .filters__body>.fgroup:first-child summary::after{margin-top:7px}
}
.fgroup summary::after{content:"";width:9px;height:9px;border-right:1.2px solid var(--ink);border-bottom:1.2px solid var(--ink);transform:rotate(45deg) translate(-2px,-2px);transition:transform .3s var(--ease)}
.fgroup[open] summary::after{transform:rotate(-135deg) translate(-2px,-2px)}
.fgroup ul{padding:0 0 12px}
.check{display:flex;align-items:center;gap:.8rem;min-height:40px;font-size:1rem}
.check input{position:absolute;opacity:0;pointer-events:none}
.check .box{width:18px;height:18px;border:1px solid #6f7d77;display:grid;place-items:center;flex:none;transition:background-color .2s}
.check input:checked+.box{background:var(--accent);border-color:var(--accent)}
.check input:checked+.box::after{content:"";width:9px;height:5px;border-left:1.5px solid #fff;border-bottom:1.5px solid #fff;transform:rotate(-45deg) translate(1px,-1px)}
.check input:focus-visible+.box{outline:2px solid var(--accent-hi);outline-offset:3px}
.check .lbl{flex:1}
.check .n{font-size:.875rem;color:var(--muted);font-variant-numeric:tabular-nums}
.check:hover .lbl{color:var(--gold-hi)}
.check.is-off{opacity:.4}
.fmore{min-height:44px;margin:0 0 14px;font-size:1rem;font-weight:500;color:var(--gold)}
.fmore:hover{color:var(--gold-hi)}

/* grid: photos sit in a lit "case" on the dark page */
/* adaptive grid: as many columns as fit with a card of at least --min wide, never more than 4 (max() lifts the minimum to a quarter of the row),
   so a wide desktop shows 4, a narrower window 3, a tablet 3 / 2; phones are fixed at 2 below */
.products{--gap:clamp(14px,1.6vw,24px);--min:220px;display:grid;gap:var(--gap);grid-template-columns:repeat(auto-fill,minmax(max(var(--min),calc((100% - 3 * var(--gap)) / 4)),1fr))}
/* the 3 / 4 buttons mean exactly 3 / 4 columns at every width (a wide-screen override used to give 4 / 5) */

/* the card carries the border; the photo sits flush inside it, the text below in its own padded zone, the "+" at its bottom right */
.product{position:relative;container-type:inline-size;display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line-soft);transition:border-color .3s var(--ease),box-shadow .3s var(--ease)}
.product:hover,.product:focus-within{border-color:var(--accent);box-shadow:0 8px 24px -14px rgba(11,63,51,.35)}
.product__link{display:flex;flex-direction:column;flex:1}
.product__img{position:relative;display:block;aspect-ratio:1/1;background:var(--case);overflow:hidden}
.product__img img{width:100%;height:100%;object-fit:cover;mix-blend-mode:multiply;opacity:0;transition:opacity .5s var(--ease),transform .9s var(--ease)}
.product__img img.product__img-alt{position:absolute;inset:0}
.product__img img.product__img-alt,.product__img img.product__img-alt.is-loaded{opacity:0}
@media (hover:hover){
  /* the photo grows a little inside its frame; the card itself never changes size */
  .product__link:hover .product__img img{transform:scale(1.05)}
  .product__link:hover .product__img.has-alt img{opacity:0}
  .product__link:hover .product__img.has-alt img.product__img-alt{opacity:1}
}
@media (prefers-reduced-motion:reduce){.product__link:hover .product__img img{transform:none}}
.product__img img.is-loaded{opacity:1}
.product__name{display:block;padding:1.1rem 1.2rem 0;font-size:1.3125rem;font-weight:400;line-height:1.2;transition:color .25s}
.product__link:hover .product__name{color:var(--accent-hi)}
.product__type{display:block;padding:.15rem 1.2rem 0;font-size:.9375rem;color:var(--muted)}
.product__price{display:block;margin-top:auto;padding:.9rem 1.2rem 1.35rem;font-size:1rem;font-weight:500;color:var(--ink);font-variant-numeric:tabular-nums}
.wish{position:absolute;top:5px;right:5px;z-index:2;width:44px;height:44px;display:grid;place-items:center;color:#0a352b;transition:color .25s}
.wish::before{content:"";position:absolute;width:34px;height:34px;border-radius:50%;background:rgba(238,235,226,.9);z-index:-1}
.wish:hover,.wish.is-on{color:var(--pom)}
.wish.is-on svg{fill:currentColor}
/* round "+" in the bottom row of the card: always visible, so it also works where there is no hover */
.add{position:absolute;right:1rem;bottom:1rem;z-index:2;width:44px;height:44px;border-radius:50%;display:grid;place-items:center;border:1px solid var(--accent);background:#fff;color:var(--accent);transition:background-color .25s,color .25s,transform .25s var(--ease)}
.add:hover{background:var(--accent);color:#fff}
.add:active{transform:scale(.94)}
.add .i-check{display:none}
.add.is-added{background:var(--accent);color:#fff}
.add.is-added .i-bag{display:none}
.add.is-added .i-check{display:block}

.empty{text-align:center;padding:72px 0}
.empty h2{margin-bottom:.6rem}
.empty p{color:var(--muted);margin-bottom:1.8rem}
.more{text-align:center;margin-top:clamp(48px,6vw,80px);display:grid;justify-items:center;gap:1rem}
.more p{font-size:1rem;color:var(--muted)}
.pager ul{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;list-style:none;margin:0;padding:0}
.pager__num,.pager__nav,.pager__gap{display:grid;place-items:center;min-width:44px;height:44px;padding:0 .4rem;font-size:1rem;font-variant-numeric:tabular-nums;color:var(--ink)}
.pager__num,.pager__nav{border:1px solid var(--line-soft);transition:border-color .2s,background-color .2s,color .2s}
a.pager__num:hover,a.pager__nav:hover{border-color:var(--accent);color:var(--accent)}
.pager__num.is-current{background:var(--accent);border-color:var(--accent);color:#fff}
.pager__nav.is-off{opacity:.3}
.pager__gap{color:var(--muted);min-width:24px}
.pager a:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (max-width:640px){.pager__num,.pager__nav{min-width:40px;height:40px}.pager ul{gap:4px}}

.toast{position:fixed;left:50%;bottom:24px;z-index:var(--z-sheet);transform:translate(-50%,20px);background:var(--accent);color:#fff;font-size:1rem;font-weight:500;padding:.9rem 1.4rem;opacity:0;pointer-events:none;transition:opacity .3s,transform .3s var(--ease)}
.toast.is-on{opacity:1;transform:translate(-50%,0)}

/* ---------- tablet / mobile ---------- */
@media (max-width:1000px){
  .layout{grid-template-columns:1fr}
  .meta{display:block;padding:16px 0}
  .meta__filters{display:flex;width:100%;justify-content:center;min-height:46px}
  .filters__reset-row{display:none}
  .filters{position:fixed;z-index:var(--z-sheet);top:0;bottom:0;left:0;width:min(400px,92vw);max-height:none;overflow-y:auto;background:#fff;border-right:1px solid var(--line);padding:0;display:flex;flex-direction:column;transform:translateX(-100%);transition:transform .45s var(--ease),visibility 0s .45s;visibility:hidden;overflow:visible}
  .filters.is-open{transform:none;visibility:visible;transition:transform .45s var(--ease)}
  .filters__head{display:flex;justify-content:space-between;align-items:center;padding:12px 12px 12px 24px;border-bottom:1px solid var(--line)}
  .filters__head h2{font-size:1.75rem}
  .filters__close{width:44px;height:44px;display:grid;place-items:center}
  .filters__body{flex:1;overflow-y:auto;padding:0 24px}
  .filters__foot{display:grid;grid-template-columns:1fr 1.5fr;gap:.8rem;padding:16px 24px;border-top:1px solid var(--line)}
  .filters__foot .btn{padding:0 .5rem;gap:.35em}
  .filters-scrim{display:block;position:fixed;inset:0;z-index:calc(var(--z-sheet) - 1);background:rgba(11,63,51,.5);opacity:0;pointer-events:none;transition:opacity .35s}
  .filters-scrim.is-open{opacity:1;pointer-events:auto}
}
@media (max-width:640px){
  .products{grid-template-columns:repeat(2,minmax(0,1fr))}
  .product__name{font-size:1.125rem;padding:.9rem .9rem 0}
  .product__type{padding:.1rem .9rem 0}
  .product__price{padding:.7rem .9rem .95rem}
  .toast{bottom:16px;width:calc(100% - 32px);text-align:center}
}

/* product carousels (Featured on the home page, "More from" on the product page): cards keep their size, Swiper does the sliding */
.rail--cards{padding-top:4px;padding-bottom:24px;margin-bottom:-12px}
.rail--cards .product{width:clamp(220px,19vw,340px);height:auto}
@media (max-width:640px){.rail--cards .product{width:64vw}}
