/**
 * SATOTA — Shop page styles
 * Builds on style.css design tokens (colours, radius, shadows, fonts)
 * so light / dark themes work automatically.
 */

/* ---------- generic outline button (style.css only ships -navy/-white) ---------- */
.btn--outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--heading);
}
.btn--outline:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- hero ---------- */
.shop-hero {
  padding: calc(var(--nav-h) + 40px) 0 28px;
  background: linear-gradient(180deg, var(--hero-bg-1), var(--hero-bg-2));
  border-bottom: 1px solid var(--border);
}
.shop-hero__title {
  font-family: var(--font-bn-serif);
  font-size: clamp(26px, 4vw, 40px);
  color: var(--heading);
  margin: 6px 0 10px;
}
.shop-hero__sub { color: var(--muted); max-width: 640px; line-height: 1.7; }
.shop-hero__note { margin-top: 12px; font-size: 12.5px; color: var(--muted); }

/* ---------- category filter chips ---------- */
.shop-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.shop-filter__chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--white);
  color: var(--heading);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.shop-filter__chip:hover { border-color: var(--gold); }
.shop-filter__chip.is-active { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }

/* ---------- state text ---------- */
.shop-state { padding: 40px 0; text-align: center; color: var(--muted); }

/* ---------- product groups + grid ---------- */
.shop-group { margin-bottom: 40px; }
.shop-group:last-child { margin-bottom: 0; }
.shop-group__title {
  font-size: 18px;
  color: var(--heading);
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.shop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 560px) { .shop-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }

.shop-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.shop-card:hover { border-color: var(--gold); box-shadow: var(--shadow-md); }
.shop-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  overflow: hidden;
  cursor: pointer;
}
.shop-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-card__tag {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(11,31,51,0.82);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
}
.shop-card__stock {
  position: absolute;
  top: 10px; right: 10px;
  background: #C0392B;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
}
.shop-card__body { padding: 15px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.shop-card__title { font-size: 15px; font-weight: 700; color: var(--heading); margin: 0; }
.shop-card__name-en { font-size: 11.5px; color: var(--muted); margin: 0; }
.shop-card__desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 4px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shop-card__price-row {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.shop-card__price { font-family: var(--font-en); font-size: 17px; font-weight: 800; color: var(--heading); }
.shop-card__unit { font-size: 11.5px; color: var(--muted); }
.shop-card__price--ask { font-size: 13.5px; font-weight: 700; color: var(--gold); }
.shop-card__actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.shop-card__actions .btn { flex: 1 1 auto; }
.shop-card__wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: #25D366;
  flex: 0 0 auto;
}
.shop-card__wa:hover { border-color: #25D366; }
.shop-card__wa .icon { width: 18px; height: 18px; }

/* ---------- cart button in navbar ---------- */
.shop-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--white);
  color: var(--heading);
  cursor: pointer;
}
.shop-cart-btn:hover { border-color: var(--gold); }
.shop-cart-btn .icon { width: 20px; height: 20px; }
.shop-cart-btn__count {
  position: absolute;
  top: -7px; right: -7px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- cart drawer ---------- */
.shop-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease), visibility var(--dur-fast) var(--ease);
}
.shop-drawer.is-open { visibility: visible; opacity: 1; }
.shop-drawer__backdrop { position: absolute; inset: 0; background: rgba(11,31,51,0.5); }
.shop-drawer__panel {
  position: absolute;
  top: 0; right: 0;
  width: min(410px, 92vw);
  height: 100%;
  background: var(--white);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-med) var(--ease);
}
.shop-drawer.is-open .shop-drawer__panel { transform: translateX(0); }
.shop-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.shop-drawer__head h2 { font-size: 17px; margin: 0; color: var(--heading); }
.shop-drawer__close {
  background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); line-height: 1;
}
.shop-drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.shop-drawer__foot { padding: 16px 20px; border-top: 1px solid var(--border); display: grid; gap: 10px; }

.shop-cart-empty { color: var(--muted); text-align: center; padding: 30px 0; }

.shop-cart-line {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.shop-cart-line__img {
  width: 56px; height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg);
}
.shop-cart-line__name { font-size: 13px; font-weight: 700; color: var(--heading); margin: 0 0 2px; }
.shop-cart-line__price { font-size: 12px; color: var(--muted); font-family: var(--font-en); }
.shop-cart-line__right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.shop-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.shop-qty button {
  width: 26px; height: 26px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  color: var(--heading);
  font-size: 14px;
  line-height: 1;
}
.shop-qty span {
  min-width: 30px;
  text-align: center;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 700;
}
.shop-cart-line__remove {
  background: none; border: none; cursor: pointer;
  font-size: 11px; color: #C0392B; text-decoration: underline;
}
.shop-cart-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: var(--heading);
}
.shop-cart-subtotal span:last-child { font-family: var(--font-en); font-size: 18px; }

/* ---------- modals (product + checkout) ---------- */
.shop-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.shop-modal[hidden] { display: none; }
.shop-modal__backdrop { position: absolute; inset: 0; background: rgba(11,31,51,0.55); }
.shop-modal__card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  width: min(720px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-shadow: var(--shadow-lg);
}
.shop-modal__card--form { grid-template-columns: 1fr; padding: 26px; }
@media (max-width: 640px) { .shop-modal__card { grid-template-columns: 1fr; } }
.shop-modal__close {
  position: absolute;
  top: 10px; right: 12px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 30px; height: 30px;
  cursor: pointer;
  color: var(--navy);
  z-index: 2;
}
.shop-modal__media { background: var(--bg); }
.shop-modal__media img { width: 100%; height: 100%; max-height: 360px; object-fit: cover; display: block; }
.shop-modal__body { padding: 24px; }
.shop-modal__cat { font-size: 12px; color: var(--muted); margin: 0 0 4px; }
.shop-modal__title { font-size: 20px; color: var(--heading); margin: 0 0 2px; }
.shop-modal__name-en { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.shop-modal__price { font-family: var(--font-en); font-size: 22px; font-weight: 800; color: var(--heading); margin: 0 0 12px; }
.shop-modal__desc { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin: 0 0 18px; }
.shop-modal__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.shop-checkout-summary {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 6px 0 16px;
  font-size: 13px;
}
.shop-checkout-summary__row { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.shop-checkout-summary__row span:last-child { font-family: var(--font-en); color: var(--heading); }
.shop-checkout-summary__total {
  display: flex; justify-content: space-between;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--border);
  font-weight: 800; color: var(--heading);
}
.shop-checkout-summary__total span:last-child { font-family: var(--font-en); }

.shop-checkout-success { text-align: center; padding: 20px 6px; }
.shop-checkout-success__icon {
  display: inline-flex;
  width: 46px; height: 46px;
  border-radius: 999px;
  background: rgba(39,174,96,0.14);
  color: #1E9E5A;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.shop-checkout-success__icon .icon { width: 24px; height: 24px; }
.shop-checkout-success h3 { color: var(--heading); font-size: 17px; margin: 0 0 6px; }
.shop-checkout-success p { color: var(--muted); font-size: 13px; }

body.shop-locked { overflow: hidden; }

/* keep bottom cart bar clear of content on mobile */
@media (max-width: 1023px) {
  #shopMain { padding-bottom: calc(var(--mobile-cta-h) + 10px); }
}
