/* ==========================================================================
   NASHIRA STANDALONE PRODUCT CARD
   Self-contained. Inherits nothing from the host theme.
   ========================================================================== */

.ns-card,
.ns-grid {
  --ns-c-ink: #2a1810;
  --ns-c-muted: #6b574a;
  --ns-c-hairline: #ddccae;
  --ns-c-surface: #efe5d2;
  --ns-c-cream: #fffdf7;
  --ns-c-maroon: #5a0f1c;
  --ns-c-gold: #bf9b48;
  --ns-c-gold-bright: #d8b566;
  --ns-c-sale: #a3282b;
  --ns-f-head: "Marcellus", Georgia, serif;
  --ns-f-body: "Mukta", "Helvetica Neue", Arial, sans-serif;
  --ns-f-accent: "Cormorant Garamond", Georgia, serif;
  --ns-ratio: 3 / 4;
}

/* -------- self-defending resets (host theme CSS is assumed hostile) ------- */
.ns-card *,
.ns-card *::before,
.ns-card *::after { box-sizing: border-box; }

.ns-card img { max-width: 100%; display: block; height: auto; }

.ns-card svg {
  flex: none !important;
  max-width: none !important;
  display: block;
}

.ns-card button {
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.ns-card a { text-decoration: none; color: inherit; }
.ns-card p, .ns-card h3, .ns-card s { margin: 0; padding: 0; }
.ns-card ul, .ns-card li { list-style: none; margin: 0; padding: 0; }

/* ------------------------------- card root ------------------------------- */
.ns-card {
  position: relative;
  font-family: var(--ns-f-body);
  color: var(--ns-c-ink);
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------- image box ------------------------------- */
.ns-card__media {
  position: relative;
  aspect-ratio: var(--ns-ratio);
  overflow: hidden;
  border-radius: 0;
  background: var(--ns-c-surface);
  border: 1px solid var(--ns-c-hairline);
}

.ns-card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}

.ns-card__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s ease;
}
.ns-card__slide.is-active { opacity: 1; }

.ns-card__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.ns-card__ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ns-c-surface);
}
.ns-card__ph svg { width: 46px; height: 46px; opacity: .3; }

/* -------------------------------- tags ----------------------------------- */
.ns-card__tags {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  pointer-events: none;
}

