/**
 * jensik — Commerce Components
 * ===============================
 * ProductCard, CategoryCard, Price, StockStatus, Rating, ReviewCard,
 * SizeSelector, ColorSelector, QuantitySelector, ProductGallery,
 * PromotionalBanner, attribute lists, sticky mobile CTA, BestSellers.
 */

/* =======================================================================
 * PRODUCT CARD — .nk-product-card
 * Mobile: 2-up grid. Tablet: 3-up. Desktop: 4-up.
 * The whole card is one link target; secondary actions sit above it.
 * ===================================================================== */

.nk-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--nk-surface-raised);
  border: var(--nk-border-width) solid var(--nk-border-subtle);
  border-radius: var(--nk-radius-lg);
  overflow: hidden;
  transition: box-shadow var(--nk-duration-normal) var(--nk-ease-standard),
              transform var(--nk-duration-normal) var(--nk-ease-standard);
}

@media (hover: hover) {
  .nk-product-card:hover { box-shadow: var(--nk-shadow-md); transform: translateY(-2px); }
  .nk-product-card:hover .nk-product-card__img--hover { opacity: 1; }
}

/**
 * Focus ring goes on the card, not just the inner link — but `:focus-within`
 * was the wrong test. The title link is stretched over the whole card, so a
 * mouse click focuses it and left a coral outline drawn around the card until
 * the next click landed somewhere else. `:has(:focus-visible)` is the same
 * ring for the same element, asked the keyboard-only way. Browsers without
 * `:has` still show the global `:focus-visible` ring on the link itself, so
 * keyboard focus is never invisible.
 */
.nk-product-card:has(:focus-visible) { outline: var(--nk-focus-ring-width) solid var(--nk-focus-ring-color); outline-offset: var(--nk-focus-ring-offset); }

.nk-product-card__media {
  position: relative;
  aspect-ratio: var(--nk-ratio-product);
  background-color: var(--nk-surface-sunken);
  overflow: hidden;
}
.nk-product-card__img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}
/* Second image revealed on hover — desktop affordance only. */
.nk-product-card__img--hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--nk-duration-normal) var(--nk-ease-standard);
}

/* Badge rail — top inline-start corner, stacks downward. */
.nk-product-card__badges {
  position: absolute;
  inset-block-start: var(--nk-space-2);
  inset-inline-start: var(--nk-space-2);
  z-index: var(--nk-z-raised);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--nk-space-1);
}

/**
 * Wishlist — opposite corner from the badges.
 *
 * A chip *and* a bigger heart. Tried without the chip: over the catalogue's
 * pale photography a bare glyph was genuinely hard to find, which is the one
 * thing a save control cannot be. The chip comes back at 32px rather than the
 * original 36, and the heart grows from 20px to 24px inside it — so the mark
 * reads as a heart with a ground behind it rather than a button with an icon
 * in it. Less chrome, more glyph, same corner.
 *
 * `--nk-surface-floating` is the documented ground for a control resting on
 * artwork; the blur keeps it legible over a busy photograph without dimming
 * it, and `--nk-shadow-xs` lifts it off a photograph that happens to be cream.
 */
.nk-product-card__wish {
  position: absolute;
  inset-block-start: var(--nk-space-2);
  inset-inline-end: var(--nk-space-2);
  z-index: var(--nk-z-raised);
  inline-size: var(--nk-space-8);
  block-size: var(--nk-space-8);
  background-color: var(--nk-surface-floating);
  backdrop-filter: blur(4px);
  box-shadow: var(--nk-shadow-xs);
  border-radius: var(--nk-radius-pill);
  color: var(--nk-text-strong);
  transition: color var(--nk-transition-base), transform var(--nk-transition-base);
}
/**
 * 20px in a 32px chip. The chip is what shrank — 36 → 32 — so the heart sits
 * in less ground than it started with without becoming the loudest thing in
 * the corner. Stroke 1.5, lighter than the 1.75 every other icon carries: over
 * photography the full weight turns the outline into a shape.
 */
.nk-product-card__wish .nk-icon {
  inline-size: var(--nk-icon-md);
  block-size: var(--nk-icon-md);
  stroke-width: 1.5;
}

/**
 * The visible mark is 32px but the tappable area is extended to 44px with a
 * transparent pseudo-element. This is the standard way to satisfy WCAG 2.5.5
 * without a bigger button.
 */
.nk-product-card__wish::before {
  content: "";
  position: absolute;
  inset: 50%;
  inline-size: var(--nk-touch-target);
  block-size: var(--nk-touch-target);
  transform: translate(50%, -50%);
}
[dir="ltr"] .nk-product-card__wish::before { transform: translate(-50%, -50%); }

/* Saved: the outline fills, in the action colour. The glyph is Lucide's heart
   from the sprite — the same geometry as the Brand Heart but never its role,
   which is why it is only ever this button, never `.nk-heart`. */
.nk-product-card__wish[aria-pressed="true"] { color: var(--nk-action-primary); }
.nk-product-card__wish[aria-pressed="true"] .nk-icon { fill: currentColor; }

.nk-product-card__wish:active,
.nk-product-card__wish:focus-visible { background-color: var(--nk-surface-floating); }
@media (hover: hover) {
  .nk-product-card__wish:hover { background-color: var(--nk-surface-floating); }
}
@media (hover: hover) {
  .nk-product-card__wish:hover { color: var(--nk-action-primary); }
}
.nk-product-card__wish:active { transform: scale(0.92); }

