/* =====================================================================
   AESTH — components.css
   Reusable pieces: chips, tags, prices, product card & grid,
   horizontal scroller, drawers (menu + bag), toast.
   ===================================================================== */

/* ---------- Chips ---------- */
.chip-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 38px;
  padding: .4rem 1rem;
  border-radius: var(--r-pill);
  background: var(--white);
  border: 1px solid var(--blush-300);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: background-color .2s, border-color .2s;
}
.chip:hover { background: var(--blush-100); border-color: var(--blush-400); }
.chip span { color: var(--ink-soft); font-weight: 500; }
.chip--sale { background: var(--rose-700); border-color: var(--rose-700); color: #fff; }
.chip--sale:hover { background: var(--rose-800); border-color: var(--rose-800); }

/* ---------- Tags (on product images) ---------- */
.tag {
  display: inline-block;
  padding: .28rem .65rem;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .01em;
}
.tag--off   { background: var(--rose-700); color: #fff; }
.tag--badge { background: var(--white); color: var(--sage-700); box-shadow: inset 0 0 0 1px var(--sage-300); }

/* ---------- Price ---------- */
.price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .15rem .55rem;
}
.price__now  { font-weight: 800; font-size: var(--fs-md); color: var(--ink); }
.price__mrp  { color: var(--ink-soft); font-size: var(--fs-sm); text-decoration-thickness: 1.5px; text-decoration-color: var(--blush-400); }
.price__save { color: var(--sage-700); font-size: var(--fs-xs); font-weight: 800; }

/* ---------- Product card ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-6) var(--space-4);
}
@media (min-width: 760px)  { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-7) var(--space-5); } }
@media (min-width: 1080px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.pcard { position: relative; display: flex; flex-direction: column; min-width: 0; }

.pcard__media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--blush-100);
}
.pcard__media > a { display: block; height: 100%; }
.pcard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .45s var(--ease), transform .6s var(--ease);
}
.pcard__img--hover { position: absolute; inset: 0; opacity: 0; }
@media (hover: hover) {
  .pcard:hover .pcard__img--hover { opacity: 1; }
  .pcard:hover .pcard__img { transform: scale(1.03); }
}

.pcard__tags {
  position: absolute;
  top: .7rem;
  left: .7rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  pointer-events: none;
}

.pcard__wish {
  position: absolute;
  top: .55rem;
  right: .55rem;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  transition: color .2s, transform .2s var(--ease);
}
.pcard__wish .icon { width: 20px; height: 20px; }
.pcard__wish:hover { color: var(--rose-700); }
.pcard__wish[aria-pressed="true"] { color: var(--rose-700); --heart-fill: currentColor; }   /* saved = solid heart */
.pcard__wish.is-pop { transform: scale(1.18); }

.pcard__stock {
  position: absolute;
  left: .7rem;
  bottom: .7rem;
  padding: .3rem .7rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .94);
  color: var(--rose-700);
  font-size: 12px;
  font-weight: 800;
}
.pcard__stock--out { color: var(--ink-soft); }
.is-soldout .pcard__img { filter: grayscale(.5) opacity(.75); }

.pcard__body {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
  padding-top: var(--space-3);
}
.pcard__cat { font-size: var(--fs-xs); color: var(--ink-soft); }
.pcard__title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-base);
  line-height: 1.35;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pcard__title a::after { content: ""; position: absolute; inset: 0 0 auto 0; aspect-ratio: 4 / 5; } /* whole image clickable */
.pcard__title a:hover { color: var(--rose-700); }
.pcard .price { margin-top: auto; padding-top: .2rem; }

.btn--bag {
  position: relative;
  z-index: 1;
  margin-top: var(--space-3);
  width: 100%;
  min-height: 42px;
  --btn-bg: var(--white);
  --btn-bd: var(--blush-300);
  --btn-fg: var(--ink);
}
.btn--bag:hover:not(:disabled) { --btn-bg: var(--rose-700); --btn-bd: var(--rose-700); --btn-fg: #fff; }
.btn--bag.is-added { --btn-bg: var(--sage-200); --btn-bd: var(--sage-300); --btn-fg: var(--sage-700); }
.pcard__wish, .pcard__tags { z-index: 2; }

@media (max-width: 520px) {
  .price__now { font-size: var(--fs-base); }
  .btn--bag span { font-size: var(--fs-xs); }
}

/* ---------- Horizontal scroller ---------- */
.scroller { position: relative; }
.scroller__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 46%);
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  padding-bottom: var(--space-2);
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scrollbar-width: none;
}
.scroller__track::-webkit-scrollbar { display: none; }
.scroller__track > * { scroll-snap-align: start; }
@media (min-width: 760px)  { .scroller__track { grid-auto-columns: calc((100% - 3 * var(--space-5)) / 3.4); gap: var(--space-5); } }
@media (min-width: 1080px) { .scroller__track { grid-auto-columns: calc((100% - 4 * var(--space-5)) / 4.4); } }

