/* SAJNAARA JEWELLERY: reusable cards, controls, cart drawer and notices */

/* Section headings and product grids */
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.section-head p { margin-top: .65rem; color: var(--ink-soft); }
.section-foot { margin-top: 2.5rem; text-align: center; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 2rem);
}

/* Product cards */
.product-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--field);
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}
.product-card:hover { box-shadow: var(--shadow-pop); transform: translateY(-2px); }
.product-card-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--ivory-deep);
}
.product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
@media (hover: hover) {
  .product-card:hover .product-card-media img { transform: scale(1.035); }
}
.product-card-body { display: flex; flex-direction: column; gap: .45rem; padding: 1rem; }
.product-card-cat {
  color: var(--gold-deep);
  font-size: var(--fs-xs);
  letter-spacing: .07em;
  text-transform: uppercase;
}
.product-card-title { font-size: clamp(1.15rem, 1.6vw, 1.45rem); line-height: 1.15; }
.product-card-title a:hover { color: var(--gold-deep); }
.product-card-desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.product-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .55rem;
}
.product-card-foot .price { margin: 0; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .5rem; font-weight: 600; }
.price-now { color: var(--ink-deep); font-size: 1.15rem; }
.price--large .price-now { font-size: 1.65rem; }
.price-was { color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 400; }
.price-save { color: var(--success); font-size: var(--fs-xs); font-weight: 500; }
.badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  z-index: 1;
  padding: .35rem .65rem;
  background: var(--ink-deep);
  color: var(--ivory);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge--sale { background: var(--wine); }
.badge--soldout { background: #5F554B; }
.product-card.is-soldout .product-card-media img { opacity: .72; }
.wish-btn {
  position: absolute;
  top: .65rem;
  right: .65rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,253,248,.94);
  color: var(--ink-deep);
}
.wish-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.wish-btn.is-saved { color: var(--wine); }
.wish-btn.is-saved svg { fill: currentColor; }

/* Filter chips */
.chip-row { display: flex; flex-wrap: wrap; gap: .55rem; }
.chip {
  min-height: 40px;
  padding: .45rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.chip:hover, .chip.is-active {
  border-color: var(--gold-deep);
  background: var(--champagne);
  color: var(--ink-deep);
}
.chip[aria-pressed="true"] { border-color: var(--gold-deep); }

/* Quantity controls */
.qty {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--field);
}
.qty-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: var(--ink-deep);
  font-size: 1.25rem;
}
.qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.qty-value { min-width: 2rem; text-align: center; font-variant-numeric: tabular-nums; }

/* Cart lines, used in both the drawer and cart page */
.cart-line {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}
.cart-line-media { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--ivory-deep); }
.cart-line-media img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-title { font-size: 1.2rem; }
.cart-line-title a:hover { color: var(--gold-deep); }
.cart-line-meta, .cart-line-price { margin-top: .2rem; color: var(--ink-soft); font-size: var(--fs-xs); }
.cart-line .qty { margin-top: .65rem; }
.cart-line .qty-btn { width: 34px; height: 34px; }
.cart-line-side { display: flex; flex-direction: column; align-items: flex-end; gap: .45rem; }
.cart-line-total { font-weight: 600; white-space: nowrap; }

/* Cart drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(42,32,24,.48);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--t), visibility 0s linear var(--t);
}
.drawer-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--t), visibility 0s;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  width: min(94vw, 480px);
  height: 100vh;
  height: 100dvh;
  padding: 0;
  background: var(--ivory);
  box-shadow: var(--shadow-drawer);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform var(--t) var(--ease), visibility 0s linear var(--t);
}
.cart-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform var(--t) var(--ease), visibility 0s;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 1.7rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: .25rem 1.25rem 1rem; }
.drawer-foot { padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--ivory-deep); }
.drawer-foot .btn + .btn { margin-top: .6rem; }
.drawer-subtotal { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; font-size: 1.1rem; }

/* Toast messages and empty/notice states */
.toast-region {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: var(--z-toast);
  display: grid;
  gap: .65rem;
  width: min(92vw, 380px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(220,195,147,.45);
  background: var(--ink-deep);
  color: var(--ivory);
  box-shadow: var(--shadow-pop);
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .25s, transform .25s;
}
.toast a { color: var(--gold-soft); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.toast.is-leaving { opacity: 0; transform: translateY(.5rem); }
.empty-state {
  padding: clamp(2rem, 5vw, 3.5rem);
  border: 1px dashed var(--gold);
  background: var(--ivory-deep);
  text-align: center;
}
.empty-state h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.empty-state p { max-width: 48ch; margin: .75rem auto 1.25rem; color: var(--ink-soft); }
.notice {
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  background: var(--ivory-deep);
  color: var(--ink);
}
.notice--warn { border-color: var(--gold); background: #F8F0DE; }
.notice + .notice { margin-top: 1rem; }

/* Product detail accordions */
.accordion { border-top: 1px solid var(--line); }
.accordion:last-child { border-bottom: 1px solid var(--line); }
.accordion summary {
  position: relative;
  padding: 1rem 2rem 1rem 0;
  color: var(--ink-deep);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "+";
  position: absolute;
  right: .25rem;
  top: .7rem;
  color: var(--gold-deep);
  font-size: 1.4rem;
}
.accordion[open] summary::after { content: "−"; }
.accordion-body { padding: 0 0 1rem; color: var(--ink-soft); }
.accordion-body a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 767px) {
  .section-head { margin-bottom: 1.5rem; }
  .product-card-body { padding: .75rem; }
  .product-card-foot { align-items: flex-start; }
  .cart-line { grid-template-columns: 72px minmax(0, 1fr); }
  .cart-line-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
}

.badge--sample { background: var(--gold-deep); }
.sample-status { color: var(--ink-soft); font-size: var(--fs-xs); font-weight: 500; }
