/**
 * NirWeb — shared design tokens + component styles
 *
 * Keep one-off layout utilities in HTML/Tailwind.
 * Put repeated UI contracts here (→ Next.js components + admin theme knobs).
 */

:root {
 --color-primary: var(--brand-primary);
 --color-primary-hover: var(--brand-primary-hover);
 --color-on-primary: var(--brand-on-primary);
 --color-incredible-offer: var(--brand-incredible-offer);
 --color-discount-badge: var(--brand-discount-badge);
 --color-outline: var(--outline);
 --color-tertiary: var(--tertiary);
 --color-surface-lowest: var(--surface-container-lowest);
 --color-on-surface: var(--on-surface);
 --color-on-surface-variant: var(--on-surface-variant);
 --btn-height: 2.5rem;
 --btn-font-size: var(--type-body-md);
 --btn-line-height: 1.2;

  /* Product card typography */
 --product-card-title-size: var(--type-label-md);
 --product-card-title-weight: 400;
 --product-card-title-line-height: 1.5;
 --product-card-price-size: var(--type-price-md);
 --product-card-price-weight: 800;
 --product-card-price-line-height: 1.25;

  /* Magazine card typography */
 --magazine-card-title-size: var(--type-title-sm);
 --magazine-card-title-weight: 700;

  /* Magazine feature / hero title */
 --magazine-feature-title-size: var(--type-headline-lg);
 --magazine-feature-title-weight: 700;

  /* Magazine list article titles */
 --magazine-list-title-size: var(--type-title-md);
 --magazine-list-title-weight: 700;

  /* Magazine sidebar / ranking titles */
 --magazine-rank-title-size: var(--type-label-md);
 --magazine-rank-title-weight: 600;

  /* Product imagery */
 --product-image-radius: 0.5rem;

  /* Product detail page */
 --product-page-title-size: var(--type-headline-lg);
 --product-page-title-weight: 700;
 --product-page-title-line-height: 1.55;

  /* Magazine article page title */
 --article-page-title-size: var(--type-headline-lg);
 --article-page-title-weight: 700;
 --article-page-title-line-height: 1.55;
}

/* ——— Base shell ——— */
html,
body {
 margin: 0;
 padding: 0;
 overflow-x: clip;
}

body {
 overscroll-behavior: none;
}

/* Storefront layout rail — fluid until max; use on every public page */
:root {
 --site-container-max: 1644px;
 --home-container-max: 1304px;
}

.site-container,
.nx-container {
 width: 100%;
 max-width: var(--site-container-max);
 margin-left: auto;
 margin-right: auto;
 padding-left: max(1rem, env(safe-area-inset-left));
 padding-right: max(1rem, env(safe-area-inset-right));
}

@media (min-width: 768px) {
 .site-container,
 .nx-container {
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
 }
}

/* Homepage content only — header/footer keep --site-container-max */
.home-page .site-container,
.home-page .nx-container {
 max-width: var(--home-container-max);
}

.category-mega__trigger.is-open {
  position: relative;
}

.category-mega__trigger.is-open::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: var(--brand-primary, #e11d48);
  border-radius: 999px;
}

html[data-hide-product-faq] [data-product-section="faq"],
html[data-hide-product-price-chart] [data-product-section="price-chart"],
html[data-hide-product-specs] [data-product-section="specs"],
html[data-hide-login-google] [data-login-section="google"],
html[data-hide-checkout-club] [data-checkout-section="club"] {
  display: none !important;
}

html[data-hide-checkout-club] [data-account-club-grid] {
  grid-template-columns: 1fr;
}

.category-mega__overlay {
  position: fixed;
  inset: 0;
  top: var(--header-offset);
  z-index: 40;
  background: rgb(15 23 42 / 0.38);
  animation: category-mega-fade 0.16s ease-out;
}

/* A short, subtle reveal instead of an instant pop; the panel is mounted only while open. */
@keyframes category-mega-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes category-mega-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .category-mega__overlay,
  .category-mega__panel { animation: none; }
}