/**
 * Saving. The heart is replaced by a spinner in place rather than the button
 * being disabled and left looking inert: the request is the only thing that
 * decides the new state, and a press that visibly does nothing for 200ms is
 * indistinguishable from a press that missed.
 */
.nk-product-card__wish.is-loading { cursor: progress; }
.nk-product-card__wish.is-loading .nk-icon { opacity: 0; }
.nk-product-card__wish.is-loading::after {
  content: "";
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  inline-size: var(--nk-icon-sm);
  block-size: var(--nk-icon-sm);
  margin-block-start: calc(var(--nk-icon-sm) / -2);
  margin-inline-start: calc(var(--nk-icon-sm) / -2);
  border: 2px solid var(--nk-navy-200);
  border-block-start-color: var(--nk-action-primary);
  border-radius: var(--nk-radius-circle);
  animation: nk-spin 700ms linear infinite;
}
/* The same spin the inline spinner uses; honour the same preference it does. */
@media (prefers-reduced-motion: reduce) {
  .nk-product-card__wish.is-loading::after { animation-duration: 2s; }
}

.nk-product-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--nk-space-2);
  padding: var(--nk-space-3);
  flex: 1;
}

.nk-product-card__title {
  font-family: var(--nk-font-ui);
  font-size: var(--nk-text-base);
  font-weight: var(--nk-weight-medium);
  color: var(--nk-text-strong);
  line-height: var(--nk-leading-snug);
  /* Two lines max so every card in a row has the same height. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nk-product-card__title a { color: inherit; text-decoration: none; }
/* Stretched link — makes the whole card clickable without nesting <a>. */
.nk-product-card__title a::after { content: ""; position: absolute; inset: 0; }

.nk-product-card__meta {
  display: flex;
  align-items: center;
  /* The rating is the row's only child, so justify-content is what positions
     it — flex-end (the card's left edge in RTL) rather than the flex default
     of flex-start, matching the rating's left-aligned convention everywhere
     else on the site (the PDP meta row, the reviews' score column). */
  justify-content: flex-end;
  gap: var(--nk-space-2);
  font-size: var(--nk-text-xs);
  color: var(--nk-text-muted);
}

/**
 * The price is centred in the card, not aligned to the title.
 *
 * A single price is one object and reads best as one centred unit; a sale price
 * is two lines that stay centred on the same axis, so the block still balances
 * instead of stepping sideways. Centring is on the footer *and* the price so it
 * holds whether the price is the footer's only child or sits beside a future
 * second control.
 */
.nk-product-card__footer {
  margin-block-start: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--nk-space-2);
  text-align: center;
}
.nk-product-card__footer .nk-price { justify-content: center; }

/**
 * A single price is its own centred unit, on the same line as its neighbours.
 *
 * Bottom-aligning the price block put a lone amount on the row where a struck
 * old price sits — measured 17px from the card's bottom edge against 37px for
 * the live price of the sale card beside it. So a lone price read as the
 * *second* line of a price it did not have.
 *
 * The band is the height of a two-line price, computed from the same tokens
 * that set those two lines rather than a number that would drift from them.
 * `:has()` is what keeps it honest: it is only applied when some card in the
 * same row actually has an old price, so a rail with nothing on sale reserves
 * nothing at all.
 */
.nk-product-rail:has(.nk-price__old) .nk-product-card__footer,
.nk-product-grid:has(.nk-price__old) .nk-product-card__footer {
  min-block-size: calc(
    (var(--nk-text-md) + var(--nk-text-sm)) * var(--nk-leading-tight) + var(--nk-space-half)
  );
}

@media (min-width: 768px) {
  .nk-product-card__body { padding: var(--nk-space-4); gap: var(--nk-space-3); }
  .nk-product-card__title { font-size: var(--nk-text-md); }
}

/**
 * Out of stock. The card stays a full link target — the product page is where
 * a customer asks when it is coming back — but the photograph stops competing
 * with the ones beside it that can actually be bought.
 */
.nk-product-card--oos .nk-product-card__img {
  filter: grayscale(0.7);
  opacity: 0.55;
}
.nk-product-card--oos .nk-product-card__title,
.nk-product-card--oos .nk-price__current { color: var(--nk-text-muted); }
/* Hover lift too: nothing here rewards the reach. */
@media (hover: hover) {
  .nk-product-card--oos:hover { box-shadow: none; transform: none; }
}