.scroller__btn {
  position: absolute;
  top: calc(50% - 60px);
  z-index: 3;
  display: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-pill);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  transition: opacity .2s;
}
.scroller__btn--prev { left: -12px; }
.scroller__btn--next { right: -12px; }
.scroller__btn:disabled { opacity: 0; pointer-events: none; }
@media (min-width: 1080px) and (hover: hover) { .scroller__btn { display: grid; } }

/* ---------- Drawers ---------- */
.drawer { position: fixed; inset: 0; z-index: 200; }
.drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(42, 32, 35, .38);
  opacity: 0;
  transition: opacity .3s;
}
.drawer__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(420px, 92vw);
  background: var(--white);
  box-shadow: var(--shadow-panel);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: transform .35s var(--ease);
}
.drawer--left  .drawer__panel { left: 0;  transform: translateX(-100%); }
.drawer--right .drawer__panel { right: 0; transform: translateX(100%); }
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--line);
}
.drawer__logo { height: 42px; width: auto; }
.drawer__title { font-size: var(--fs-lg); }
.drawer__title span { font-family: var(--font-body); font-size: var(--fs-sm); color: var(--ink-soft); font-weight: 600; }
.drawer__foot { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--line); }

/* ---------- Bag ---------- */
.bag { flex: 1; overflow-y: auto; padding: var(--space-2) var(--space-5); }
.bag__empty {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--ink-soft);
}
.bag__empty .icon { width: 44px; height: 44px; color: var(--blush-400); }
.bag__empty strong { color: var(--ink); font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 500; }

.bag-item {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: var(--space-3);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--line);
}
.bag-item img { width: 76px; height: 92px; object-fit: cover; border-radius: var(--r-sm); background: var(--blush-100); }
.bag-item__name { font-weight: 700; line-height: 1.3; font-size: var(--fs-sm); }
.bag-item__name a:hover { color: var(--rose-700); }
.bag-item .price { margin-top: .25rem; }
.bag-item .price__now { font-size: var(--fs-sm); }
.bag-item .price__mrp { font-size: var(--fs-xs); }
.qty {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-2);
  border: 1px solid var(--blush-300);
  border-radius: var(--r-pill);
}
.qty button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-pill); }
.qty button:hover { background: var(--blush-100); }
.qty .icon { width: 16px; height: 16px; }
.qty output { min-width: 24px; text-align: center; font-weight: 700; font-size: var(--fs-sm); }
.bag-item__remove { align-self: start; color: var(--ink-soft); width: 36px; height: 36px; }
.bag-item__remove .icon { width: 18px; height: 18px; }

.bag__foot { display: grid; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-top: 1px solid var(--line); background: var(--paper); }
.bag__row { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--fs-md); }
.bag__save { padding: .5rem .8rem; border-radius: var(--r-sm); background: var(--sage-200); color: var(--sage-700); font-weight: 700; font-size: var(--fs-sm); text-align: center; }
.bag__note { font-size: var(--fs-xs); color: var(--ink-soft); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 300;
  display: flex;
  align-items: center;
  gap: .6rem;
  max-width: min(92vw, 420px);
  padding: .8rem 1.2rem;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-panel);
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: opacity .25s, transform .25s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast .icon { width: 18px; height: 18px; color: var(--blush-300); }
.toast button { color: var(--blush-300); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; margin-left: .3rem; }

/* ---------- Additions: chips, empty states, checkboxes, crumbs ---------- */
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.is-active span { color: rgba(255,255,255,.75); }
.chip--sm { min-height: 32px; padding: .25rem .8rem; font-size: var(--fs-xs); }
.price__now small { font-size: .75em; font-weight: 700; color: var(--ink-soft); }
.btn--bag .icon { width: 17px; height: 17px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; font-size: var(--fs-xs); color: var(--ink-soft); }
.crumbs a:hover { color: var(--rose-700); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

.check { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-size: var(--fs-sm); font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--rose-700); }

.empty { display: grid; justify-items: center; gap: var(--space-3); text-align: center; padding: var(--space-8) var(--space-4); }
.empty__icon { width: 56px; height: 56px; color: var(--blush-400); }
.empty h1, .empty h2 { font-size: var(--fs-xl); max-width: 22ch; }
.empty p { color: var(--ink-soft); max-width: 46ch; }
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-3); }

.qty--lg button { width: 44px; height: 44px; }
.qty--lg output { min-width: 32px; font-size: var(--fs-base); }

.prose { color: var(--ink-soft); line-height: 1.7; }
.prose > * + * { margin-top: .9em; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); margin-top: 1.5em; font-size: var(--fs-md); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .35em; }
.prose a { color: var(--rose-700); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--ink); }

.bag-item__var { font-size: var(--fs-xs); color: var(--ink-soft); margin-top: .1rem; }
.toast { width: max-content; }

.toast__alert { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: #E8A0A9; color: var(--ink); font-weight: 900; font-size: 13px; }

.tag--ship { background: var(--sage-200); color: var(--sage-700); }