.category-mega__panel {
  animation: category-mega-in 0.18s ease-out;
  position: fixed;
  top: var(--header-offset);
  z-index: 60;
  display: flex;
  max-height: min(36rem, calc(100vh - var(--header-offset) - 1.5rem));
  overflow: hidden;
  background: var(--surface-container-lowest, #fff);
  border-radius: 0 0 0.75rem 0.75rem;
  box-shadow: 0 18px 48px rgb(15 23 42 / 0.16);
}

.category-mega__rail {
  width: 15.5rem;
  flex-shrink: 0;
  overflow-y: auto;
  background: var(--surface-subtle, #f6f6f8);
  border-inline-end: 1px solid var(--border-hairline, rgb(0 0 0 / 0.06));
}

.category-mega__rail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  color: var(--on-surface, #1a1a1a);
  font-size: var(--type-label-md, 0.875rem);
  font-weight: 600;
  text-align: right;
  transition: background 0.15s ease, color 0.15s ease;
}

.category-mega__rail-item:hover,
.category-mega__rail-item.is-active {
  background: var(--surface-container-lowest, #fff);
  color: var(--brand-primary, #e11d48);
}

.category-mega__rail-item.is-active {
  border-inline-start: 3px solid var(--brand-primary, #e11d48);
}

.category-mega__body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.5rem;
}

.category-mega__all {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  color: var(--brand-primary, #e11d48);
  font-size: var(--type-title-sm, 0.95rem);
  font-weight: 700;
}

.category-mega__all:hover {
  color: var(--brand-crimson-active, #be123c);
}

.category-mega__groups {
  columns: 3;
  column-gap: 2rem;
}

.category-mega__group {
  break-inside: avoid;
  margin-bottom: 1.35rem;
}

.category-mega__group-title {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-bottom: 0.45rem;
  color: var(--on-surface, #1a1a1a);
  font-size: var(--type-label-md, 0.875rem);
  font-weight: 800;
}

.category-mega__group-title:hover {
  color: var(--brand-primary, #e11d48);
}

.category-mega__group ul {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-mega__group a {
  color: var(--on-surface-variant, #5c5c66);
  font-size: var(--type-body-sm, 0.8125rem);
}

.category-mega__group a:hover {
  color: var(--brand-primary, #e11d48);
}

@media (max-width: 1023px) {
  .category-mega__groups {
    columns: 2;
  }
}

main > :first-child {
 margin-top: 0 !important;
}

main > :last-child {
 margin-bottom: 0 !important;
}

/* The page and scrolling panels keep a visible, themed scrollbar (globals.css); only the rails below hide theirs. */

/* ——— Homepage mobile rails ——— */

.home-section-title {
  font-size: 14px;
  line-height: 22px;
  font-weight: 700;
}

.home-section-more {
  font-size: 12px;
  line-height: 18px;
}

@media (min-width: 768px) {
  .home-section-title {
    font-size: var(--type-headline-lg, 22px);
    line-height: var(--type-headline-lg-lh, 34px);
  }

  .home-section-more {
    font-size: var(--type-title-sm, 14px);
    line-height: var(--type-title-sm-lh, 24px);
  }
}

.home-hero-slider,
.hero-wide {
  overflow-anchor: none;
}

.home-hero-slider {
  touch-action: pan-y;
  cursor: grab;
}

.hero-wide {
  width: 100%;
}

.hero-wide__frame {
  position: relative;
}

.hero-wide__track {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.hero-wide__track::-webkit-scrollbar {
  display: none;
}

.hero-wide__track.is-dragging {
  scroll-behavior: auto;
  cursor: grabbing;
}

/* Phones: rounded slides in the mobile image's ratio (750×420) with the previous/next slide
   peeking on both sides; without a mobile image the desktop banner keeps its own ratio instead
   of being cropped. Tablets and up: edge-to-edge in the desktop ratio. */
.hero-wide__slide {
  position: relative;
  flex: 0 0 90%;
  aspect-ratio: 750 / 420;
  border-radius: 0.875rem;
  overflow: hidden;
  scroll-snap-align: center;
  background: var(--surface-container);
}

.hero-wide__slide--desktop-only {
  aspect-ratio: 1920 / 400;
}

@media (min-width: 768px) {
  .hero-wide__track {
    gap: 0;
  }

  .hero-wide__slide,
  .hero-wide__slide--desktop-only {
    flex-basis: 100%;
    aspect-ratio: 1920 / 400;
    border-radius: 0;
  }
}

.hero-wide__slide picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-wide__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-wide__arrow {
  display: none;
}

.hero-wide__dots {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.hero-wide__dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  border: 0;
  background: var(--outline-variant);
}

.hero-wide__dot.is-active {
  width: 1.15rem;
  background: var(--brand-primary);
}

@media (min-width: 1024px) {
  .hero-wide__arrow {
    display: flex;
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.92);
    color: #17183a;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.12);
    transform: translateY(-50%);
  }

  .hero-wide__arrow--prev {
    right: 1rem;
  }

  .hero-wide__arrow--next {
    left: 1rem;
  }

  .hero-wide__dots {
    position: absolute;
    bottom: 1rem;
    inset-inline: 0;
    margin-top: 0;
  }

  .hero-wide__dot {
    background: rgb(255 255 255 / 0.55);
  }

  .hero-wide__dot.is-active {
    background: #fff;
  }
}

/* Circular shortcuts: a swipeable edge-to-edge row on phones (about 4.5 visible so the next
   one peeks), a regular grid from sm: up (see ShortcutsSection). */
@media (max-width: 639px) {
  .shortcuts-rail {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--page-gutter);
    scrollbar-width: none;
    margin-inline: calc(-1 * var(--page-gutter));
    padding: 0.25rem var(--page-gutter);
    -webkit-overflow-scrolling: touch;
  }

  .shortcuts-rail::-webkit-scrollbar {
    display: none;
  }

  .shortcuts-rail > * {
    flex: 0 0 calc((100% - 2rem) / 4.5);
    scroll-snap-align: start;
  }
}

.home-snap-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.home-snap-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #17183a;
  box-shadow: 0 2px 12px rgba(23, 24, 58, 0.14);
  transform: translateY(-50%);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.home-snap-arrow:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(23, 24, 58, 0.2);
  transform: translateY(-50%) scale(1.04);
}

.home-snap-arrow .material-symbols-outlined {
  font-size: 1.35rem;
  line-height: 1;
}

.home-snap-arrow--prev {
  right: 0.35rem;
}

.home-snap-arrow--next {
  left: 0.35rem;
}

.home-snap-rail .home-snap-track {
  cursor: grab;
}

.home-snap-rail .home-snap-track.is-dragging {
  cursor: grabbing;
}

.home-snap-track.is-dragging,
.home-snap-track.is-dragging * {
  cursor: grabbing;
  user-select: none;
}

.home-snap-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.home-snap-track::-webkit-scrollbar {
  display: none;
}

.home-snap-track > * {
  scroll-snap-align: start;
  min-width: 0;
}

.home-snap-track--incredible > * {
  flex: 0 0 calc((100% - 0.5rem) / 2.28);
}

.home-snap-track--cats > *,
.home-snap-track--brands > * {
  flex: 0 0 38%;
}

.home-snap-track--magazine > * {
  flex: 0 0 72%;
}

/* Product box rail: 6 cards on desktop (5 on laptops) plus a sliver of the next one as a swipe hint */
.home-snap-track--rail {
  gap: 0.625rem;
}

.home-snap-track--rail > * {
  flex: 0 0 calc((100% - 1.25rem) / 2.3);
}

@media (min-width: 640px) {
  .home-snap-track--rail > * {
    flex-basis: calc((100% - 1.875rem) / 3.35);
  }
}

@media (min-width: 1024px) {
  .home-snap-track--rail > * {
    flex-basis: calc((100% - 3.125rem) / 5.3);
  }
}

@media (min-width: 1280px) {
  .home-snap-track--rail > * {
    flex-basis: calc((100% - 3.75rem) / 6.3);
  }
}

@media (min-width: 420px) {
  .home-snap-track--incredible > * {
    flex-basis: calc((100% - 1rem) / 3.28);
  }

  .home-snap-track--cats > *,
  .home-snap-track--brands > * {
    flex-basis: 28%;
  }
}

@media (min-width: 640px) {
  .home-snap-track--magazine > * {
    flex-basis: calc((100% - 0.5rem) / 2.22);
  }
}

@media (min-width: 1024px) {
  .home-snap-track--incredible {
    gap: 0.5rem;
  }

  .home-snap-track--incredible > * {
    flex-basis: calc((100% - 1.5rem) / 4.28);
  }

  /* Keep cats/brands as a single-row horizontal slider on desktop */
  .home-snap-track--cats,
  .home-snap-track--brands {
    gap: 1rem;
  }

  .home-snap-track--cats > *,
  .home-snap-track--brands > * {
    flex: 0 0 calc((100% - 6rem) / 7);
  }

  .home-snap-track--magazine {
    display: grid;
    overflow: visible;
    scroll-snap-type: none;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .home-snap-track--magazine > * {
    flex: none;
    width: auto;
  }
}

@media (min-width: 1280px) {
  .home-snap-track--incredible > * {
    flex-basis: calc((100% - 2rem) / 5.28);
  }
}

@media (max-width: 1023px) {
  .home-snap-track--incredible .product-card {
    padding: 0.5rem;
  }

  .home-snap-track--incredible .product-shipping {
    display: none;
  }

  .home-snap-track--incredible .product-card-title {
    font-size: 11px;
    line-height: 16px;
  }

  .home-snap-track--incredible .product-card-price {
    font-size: 15px;
    line-height: 20px;
    font-variant-numeric: normal;
  }

  .home-snap-track--incredible .product-card-price-compare {
    font-size: 11px;
    line-height: 14px;
  }

  .home-snap-track--incredible .badge-incredible {
    flex-shrink: 0;
    font-size: 10px;
    padding: 1px 5px;
  }

  .home-snap-track--incredible .badge-incredible-soft {
    font-size: 10px;
    padding: 1px 6px;
  }

  .home-snap-track--incredible .product-price-unit {
    font-size: 10px;
  }

  .home-snap-track--incredible .text-label-sm,
  .home-snap-track--incredible .font-label-sm {
    font-size: 10px;
    line-height: 14px;
  }

  .home-snap-track--cats .font-title-sm,
  .home-snap-track--cats [class*="text-title-sm"] {
    font-size: 12px;
    line-height: 18px;
  }
}

.auth-step-hidden {
 display: none !important;
}

/* ——— Product card (→ components/ProductCard) ——— */

.product-card {
 background-color: var(--color-surface-lowest);
 border-radius: 0.75rem;
 box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
 transition: box-shadow 0.2s ease;
 min-width: 0;
 overflow: hidden;
}

.product-card:hover {
 box-shadow:
 0 4px 6px -1px rgb(0 0 0 / 0.1),
 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.product-card-title {
 font-size: var(--product-card-title-size);
 font-weight: var(--product-card-title-weight);
 line-height: var(--product-card-title-line-height);
}

.product-card-price {
 font-size: var(--product-card-price-size);
 font-weight: var(--product-card-price-weight);
 line-height: var(--product-card-price-line-height);
 font-variant-numeric: tabular-nums;
}

/* Compare-at / struck price (never use product-card-price on these) */
.product-card-price-compare {
 font-size: 12px;
 font-weight: 400;
 line-height: 20px;
 color: var(--color-outline);
 text-decoration: line-through;
 font-variant-numeric: tabular-nums;
}

.product-price-row {
 display: flex;
 align-items: flex-end;
 justify-content: space-between;
 gap: 0.25rem;
 min-width: 0;
 width: 100%;
}

.product-price-stack {
 display: flex;
 flex-direction: column;
 align-items: flex-end;
 min-width: 0;
 max-width: 100%;
}

.product-price-now {
 display: flex;
 flex-wrap: wrap;
 align-items: baseline;
 justify-content: flex-end;
 gap: 0.125rem;
 min-width: 0;
 max-width: 100%;
}

.product-price-now .product-card-price {
 min-width: 0;
}

.product-price-unit {
 flex-shrink: 0;
 font-size: 10px;
 font-weight: 400;
 line-height: 1;
 color: var(--color-on-surface-variant);
}

.product-shipping {
 display: inline-flex;
 align-items: center;
 gap: 4px;
 font-size: 12px;
 font-weight: 400;
 line-height: 16px;
 color: var(--color-tertiary);
}

/* ——— Badges (→ components/Badge) ——— */

.badge-incredible {
 display: inline-block;
 background-color: var(--color-incredible-offer);
 color: var(--color-on-primary);
 font-size: 12px;
 font-weight: 700;
 line-height: 1.35;
 padding: 2px 8px;
 border-radius: 9999px;
}

/* Soft surface chip (e.g. amazing-offer corner label) */
.badge-incredible-soft {
 display: inline-block;
 background-color: var(--brand-primary-surface);
 color: var(--color-primary);
 font-size: 12px;
 font-weight: 700;
 line-height: 1.35;
 padding: 2px 8px;
 border-radius: 0.25rem;
}

.badge-discount {
 display: inline-block;
 background-color: var(--color-discount-badge);
 color: var(--color-on-primary);
 font-size: 12px;
 font-weight: 700;
 line-height: 1.35;
 padding: 2px 6px;
 border-radius: 9999px;
}

/* ——— Buttons (→ components/Button) ——— */

.btn-primary {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 4px;
 min-height: var(--btn-height);
 padding: 0 1.25rem;
 background-color: var(--color-primary);
 color: var(--color-on-primary);
 border-radius: 0.5rem;
 font-size: var(--btn-font-size);
 font-weight: 600;
 line-height: var(--btn-line-height);
 transition: background-color 0.15s ease;
 border: none;
 cursor: pointer;
 text-decoration: none;
}

.btn-primary:hover {
 background-color: var(--color-primary-hover);
}

/* ——— Magazine (→ components/MagazineCard) ——— */

.magazine-card-title {
 font-size: var(--magazine-card-title-size);
 font-weight: var(--magazine-card-title-weight);
 line-height: 1.5;
}

/* Homepage magazine cards: Tailwind 3 CDN paints border-t as gray-200
   because border-hairline/20 is not a real color utility. Match that. */
.border-hairline\/20 {
 border-color: #e5e7eb;
}

.magazine-feature-title {
 font-size: var(--magazine-feature-title-size);
 font-weight: var(--magazine-feature-title-weight);
 line-height: 1.5;
}

.magazine-list-title {
 font-size: var(--magazine-list-title-size);
 font-weight: var(--magazine-list-title-weight);
 line-height: 1.5;
}

.magazine-rank-title {
 font-size: var(--magazine-rank-title-size);
 font-weight: var(--magazine-rank-title-weight);
 line-height: 1.5;
}

/* ——— Media ——— */

/* Radius on the <img> itself — not the surrounding box */
.media-zoom,
.product-thumb {
 border-radius: var(--product-image-radius);
}

.media-zoom {
 width: 100%;
 height: 100%;
 object-fit: contain;
 transition: transform 0.3s ease;
}

.group:hover .media-zoom {
 transform: scale(1.05);
}

.media-zoom-cover {
 width: 100%;
 height: 100%;
 object-fit: cover;
 transition: transform 0.5s ease;
}

.group:hover .media-zoom-cover {
 transform: scale(1.05);
}

/* ——— Typography / chrome (→ layout + Footer) ——— */

.section-heading {
  font-size: 16px;
  font-weight: 700;
  line-height: 26px;
  color: var(--color-on-surface);
}

/* Ticket / support card subject line */
.ticket-subject {
  font-size: 16px;
  font-weight: 700;
  line-height: 26px;
  color: var(--color-on-surface);
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.footer-col-title {
 font-size: 14px;
 font-weight: 600;
 line-height: 24px;
 color: var(--color-on-surface);
 margin-bottom: 4px;
}

.link-muted {
 color: var(--color-on-surface-variant);
 font-size: 14px;
 font-weight: 400;
 line-height: 24px;
 transition: color 0.15s ease;
 text-decoration: none;
}

.link-muted:hover {
 color: var(--color-primary);
}

/* ——— Product detail (→ components/ProductDetail) ——— */

.product-page-title {
 font-size: var(--product-page-title-size);
 font-weight: var(--product-page-title-weight);
 line-height: var(--product-page-title-line-height);
 color: var(--color-on-surface);
}

.article-page-title {
 font-size: var(--article-page-title-size);
 font-weight: var(--article-page-title-weight);
 line-height: var(--article-page-title-line-height);
 color: var(--color-on-surface);
}

.btn-add-to-cart {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 8px;
 width: 100%;
 min-height: var(--btn-height);
 padding: 0 1rem;
 background-color: var(--color-incredible-offer);
 color: var(--color-on-primary);
 border: none;
 border-radius: 0.5rem;
 font-size: var(--btn-font-size);
 font-weight: 600;
 line-height: var(--btn-line-height);
 cursor: pointer;
 box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
 transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-add-to-cart:hover {
 background-color: var(--color-primary-hover);
}

.btn-add-to-cart:active {
 transform: scale(0.98);
}

.btn-add-to-cart .material-symbols-outlined {
 font-size: 20px;
}

.review-star-btn {
 background: none;
 border: none;
 padding: 0;
 cursor: pointer;
 color: #c8c8d4;
 line-height: 1;
 transition: color 0.15s ease, transform 0.1s ease;
}

.review-star-btn .material-symbols-outlined {
 font-size: 28px;
 font-variation-settings: "FILL" 0;
}

.review-star-btn.is-active {
 color: #f9a825;
}

.review-star-btn.is-active .material-symbols-outlined {
 font-variation-settings: "FILL" 1;
}

.review-star-btn:hover {
 transform: scale(1.08);
}

.review-form-panel {
 display: none;
}

.review-form-panel.is-open {
 display: flex;
}

/* ——— Product gallery lightbox ——— */

.gallery-lightbox {
 position: fixed;
 inset: 0;
 z-index: 80;
 display: none;
 align-items: center;
 justify-content: center;
 padding: 1rem;
 background: rgba(0, 0, 0, 0.72);
 backdrop-filter: blur(4px);
}

.gallery-lightbox.is-open {
 display: flex;
}

.gallery-lightbox__panel {
 width: min(920px, 100%);
 max-height: min(92vh, 900px);
 background: var(--surface-container-lowest);
 border-radius: 0.75rem;
 box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
 display: flex;
 flex-direction: column;
 overflow: hidden;
}

.gallery-lightbox__header {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 0.75rem;
 padding: 0.75rem 1rem;
 border-bottom: 1px solid var(--border-hairline);
}

.gallery-lightbox__stage {
 position: relative;
 flex: 1;
 min-height: 280px;
 display: flex;
 align-items: center;
 justify-content: center;
 background: var(--surface-page);
 padding: 1.25rem;
}

.gallery-lightbox__stage img {
 max-width: 100%;
 max-height: min(62vh, 560px);
 object-fit: contain;
 border-radius: var(--product-image-radius);
}

.gallery-lightbox__nav {
 position: absolute;
 top: 50%;
 transform: translateY(-50%);
 width: 42px;
 height: 42px;
 border: none;
 border-radius: 9999px;
 background: var(--surface-container-lowest);
 color: var(--color-on-surface);
 box-shadow: 0 4px 14px rgba(35, 37, 78, 0.12);
 display: inline-flex;
 align-items: center;
 justify-content: center;
 cursor: pointer;
 transition: background-color 0.15s ease, color 0.15s ease;
}

.gallery-lightbox__nav:hover {
 background: var(--color-primary);
 color: #fff;
}

.gallery-lightbox__nav--prev {
 right: 1rem;
}

.gallery-lightbox__nav--next {
 left: 1rem;
}

.gallery-lightbox__thumbs {
 display: flex;
 gap: 0.5rem;
 padding: 0.75rem 1rem 1rem;
 overflow-x: auto;
 border-top: 1px solid var(--border-hairline);
 background: var(--surface-container-lowest);
}

.gallery-lightbox__thumb {
 width: 64px;
 height: 64px;
 flex-shrink: 0;
 border: none;
 border-radius: 0.5rem;
 padding: 0.25rem;
 background: var(--surface-page);
 overflow: hidden;
 cursor: pointer;
 ring: none;
 outline: 2px solid transparent;
 outline-offset: 0;
 transition: outline-color 0.15s ease;
}

.gallery-lightbox__thumb img {
 width: 100%;
 height: 100%;
 object-fit: contain;
 border-radius: 0.25rem;
}

.gallery-lightbox__thumb.is-active {
 outline-color: var(--color-primary);
}

body.gallery-lock {
 overflow: hidden;
}

/* ——— Price range dual slider (→ components/PriceRangeFilter) ——— */

.price-range {
 position: relative;
 height: 28px;
 display: flex;
 align-items: center;
 direction: ltr;
 --price-range-min: 0%;
 --price-range-max: 100%;
}

.price-range__rail {
 position: absolute;
 inset-inline: 0;
 height: 6px;
 border-radius: 9999px;
 background: #e1e0ff;
 pointer-events: none;
}

.price-range__fill {
 position: absolute;
 top: 0;
 bottom: 0;
 left: var(--price-range-min);
 right: calc(100% - var(--price-range-max));
 border-radius: 9999px;
 background: var(--color-primary);
}

.price-range__input {
 position: absolute;
 inset: 0;
 width: 100%;
 margin: 0;
 background: transparent;
 pointer-events: none;
 appearance: none;
 -webkit-appearance: none;
 outline: none;
 z-index: 2;
}

.price-range__input#price-max {
 z-index: 3;
}

.price-range__input::-webkit-slider-runnable-track {
 height: 6px;
 background: transparent;
}

.price-range__input::-moz-range-track {
 height: 6px;
 background: transparent;
 border: none;
}

.price-range__input::-webkit-slider-thumb {
 -webkit-appearance: none;
 appearance: none;
 pointer-events: auto;
 width: 18px;
 height: 18px;
 border-radius: 50%;
 background: var(--color-primary);
 border: 2px solid #fff;
 box-shadow: 0 1px 4px rgb(0 0 0 / 0.18);
 cursor: pointer;
 margin-top: -6px;
}

.price-range__input::-moz-range-thumb {
 pointer-events: auto;
 width: 18px;
 height: 18px;
 border-radius: 50%;
 background: var(--color-primary);
 border: 2px solid #fff;
 box-shadow: 0 1px 4px rgb(0 0 0 / 0.18);
 cursor: pointer;
}

.price-range__input:focus-visible::-webkit-slider-thumb {
 outline: 2px solid var(--color-primary);
 outline-offset: 2px;
}

.price-range__input:focus-visible::-moz-range-thumb {
 outline: 2px solid var(--color-primary);
 outline-offset: 2px;
}

.home-snap-track--products > * {
  flex: 0 0 calc((100% - 0.5rem) / 2.28);
}

.home-snap-track--cards > * {
  flex: 0 0 72%;
}

.home-snap-track--timeline > * {
  flex: 0 0 82%;
  max-width: 20rem;
}

@media (min-width: 640px) {
  .home-snap-track--cards > * {
    flex-basis: calc((100% - 0.5rem) / 2.22);
  }

  .home-snap-track--timeline > * {
    flex-basis: 20rem;
  }
}

@media (min-width: 1024px) {
  .home-snap-track--products,
  .home-snap-track--cards {
    display: grid;
    overflow: visible;
    scroll-snap-type: none;
    gap: 1rem;
  }

  .home-snap-track--products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .home-snap-track--cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .text-display-lg,
  .font-display-lg {
    font-size: 1.375rem;
    line-height: 1.3;
  }

  .text-headline-xl,
  .font-headline-xl {
    font-size: 1.125rem;
    line-height: 1.45;
  }

  .text-headline-lg,
  .font-headline-lg {
    font-size: 1rem;
    line-height: 1.45;
  }

  .text-headline-sm,
  .font-headline-sm {
    font-size: 0.9375rem;
    line-height: 1.4;
  }

  .product-page-title,
  .article-page-title,
  .magazine-feature-title {
    font-size: 1.125rem;
    line-height: 1.45;
  }

  .section-heading {
    font-size: 14px;
    line-height: 22px;
  }

  .notfound-hero-num {
    font-size: 88px;
    line-height: 1;
  }
}

.notfound-hero-num {
  font-size: 150px;
  line-height: 1;
}

.home-promos {
  display: grid;
  align-items: start;
  gap: 0.75rem;
}

.home-promos[data-count='1'] {
  grid-template-columns: 1fr;
}

.home-promos[data-count='2'] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-promos[data-count='3'] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-promos[data-count='4'] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-promo {
  display: block;
  overflow: hidden;
  border-radius: 0.85rem;
  background: var(--surface-container, #eee);
}

.home-promo:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.home-promo picture,
.home-promo img {
  display: block;
  width: 100%;
  height: auto;
}

/* Banner shown on one device only (PromosSection); in the page builder it stays visible, dimmed. */
.home-promo--tagged {
  position: relative;
}

.home-promo--tagged picture {
  opacity: 0.55;
}

.home-promo__tag {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

@media (min-width: 768px) {
  .home-promo--mobile {
    display: none !important;
  }
}

/* Phones: their own arrangement (data-mobile), not the desktop column count. */
@media (max-width: 767px) {
  .home-promo--desktop {
    display: none !important;
  }

  .home-promos[data-mobile='1'] {
    grid-template-columns: 1fr;
  }

  .home-promos[data-mobile='2'] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .home-promos[data-mobile='2'] > .home-promo--wide-m {
    grid-column: 1 / -1;
  }

  .home-promos[data-mobile='scroll'] {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--page-gutter);
    scrollbar-width: none;
    margin-inline: calc(-1 * var(--page-gutter));
    padding-inline: var(--page-gutter);
    -webkit-overflow-scrolling: touch;
  }

  .home-promos[data-mobile='scroll']::-webkit-scrollbar {
    display: none;
  }

  .home-promos[data-mobile='scroll'] > * {
    flex: 0 0 82%;
    scroll-snap-align: start;
  }
}

/* Rich product description (admin editor output). */
.product-description > * + * {
  margin-top: 0.85em;
}

.product-description h2,
.product-description h3,
.product-description h4 {
  font-weight: 800;
  line-height: 1.6;
  color: var(--on-surface, #1f2937);
}

.product-description h2 {
  font-size: 1.2em;
  margin-top: 1.4em;
}

.product-description h3 {
  font-size: 1.08em;
  margin-top: 1.2em;
}

.product-description h4 {
  font-size: 1em;
  margin-top: 1em;
}

.product-description ul,
.product-description ol {
  padding-inline-start: 1.4em;
}

.product-description ul {
  list-style: disc;
}

.product-description ol {
  list-style: decimal;
}

.product-description li + li {
  margin-top: 0.3em;
}

.product-description a {
  color: var(--brand-primary, #ef394e);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.product-description blockquote {
  border-inline-start: 3px solid var(--brand-primary, #ef394e);
  padding: 0.4em 0.9em;
  background: var(--surface-container-low, #f7f7f9);
  border-radius: 0.4rem;
}

.product-description img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin-inline: auto;
}

.product-description table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
  display: block;
  overflow-x: auto;
}

.product-description th,
.product-description td {
  border: 1px solid var(--border-hairline, #e0e0e6);
  padding: 0.45em 0.7em;
  text-align: start;
  vertical-align: top;
}

.product-description th {
  background: var(--surface-container-low, #f7f7f9);
  font-weight: 700;
}

.product-description td > p,
.product-description th > p {
  margin: 0;
}

.product-description hr {
  border: 0;
  border-top: 1px solid var(--border-hairline, #e0e0e6);
  margin-block: 1.4em;
}

.product-description code {
  font-size: 0.9em;
  background: var(--surface-container-low, #f7f7f9);
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
}

/* Story circles row (page-builder «استوری‌ها»): scrollable without a visible scrollbar. */
.stories-rail {
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.stories-rail::-webkit-scrollbar {
  display: none;
}