/* Product grid — the canonical listing layout. */
.nk-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--nk-grid-gap);
}
@media (min-width: 768px) { .nk-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .nk-product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/**
 * Carousel variant — horizontal scroll-snap on mobile, no JS needed.
 * Used for "related" and "recommended" rails.
 */
.nk-product-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 46%;
  gap: var(--nk-grid-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* Bleed to the screen edge so cards look like they continue off-screen. */
  padding-inline: var(--nk-gutter);
  margin-inline: calc(var(--nk-gutter) * -1);
  padding-block-end: var(--nk-space-2);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.nk-product-rail::-webkit-scrollbar { display: none; }
.nk-product-rail > * { scroll-snap-align: start; }
@media (min-width: 480px) { .nk-product-rail { grid-auto-columns: 33%; } }
@media (min-width: 768px) { .nk-product-rail { grid-auto-columns: 25%; } }
@media (min-width: 1024px) {
  .nk-product-rail { grid-auto-columns: 22%; padding-inline: 0; margin-inline: 0; }
}

/* Pointer drag (ui.js) — the cursor says the row can be pulled, and text
   selection must not start mid-drag. Touch never reaches this. */
.nk-product-rail.is-dragging { cursor: grabbing; user-select: none; scroll-snap-type: none; }

/* =======================================================================
 * RAIL SECTION — .nk-rail-section
 * A titled rail: heading, optional "view all", desktop arrows, progress bar.
 * Rendered by nk_product_rail(); shared by the homepage and the product page.
 * ===================================================================== */

.nk-rail-section { margin-block-start: var(--nk-space-6); }

.nk-rail-section__head {
  display: flex;
  align-items: flex-end;
  gap: var(--nk-space-3);
  margin-block-end: var(--nk-space-4);
}

.nk-rail-section__title {
  margin: 0;
  font-family: var(--nk-font-display);
  font-size: var(--nk-text-xl);
  font-weight: var(--nk-weight-bold);
  color: var(--nk-text-strong);
}

.nk-rail-section__subtitle { margin: 0; font-size: var(--nk-text-sm); color: var(--nk-text-muted); }

.nk-rail-section__actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: var(--nk-space-2);
  flex: none;
}

/* "مشاهده همه" — a text link, not a button: the rail already carries the
   primary action, and a second filled control would compete with it. */
.nk-rail-section__all {
  display: inline-flex;
  align-items: center;
  gap: var(--nk-space-hair);
  min-block-size: var(--nk-touch-target);
  padding-inline: var(--nk-space-2);
  color: var(--nk-text-accent);
  font-size: var(--nk-text-sm);
  font-weight: var(--nk-weight-semibold);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--nk-transition-base);
}
@media (hover: hover) {
  .nk-rail-section__all:hover { color: var(--nk-action-primary-hover); text-decoration: underline; }
}
.nk-rail-section__all:focus-visible {
  outline: var(--nk-focus-ring-width) solid var(--nk-focus-ring-color);
  outline-offset: var(--nk-focus-ring-offset);
  border-radius: var(--nk-radius-sm);
}
.nk-rail-section__all:active { color: var(--nk-action-primary-active); }

/* `:not([hidden])` is load-bearing: a bare class rule with `display: flex`
   out-specifies the UA's `[hidden] { display: none }`, and ui.js hides the
   arrows with that attribute when the track does not overflow. */
.nk-rail-section__nav { display: none; gap: var(--nk-space-2); flex: none; }

/* Arrows are a pointer affordance only. On touch the rail is dragged, and two
   44px circles in the header cost a 360px screen more than they return. */
@media (min-width: 1024px) {
  .nk-rail-section__nav:not([hidden]) { display: flex; }
}

/* Small, because they are an aid and not the way the rail is meant to be used
   — the rail scrolls under a thumb. Hidden entirely by JS when the track does
   not overflow: a dead arrow is worse than no arrow. */
/* 44px, not the 40 this started at. They read as small because of the hairline
   and the pill radius, not because the hit area is undersized — the audit
   correctly refuses anything below the touch-target floor. */
.nk-rail-nav__btn {
  inline-size: var(--nk-touch-target);
  block-size: var(--nk-touch-target);
  border: var(--nk-border-hairline);
  border-radius: var(--nk-radius-circle);
  background-color: var(--nk-surface-raised);
  box-shadow: var(--nk-shadow-xs);
  color: var(--nk-text-strong);
  transition: background-color var(--nk-transition-base), box-shadow var(--nk-transition-base);
}

@media (hover: hover) {
  .nk-rail-nav__btn:hover:not(:disabled) { background-color: var(--nk-surface-sunken); box-shadow: var(--nk-shadow-sm); }
}
.nk-rail-nav__btn:disabled { color: var(--nk-action-disabled-text); box-shadow: none; cursor: not-allowed; }

.nk-rail-progress {
  position: relative;
  block-size: var(--nk-space-1);
  margin-block-start: var(--nk-space-3);
  border-radius: var(--nk-radius-pill);
  background-color: var(--nk-navy-100);
  overflow: hidden;
}

.nk-rail-progress__bar {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 30%;
  border-radius: var(--nk-radius-pill);
  background-color: var(--nk-action-primary);
  transition: inset-inline-start var(--nk-transition-base);
}

/* =======================================================================
 * BEST SELLERS — .nk-bestsellers-section / .nk-bestseller
 * A ranked, compact list: rank badge, two-line title, thumbnail. Rendered by
 * nk_bestsellers(). Deliberately NOT the product card — see the skill's
 * components-commerce.md for why a rank list is its own component.
 *
 * The item is always column-major, at every width: ranks ۱–۳ read down the
 * first column the way a top-three list is read, and the visual order never
 * disagrees with the DOM order. Only the row count and the overflow change
 * across breakpoints.
 *
 * There is no JavaScript. Mobile scrolls natively with scroll-snap; desktop
 * has nothing to scroll.
 * ===================================================================== */

.nk-bestsellers-section { margin-block-start: var(--nk-space-6); }

/*
 * Mobile: three rows, columns flowing sideways — two columns to a view, with
 * the third breaking the edge of the screen. That sliver is the only affordance
 * the row needs; the product rails use the same one instead of arrows.
 *
 * Two classes, not one: `ul[class], ol[class]` in base.css is (0,1,1) and
 * zeroes margin and padding, so a single-class rule loses its bleed. See
 * .claude/rules/css.md.
 */