.ns-card__tag {
  font-family: var(--ns-f-body);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 5px 10px;
  border-radius: 0;
  line-height: 1;
  white-space: nowrap;
  background: var(--ns-c-ink);
  color: #fffdf7;
}
.ns-card__tag--new  { background: var(--ns-c-gold); color: var(--ns-c-ink); }
.ns-card__tag--save { background: var(--ns-c-sale); color: #fff; }

/* ------------------------------ wishlist --------------------------------- */
.ns-card__wish {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 4;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid rgba(42, 24, 16, .1);
  box-shadow: 0 4px 14px -6px rgba(42, 24, 16, .3);
  transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.ns-card__wish:hover {
  transform: translateY(-1px);
  background: var(--ns-c-ink);
  box-shadow: 0 6px 18px -6px rgba(42, 24, 16, .45);
}
.ns-card__wish svg { width: 18px; height: 18px; stroke: var(--ns-c-maroon); fill: none; stroke-width: 1.6; transition: stroke .25s ease, fill .25s ease; }
.ns-card__wish:hover svg { stroke: #ffffff; }
.ns-card__wish.is-on svg { stroke: var(--ns-c-sale); fill: var(--ns-c-sale); }

/* ------------------------------- arrows ---------------------------------- */
.ns-card__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 253, 247, .86);
  border: 1px solid rgba(42, 24, 16, .08);
  opacity: 0;
  transition: opacity .3s ease, background .2s ease;
}
.ns-card__media:hover .ns-card__arrow { opacity: 1; }
.ns-card__arrow:hover { background: #fffdf7; }
.ns-card__arrow--prev { left: 8px; }
.ns-card__arrow--next { right: 8px; }
.ns-card__arrow svg { width: 13px; height: 13px; stroke: var(--ns-c-ink); fill: none; stroke-width: 1.7; }

/* -------------------------------- dots ----------------------------------- */
.ns-card__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
}
.ns-card__dot {
  width: 5px;
  height: 5px;
  border-radius: 10px;
  background: rgba(255, 253, 247, .6);
  transition: width .3s ease, background .3s ease;
}
.ns-card__dot.is-active { width: 16px; background: #fffdf7; }

/* ------------------------------ quick add -------------------------------- */
.ns-card__qadd {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid rgba(42, 24, 16, .1);
  box-shadow: 0 4px 14px -6px rgba(42, 24, 16, .3);
  opacity: 0;
  transform: translateY(8px) scale(.9);
  transition: opacity .3s ease, transform .3s ease, background .25s ease, box-shadow .25s ease;
}
.ns-card:hover .ns-card__qadd,
.ns-card:focus-within .ns-card__qadd {
  opacity: 1;
  transform: none;
}
.ns-card__qadd:hover {
  background: var(--ns-c-ink);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -6px rgba(42, 24, 16, .45);
}
.ns-card__qadd svg { width: 19px; height: 19px; }
/* colourful bag icon - strokes swap to white on hover */
.ns-card__qadd .ns-bag-body { stroke: var(--ns-c-maroon); fill: none; stroke-width: 1.6; transition: stroke .25s ease; }
.ns-card__qadd .ns-bag-handle { stroke: var(--ns-c-gold); fill: none; stroke-width: 1.6; transition: stroke .25s ease; }
.ns-card__qadd .ns-bag-plus { stroke: var(--ns-c-gold-bright); fill: none; stroke-width: 1.8; transition: stroke .25s ease; }
.ns-card__qadd:hover .ns-bag-body,
.ns-card__qadd:hover .ns-bag-handle,
.ns-card__qadd:hover .ns-bag-plus { stroke: #ffffff; }
.ns-card__qadd.is-loading { opacity: .6; pointer-events: none; }

/* --------------------------------- body ---------------------------------- */
.ns-card__body { padding-top: 14px; padding-bottom: 2px; }

.ns-card__title {
  font-family: var(--ns-f-head);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ns-c-ink);
  margin-bottom: 3px;
  overflow-wrap: break-word;
}

.ns-card__sub {
  font-family: var(--ns-f-accent);
  font-style: italic;
  font-size: 16px;
  color: var(--ns-c-muted);
  margin-bottom: 4px;
}

.ns-card__price {
  font-family: var(--ns-f-body);
  font-size: 15.5px;
  color: var(--ns-c-muted);
}
.ns-card__price b { color: var(--ns-c-ink); font-weight: 600; }
.ns-card__price s { opacity: .75; margin-left: 6px; }

/* ------------------------------- a11y focus ------------------------------ */
.ns-card a:focus-visible,
.ns-card button:focus-visible {
  outline: 2px solid var(--ns-c-maroon);
  outline-offset: 2px;
}

/* --------------------------------- grid ---------------------------------- */
.ns-grid {
  display: grid;
  grid-template-columns: repeat(var(--ns-cols, 4), minmax(0, 1fr));
  gap: 26px 24px;
}

@media (max-width: 1100px) {
  .ns-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
/* A tablet was getting two cards per row — the same as a phone, on a screen
   twice as wide, which made 346px cards and a lot of scrolling through a
   452-piece catalogue. Three across from 600px up; phones keep two. */
@media (max-width: 1100px) and (min-width: 600px) {
  .ns-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 599px) {
  .ns-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 22px 12px; }
}
@media (max-width: 768px) {
  .ns-card__title { font-size: 16.5px; }
  /* 44px, not 37px: this is the add-to-bag control and it is tapped with a thumb */
  .ns-card__wish,
  .ns-card__qadd { width: 44px; height: 44px; }
  .ns-card__wish svg { width: 16px; height: 16px; }
  .ns-card__qadd svg { width: 17px; height: 17px; }
  .ns-card__arrow { display: none; }
}
@media (max-width: 430px) {
  .ns-grid--one-mobile { grid-template-columns: 1fr !important; }
}

/* quick add always visible where hover does not exist */
@media (hover: none) {
  .ns-card__qadd { opacity: 1; transform: none; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ns-card__slide { transition: none; }
  .ns-card__wish,
  .ns-card__qadd { transition: none; }
}

/* --------------------------------- toast --------------------------------- */
.ns-card-toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(160px);
  background: var(--ns-c-ink, #2a1810);
  color: #f7f0e4;
  padding: 14px 28px;
  font-family: "Mukta", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: .14em;
  text-transform: uppercase;
  border: 1px solid #bf9b48;
  border-radius: 0;
  z-index: 2000;
  transition: transform .4s ease;
  pointer-events: none;
}
.ns-card-toast.is-on { transform: translateX(-50%) translateY(0); }

/* --------------------------------------------------------------------------
   ACTION BUTTON BACKGROUNDS
   Pinned at higher specificity so theme/app styles cannot strip the white
   pill out from under the wishlist and quick-add icons.
   -------------------------------------------------------------------------- */
.ns-card .ns-card__wish,
.ns-card .ns-card__qadd,
.ns-card__media .ns-card__wish,
.ns-card__media .ns-card__qadd {
  background: #ffffff;
  border: 1px solid rgba(42, 24, 16, 0.1);
  box-shadow: 0 4px 14px -6px rgba(42, 24, 16, 0.3);
  backdrop-filter: none;
}

.ns-card .ns-card__wish:hover,
.ns-card .ns-card__qadd:hover {
  background: var(--ns-c-ink, #2a1810);
}

/* Touch devices have no hover, so quick add would never appear */
@media (hover: none) {
  .ns-card .ns-card__qadd {
    opacity: 1;
    transform: none;
  }
}

/* status badges from snippets/ns-status-badge.liquid: maroon for Bestseller,
   gold for Newly Launched - two looks a shopper can tell apart at a glance.
   The modifier is handleize(label), so renaming the label renames the class:
   "Newly Launched" -> .ns-card__tag--newly-launched. Shown again Oct 2026 for
   the Barkat launch, having been hidden earlier at the client's request. */
.ns-card__tag--bestseller { background: var(--ns-maroon, #5a0f1c); color: var(--ns-gold-bright, #d8b566); }
.ns-card__tag--newly-launched { white-space: nowrap; background: var(--ns-gold, #bf9b48); color: var(--ns-ink, #2a1810); }

/* ---------- star rating on the card ----------
   Rendered from the reviews metafield by snippets/product-rating.liquid. It is
   deliberately quiet: the stars sit under the title at the same size as the
   price, so they read as reassurance rather than decoration. Products with no
   reviews render nothing at all and the card closes up. */
.ns-card__rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 13px;
  color: var(--ns-c-ink, #2a1810);
  font-family: var(--nsa-body, inherit);
}
.ns-card__rating:empty { display: none; }
.ns-card__rating .rating-star,
.ns-card__rating svg { color: var(--ns-c-gold, #bf9b48); }
.ns-card__rating .rating-value,
.ns-card__rating .rating-count { opacity: .85; letter-spacing: .02em; }

/* "14 colours" under the card title. Quiet by design - it is a fact about the
   range, not a badge, and it should not compete with the price. */
.ns-card__opts {
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ns-c-gold-deep, #9a7a32);
  font-family: var(--nsa-body, inherit);
}

/* "Only 3 left" on a tile. Same maroon as the bestseller tag but outlined, so
   urgency reads as information rather than another promotional block. */
.ns-card__tag--low {
  background: var(--ns-c-cream, #fffdf7);
  color: var(--ns-c-maroon, #5a0f1c);
  border: 1px solid var(--ns-c-maroon, #5a0f1c);
}