.nk-bestsellers-section .nk-bestsellers {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  grid-auto-columns: 47%;
  gap: var(--nk-space-2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* Bleed to the screen edge, exactly as .nk-product-rail does. */
  padding-inline: var(--nk-gutter);
  margin-inline: calc(var(--nk-gutter) * -1);
  padding-block-end: var(--nk-space-2);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.nk-bestsellers::-webkit-scrollbar { display: none; }
.nk-bestsellers > * { scroll-snap-align: start; }

/*
 * From 768px the whole list fits on the screen, so it stops scrolling: two
 * columns of six. A 4-up grid would fit here too, but four columns of a 768px
 * screen leave a Persian product title about 70px — the row would be legible
 * only in the sense that it is on the page.
 */
@media (min-width: 768px) {
  .nk-bestsellers-section .nk-bestsellers {
    grid-template-rows: repeat(6, minmax(0, 1fr));
    grid-auto-columns: minmax(0, 1fr);
    gap: var(--nk-grid-gap);
    overflow-x: visible;
    scroll-snap-type: none;
    padding-inline: 0;
    margin-inline: 0;
    padding-block-end: 0;
  }
}

/* The comps' shape: four columns of three. */
@media (min-width: 1024px) {
  .nk-bestsellers-section .nk-bestsellers {
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
}

/*
 * Every pixel of the item that is not the title is taken from the title: at
 * 360px a column is 154px, and the chrome around the words is what decides
 * whether a Persian title gets two words or one. Hence the tight base values —
 * they are relaxed at 480 and again at 768, where the room exists.
 */
.nk-bestseller {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--nk-space-1);
  min-inline-size: 0;
  padding: var(--nk-space-1);
  background-color: var(--nk-surface-raised);
  border: var(--nk-border-width) solid var(--nk-border-subtle);
  border-radius: var(--nk-radius-lg);
  transition: border-color var(--nk-transition-base), box-shadow var(--nk-transition-base);
}

@media (hover: hover) {
  .nk-bestseller:hover {
    border-color: var(--nk-border-default);
    box-shadow: var(--nk-shadow-sm);
  }
}

/* `:has(:focus-visible)`, never `:focus-within` — the stretched link takes
   focus on a mouse press, and :focus-within would leave a coral outline around
   the item until the next click. Same reasoning as the product card. */
.nk-bestseller:has(:focus-visible) {
  outline: var(--nk-focus-ring-width) solid var(--nk-focus-ring-color);
  outline-offset: var(--nk-focus-ring-offset);
}

.nk-bestseller:has(a:active) { background-color: var(--nk-surface-sunken); }

/* There is no disabled state: the item is a link to a product page, and a
   product that cannot be bought still has one. Out of stock is the product
   card's job, on the archive where a customer is choosing. */

/*
 * The rank chip. Soft, not filled: white on coral measures 3.22:1 and is
 * permitted only at ≥16px/600 (see the skill's color.md), which a two-digit
 * chip is not. The leading ranks take the coral wash and coral-700 text —
 * the same pairing as .nk-badge--soft — and the rest stay navy, so the podium
 * still reads without a colour that fails at this size.
 */
.nk-bestseller__rank {
  /* Inline, and the first thing on the first line of the title: a chip in its
     own column narrows *every* line, and the second line is where a clamped
     Persian title needs the width. `inline-grid` centres the digits without a
     line-height fight; the margin is the only gap the row needs. */
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  margin-inline-end: var(--nk-space-1);
  inline-size: var(--nk-space-5);
  block-size: var(--nk-space-5);
  border-radius: var(--nk-radius-circle);
  background-color: var(--nk-action-secondary-subtle);
  color: var(--nk-text-strong);
  font-family: var(--nk-font-numeric);
  font-size: var(--nk-text-xs);
  font-weight: var(--nk-weight-bold);
  line-height: var(--nk-leading-none);
}

.nk-bestseller__rank--top {
  background-color: var(--nk-surface-accent);
  color: var(--nk-text-accent);
}

.nk-bestseller__title {
  flex: 1 1 auto;
  min-inline-size: 0;
  margin: 0;
  font-family: var(--nk-font-ui);
  font-size: var(--nk-text-xs);
  font-weight: var(--nk-weight-medium);
  line-height: var(--nk-leading-snug);
  color: var(--nk-text-default);
  /* Two lines, like the product card: it is what keeps every item in a row the
     same height, and the rank column stays aligned because of it. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nk-bestseller__title a {
  color: inherit;
  text-decoration: none;
}

/* The whole item is one target. The stretched link keeps the accessible name on
   the title, which is the only thing worth announcing here. */
.nk-bestseller__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

@media (hover: hover) {
  .nk-bestseller:hover .nk-bestseller__title a { color: var(--nk-text-accent); }
}

/* First in the DOM, so it sits on the inline-start side — the right one in RTL,
   which is where the eye starts. The rank and the title follow it. */
.nk-bestseller__media {
  flex: none;
  inline-size: var(--nk-space-12);
  aspect-ratio: var(--nk-ratio-product);
  border-radius: var(--nk-radius-md);
  overflow: hidden;
  background-color: var(--nk-surface-sunken);
}

/* Two classes: `.woocommerce-page img` is (0,1,1) and would win on every
   commerce route. See .claude/rules/css.md. */
.nk-bestseller__media .nk-bestseller__img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* A 480px screen has ~70px more per column than a 360px one; spend it on the
   chrome the smallest screen could not afford. */
@media (min-width: 480px) {
  .nk-bestseller { gap: var(--nk-space-2); padding: var(--nk-space-2); }
  .nk-bestseller__rank { inline-size: var(--nk-space-6); block-size: var(--nk-space-6); }
}

/* Room to breathe once the list stops competing with the screen edge. */
@media (min-width: 768px) {
  .nk-bestseller { gap: var(--nk-space-3); padding: var(--nk-space-3); }
  .nk-bestseller__title { font-size: var(--nk-text-base); }
  .nk-bestseller__media { inline-size: var(--nk-space-16); }
}

/* =======================================================================
 * CATEGORY CARD — .nk-category-card
 * ===================================================================== */

.nk-category-card {
  position: relative;
  display: block;
  aspect-ratio: var(--nk-ratio-category);
  border-radius: var(--nk-radius-xl);
  overflow: hidden;
  background-color: var(--nk-surface-sunken);
  text-decoration: none;
}
.nk-category-card__img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  transition: transform var(--nk-duration-slow) var(--nk-ease-out);
}
@media (hover: hover) {
  .nk-category-card:hover .nk-category-card__img { transform: scale(1.04); }
}
.nk-category-card__overlay {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  padding: var(--nk-space-4);
  background: linear-gradient(to top, rgb(16 26 44 / 0.75), transparent);
  color: var(--nk-text-inverse);
}
.nk-category-card__title {
  font-family: var(--nk-font-display);
  font-size: var(--nk-text-lg);
  font-weight: var(--nk-weight-bold);
  color: var(--nk-white);
}
.nk-category-card__count { font-size: var(--nk-text-xs); opacity: 0.85; }

/* Pastel variant — flat colour instead of photography. */
.nk-category-card--pastel { background-color: var(--nk-pastel-sky); }
.nk-category-card--pastel .nk-category-card__overlay { background: none; color: var(--nk-text-strong); }
.nk-category-card--pastel .nk-category-card__title { color: var(--nk-text-strong); }

/* =======================================================================
 * CATEGORY TILE — removed.
 *
 * `.nk-cat-tile` was a small white box with a 48px icon disc, used on the
 * search screen's idle state, while the bottom-nav category sheet used
 * `.nk-catcard` with the generated artwork. Same five departments, two
 * different components, and which one you saw depended on which button you
 * pressed. `.nk-catcard` won — see nk_category_card(), the one implementation,
 * and .nk-catcards in components/feedback.css.
 * ===================================================================== */

/* =======================================================================
 * PRICE — .nk-price
 * Layout in RTL: [amount] [currency], with the old price after the new one.
 * ===================================================================== */

/**
 * A price is a number, not a paragraph. The body's --nk-leading-normal (1.75)
 * is set for reading Persian prose; on a two-line price it spent 13px of a
 * product card on nothing — measured 62px for two lines that need 42. Tight
 * leading here, and a row gap of one hair rather than a full space-2, so the
 * old price reads as belonging to the price above it instead of floating.
 */
.nk-price {
  display: flex;
  align-items: baseline;
  column-gap: var(--nk-space-2);
  row-gap: var(--nk-space-half);
  flex-wrap: wrap;
  line-height: var(--nk-leading-tight);
}

.nk-price__current {
  font-family: var(--nk-font-numeric);
  font-size: var(--nk-text-lg);
  font-weight: var(--nk-weight-bold);
  line-height: var(--nk-leading-tight);
  color: var(--nk-text-strong);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* The currency sits with the amount, not beside it — a full space-1 read as a
   gap between two things rather than a suffix on one. */
.nk-price__currency {
  font-size: var(--nk-text-xs);
  font-weight: var(--nk-weight-medium);
  color: var(--nk-text-muted);
  margin-inline-start: var(--nk-space-half);
}
.nk-price__old {
  font-family: var(--nk-font-numeric);
  font-size: var(--nk-text-base);
  line-height: var(--nk-leading-tight);
  color: var(--nk-text-subtle);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  white-space: nowrap;
}
.nk-price__off {
  font-size: var(--nk-text-xs);
  font-weight: var(--nk-weight-bold);
  color: var(--nk-text-on-accent);
  background-color: var(--nk-action-primary);
  padding-inline: var(--nk-space-2);
  padding-block: 2px;
  border-radius: var(--nk-radius-sm);
}
/* On sale, the live price takes the accent colour. */
.nk-price--sale .nk-price__current { color: var(--nk-action-primary); }

.nk-price--lg .nk-price__current { font-size: var(--nk-text-3xl); }
.nk-price--sm .nk-price__current { font-size: var(--nk-text-md); }

/* On a card the old price was 15px against a 16px live price — a struck line
   doing the work that the size difference should do. 13px separates them at a
   glance, and buys back a card width for the amount that matters. */
.nk-price--sm .nk-price__old { font-size: var(--nk-text-sm); }

/**
 * A variable product's range. The separator is a real en dash and the numbers
 * are bidi-isolated by .nk-num, so "۱۰۰٬۰۰۰ – ۲۰۰٬۰۰۰" keeps the smaller
 * amount on the reading-start side in RTL instead of swapping mid-line.
 * One step down in size: two amounts in a 2-up card are otherwise a wall.
 */
.nk-price__sep { margin-inline: var(--nk-space-1); color: var(--nk-text-subtle); }
.nk-price--range .nk-price__current { font-size: var(--nk-text-md); }
.nk-price--range.nk-price--sm .nk-price__current { font-size: var(--nk-text-sm); }
.nk-price--range.nk-price--lg .nk-price__current { font-size: var(--nk-text-2xl); }

/* =======================================================================
 * STOCK STATUS — .nk-stock
 * ===================================================================== */

.nk-stock {
  display: inline-flex;
  align-items: center;
  gap: var(--nk-space-2);
  font-size: var(--nk-text-sm);
  font-weight: var(--nk-weight-medium);
}
.nk-stock__dot {
  inline-size: 8px;
  block-size: 8px;
  border-radius: var(--nk-radius-circle);
  flex: none;
  background-color: currentColor;
}
.nk-stock--in  { color: var(--nk-status-success-text); }
.nk-stock--low { color: var(--nk-status-warning-text); }
.nk-stock--out { color: var(--nk-text-muted); }

/* Low-stock urgency bar — only shown when remaining ≤ 5. */
.nk-stock-bar {
  block-size: 4px;
  inline-size: 100%;
  max-inline-size: 160px;
  background-color: var(--nk-navy-100);
  border-radius: var(--nk-radius-pill);
  overflow: hidden;
}
.nk-stock-bar__fill {
  block-size: 100%;
  background-color: var(--nk-status-warning);
  border-radius: inherit;
}

/* =======================================================================
 * RATING — .nk-rating
 * =======================================================================
 * .nk-rating wraps WooCommerce's own `.star-rating` widget (from
 * wc_get_rating_html(), see nk_rating() in components.php) plus our own
 * numeral/count spans. The `.star-rating` repaint itself lives in
 * woocommerce.css, not here — it is Woo's own selector, and that file is
 * the one positioned last in the cascade to reliably win against Woo's
 * plugin stylesheet on routes that still load it (see css.md).
 * ===================================================================== */

.nk-rating { display: inline-flex; align-items: center; gap: var(--nk-space-1); }

.nk-rating__value {
  font-family: var(--nk-font-numeric);
  font-size: var(--nk-text-sm);
  font-weight: var(--nk-weight-semibold);
  color: var(--nk-text-strong);
}
.nk-rating__count { font-size: var(--nk-text-xs); color: var(--nk-text-muted); }

/* Distribution bars in the reviews summary. */
.nk-rating-bar { display: flex; align-items: center; gap: var(--nk-space-2); }
.nk-rating-bar__track {
  flex: 1;
  block-size: 6px;
  background-color: var(--nk-rating-track);
  border-radius: var(--nk-radius-pill);
  overflow: hidden;
}
.nk-rating-bar__fill { block-size: 100%; background-color: var(--nk-rating-color); }

/* =======================================================================
 * REVIEW CARD — .nk-review
 * ===================================================================== */

.nk-review {
  padding-block: var(--nk-space-5);
  border-block-end: var(--nk-border-hairline);
}
.nk-review__head {
  display: flex;
  align-items: center;
  gap: var(--nk-space-3);
  margin-block-end: var(--nk-space-3);
}
/*
 * The avatar was --nk-surface-accent (coral-50, #fff5f2) on the page ground
 * (cream-100, #fdfaf5) — a 1.02:1 difference. On a phone the circle was simply
 * not there; the initial floated in space. Coral-100 with a coral-200 rim
 * makes the shape read without turning eight of them into eight solid dots.
 */
.nk-review__avatar {
  inline-size: 40px;
  block-size: 40px;
  border-radius: var(--nk-radius-circle);
  background-color: var(--nk-coral-100);
  border: var(--nk-border-width) solid var(--nk-coral-200);
  color: var(--nk-text-accent);
  display: grid;
  place-items: center;
  font-weight: var(--nk-weight-semibold);
  overflow: hidden;
  flex: none;
}

/* An avatar can carry artwork instead of an initial — the shop's own mark on
   a reply from the store. */
.nk-review__avatar img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.nk-review__author { font-weight: var(--nk-weight-semibold); color: var(--nk-text-strong); font-size: var(--nk-text-base); }
.nk-review__date { font-size: var(--nk-text-xs); color: var(--nk-text-muted); }
.nk-review__verified {
  display: inline-flex;
  align-items: center;
  gap: var(--nk-space-1);
  font-size: var(--nk-text-xs);
  color: var(--nk-status-success-text);
}
.nk-review__body { color: var(--nk-text-default); line-height: var(--nk-leading-normal); }
.nk-review__footer {
  margin-block-start: var(--nk-space-3);
  display: flex;
  align-items: center;
  gap: var(--nk-space-4);
  font-size: var(--nk-text-sm);
  color: var(--nk-text-muted);
}

/* =======================================================================
 * SIZE SELECTOR — .nk-size-select
 * Radio group styled as tiles. Never a <select> on mobile.
 * ===================================================================== */

.nk-size-select { display: flex; flex-wrap: wrap; gap: var(--nk-space-2); }

.nk-size-select__option { position: relative; }
.nk-size-select__input {
  position: absolute;
  opacity: 0;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  margin: 0;
  cursor: pointer;
}
.nk-size-select__label {
  display: grid;
  place-items: center;
  min-inline-size: var(--nk-touch-target);
  min-block-size: var(--nk-touch-target);
  padding-inline: var(--nk-space-3);
  border: var(--nk-border-width) solid var(--nk-border-default);
  border-radius: var(--nk-radius-md);
  background-color: var(--nk-surface-raised);
  font-size: var(--nk-text-base);
  font-weight: var(--nk-weight-medium);
  color: var(--nk-text-strong);
  cursor: pointer;
  transition: all var(--nk-transition-base);
}
@media (hover: hover) {
  .nk-size-select__input:hover + .nk-size-select__label { border-color: var(--nk-border-strong); }
}
.nk-size-select__input:checked + .nk-size-select__label {
  border-color: var(--nk-navy-800);
  border-width: var(--nk-border-width-thick);
  background-color: var(--nk-navy-800);
  color: var(--nk-text-inverse);
}
.nk-size-select__input:focus-visible + .nk-size-select__label {
  outline: var(--nk-focus-ring-width) solid var(--nk-focus-ring-color);
  outline-offset: var(--nk-focus-ring-offset);
}
/* Out of stock — struck through, still focusable so it can announce why. */
.nk-size-select__input:disabled + .nk-size-select__label {
  color: var(--nk-action-disabled-text);
  background-color: var(--nk-navy-50);
  border-color: var(--nk-border-subtle);
  cursor: not-allowed;
  text-decoration: line-through;
}

.nk-size-select__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-block-end: var(--nk-space-3);
}

/* =======================================================================
 * COLOR SELECTOR — .nk-color-select
 * Colour is never the only signal: the selected name is always shown.
 * ===================================================================== */

.nk-color-select { display: flex; flex-wrap: wrap; gap: var(--nk-space-3); }
.nk-color-select__option { position: relative; }
.nk-color-select__input { position: absolute; opacity: 0; inset: 0; inline-size: 100%; block-size: 100%; margin: 0; cursor: pointer; }
.nk-color-select__swatch {
  display: block;
  inline-size: 36px;
  block-size: 36px;
  border-radius: var(--nk-radius-circle);
  background-color: var(--nk-swatch, var(--nk-navy-200));
  box-shadow: inset 0 0 0 1px rgb(16 26 44 / 0.12);
  cursor: pointer;
  transition: transform var(--nk-transition-base), box-shadow var(--nk-transition-base);
}
/* The 36px dot sits inside a 44px touch target. */
.nk-color-select__option {
  display: grid;
  place-items: center;
  inline-size: var(--nk-touch-target);
  block-size: var(--nk-touch-target);
}
.nk-color-select__input:checked + .nk-color-select__swatch {
  box-shadow: inset 0 0 0 1px rgb(16 26 44 / 0.12),
              0 0 0 2px var(--nk-surface-raised),
              0 0 0 4px var(--nk-navy-800);
}
.nk-color-select__input:focus-visible + .nk-color-select__swatch {
  outline: var(--nk-focus-ring-width) solid var(--nk-focus-ring-color);
  outline-offset: var(--nk-focus-ring-offset);
}
.nk-color-select__input:disabled + .nk-color-select__swatch { opacity: 0.35; cursor: not-allowed; }

/* =======================================================================
 * QUANTITY SELECTOR — .nk-qty
 * ===================================================================== */

.nk-qty {
  display: inline-flex;
  align-items: center;
  border: var(--nk-border-width) solid var(--nk-border-default);
  border-radius: var(--nk-radius-md);
  overflow: hidden;
  background-color: var(--nk-surface-raised);
}
.nk-qty__btn {
  inline-size: var(--nk-touch-target);
  block-size: var(--nk-touch-target);
  display: grid;
  place-items: center;
  color: var(--nk-text-strong);
  transition: background-color var(--nk-transition-base);
}
@media (hover: hover) {
  .nk-qty__btn:hover:not(:disabled) { background-color: var(--nk-navy-50); }
}
.nk-qty__btn:disabled { color: var(--nk-action-disabled-text); cursor: not-allowed; }
.nk-qty__input {
  inline-size: 48px;
  block-size: var(--nk-touch-target);
  border: none;
  border-inline: var(--nk-border-width) solid var(--nk-border-subtle);
  text-align: center;
  font-family: var(--nk-font-numeric);
  font-size: var(--nk-text-md);
  font-weight: var(--nk-weight-semibold);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.nk-qty__input::-webkit-outer-spin-button,
.nk-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* =======================================================================
 * PRODUCT GALLERY — .nk-gallery
 * Mobile: full-bleed swipe with dot counter, no thumbnails.
 * Desktop: thumbnail column on the inline-start side + main stage.
 * ===================================================================== */

.nk-gallery { position: relative; }

.nk-gallery__stage {
  position: relative;
  aspect-ratio: var(--nk-ratio-product);
  background-color: var(--nk-surface-sunken);
  border-radius: var(--nk-radius-lg);
  overflow: hidden;
}

.nk-gallery__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  block-size: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.nk-gallery__track::-webkit-scrollbar { display: none; }
.nk-gallery__slide { scroll-snap-align: center; block-size: 100%; }
.nk-gallery__slide img { inline-size: 100%; block-size: 100%; object-fit: cover; }

/* Counter pill — cheaper than dots when there are many images. */
.nk-gallery__counter {
  position: absolute;
  inset-block-end: var(--nk-space-3);
  inset-inline-end: var(--nk-space-3);
  padding-inline: var(--nk-space-3);
  padding-block: var(--nk-space-1);
  background-color: rgb(16 26 44 / 0.6);
  color: var(--nk-white);
  border-radius: var(--nk-radius-pill);
  font-family: var(--nk-font-numeric);
  font-size: var(--nk-text-xs);
  backdrop-filter: blur(6px);
}

.nk-gallery__thumbs { display: none; }

@media (min-width: 1024px) {
  .nk-gallery {
    display: grid;
    /* Thumbs first in DOM = inline-start in both directions. */
    grid-template-columns: 84px minmax(0, 1fr);
    gap: var(--nk-space-4);
    align-items: start;
  }
  .nk-gallery__thumbs {
    display: flex;
    flex-direction: column;
    gap: var(--nk-space-2);
    max-block-size: 560px;
    overflow-y: auto;
    scrollbar-width: thin;
  }
  .nk-gallery__thumb {
    aspect-ratio: var(--nk-ratio-product);
    border-radius: var(--nk-radius-md);
    overflow: hidden;
    border: var(--nk-border-width-thick) solid transparent;
    background-color: var(--nk-surface-sunken);
    cursor: pointer;
  }
  .nk-gallery__thumb img { inline-size: 100%; block-size: 100%; object-fit: cover; }
  .nk-gallery__thumb[aria-current="true"] { border-color: var(--nk-navy-800); }
  .nk-gallery__counter { display: none; }
}

/* =======================================================================
 * PRODUCT ATTRIBUTES / SPECIFICATIONS — .nk-specs
 * ===================================================================== */

.nk-specs { inline-size: 100%; font-size: var(--nk-text-base); }
.nk-specs tr { border-block-end: var(--nk-border-hairline); }
.nk-specs th,
.nk-specs td { padding-block: var(--nk-space-3); text-align: start; vertical-align: top; }
.nk-specs th { color: var(--nk-text-muted); font-weight: var(--nk-weight-regular); inline-size: 40%; }
.nk-specs td { color: var(--nk-text-strong); font-weight: var(--nk-weight-medium); }

/* Feature list with coral check marks. */
.nk-features { display: grid; gap: var(--nk-space-3); }
.nk-features li { display: flex; align-items: flex-start; gap: var(--nk-space-2); }
.nk-features .nk-icon { color: var(--nk-action-primary); margin-block-start: 2px; }

/* =======================================================================
 * PROMOTIONAL BANNER — .nk-promo
 * ===================================================================== */

.nk-promo {
  position: relative;
  display: grid;
  gap: var(--nk-space-4);
  padding: var(--nk-space-6);
  border-radius: var(--nk-radius-xl);
  background-color: var(--nk-surface-accent);
  overflow: hidden;
}
.nk-promo__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--nk-space-2);
  font-size: var(--nk-text-sm);
  font-weight: var(--nk-weight-semibold);
  color: var(--nk-text-accent);
}
.nk-promo__title {
  font-family: var(--nk-font-display);
  font-size: var(--nk-text-3xl);
  font-weight: var(--nk-weight-bold);
  color: var(--nk-text-strong);
  line-height: var(--nk-leading-tight);
}
.nk-promo__text { color: var(--nk-text-muted); }
.nk-promo--inverse { background-color: var(--nk-surface-inverse); }
.nk-promo--inverse .nk-promo__title { color: var(--nk-white); }
.nk-promo--inverse .nk-promo__text { color: var(--nk-cream-300); }

@media (min-width: 768px) {
  .nk-promo { padding: var(--nk-space-10); }
  .nk-promo--split { grid-template-columns: 1fr 1fr; align-items: center; }
  .nk-promo__title { font-size: var(--nk-text-4xl); }
}

/* =======================================================================
 * STICKY MOBILE ADD-TO-CART — .nk-sticky-cta
 * Appears once the in-page add-to-cart scrolls out of view.
 * Mobile only; hidden from 1024px up.
 * ===================================================================== */

.nk-sticky-cta {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: var(--nk-z-sticky);
  display: flex;
  align-items: center;
  gap: var(--nk-space-3);
  padding: var(--nk-space-3) var(--nk-gutter);
  /* Keep clear of the iOS home indicator. */
  padding-block-end: calc(var(--nk-space-3) + var(--nk-safe-bottom));
  background-color: var(--nk-surface-raised);
  border-block-start: var(--nk-border-hairline);
  box-shadow: var(--nk-shadow-lg);
  transform: translateY(100%);
  /*
   * `visibility` is what takes the resting bar out of the tab order — a
   * translate alone leaves its button focusable, so a keyboard user could
   * reach an add-to-cart parked below the fold. It is delayed by the length of
   * the transform so the slide-out is still painted; without the delay the bar
   * would vanish on frame one and the exit animation would never be seen.
   */
  visibility: hidden;
  transition: transform var(--nk-duration-normal) var(--nk-ease-out),
    visibility 0s linear var(--nk-duration-normal);
}
.nk-sticky-cta--visible {
  transform: translateY(0);
  visibility: visible;
  transition: transform var(--nk-duration-normal) var(--nk-ease-out), visibility 0s;
}
.nk-sticky-cta__price { flex: none; }
.nk-sticky-cta .nk-btn { flex: 1; }

@media (min-width: 1024px) { .nk-sticky-cta { display: none; } }

/* When both the sticky CTA and bottom nav exist, the CTA sits above it.
   `--nk-bottom-nav-space`, not `--nk-bottom-nav-height`: the nav pads itself
   by the safe-area inset, so on a notched iPhone offsetting by the content
   height alone left the bar ~34px too low — under a nav that also outranks it
   on z-index, which is exactly how it reads on the device and not at all in a
   desktop emulator, where the inset is 0. The bar's own safe-area padding goes
   with it: the nav below is what touches the home indicator now. */
.nk-has-bottom-nav .nk-sticky-cta {
  inset-block-end: var(--nk-bottom-nav-space);
  padding-block-end: var(--nk-space-3);
}
