/* ==========================================================================
   Ladha Merch — shop-specific components
   Extends style.css (design tokens, type, nav, footer, buttons, cards).
   Load order matters: style.css first, then shop.css.
   ========================================================================== */

/* --------------------------- nav cart trigger ----------------------------- */
.cart-trigger {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease);
  flex-shrink: 0;
}
.cart-trigger:hover {
  background: rgba(255, 255, 255, 0.14);
}
.cart-trigger svg {
  width: 18px;
  height: 18px;
  stroke: var(--paper);
  fill: none;
  stroke-width: 1.8;
}
.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.66rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease);
}
.cart-badge.bump {
  transform: scale(1.25);
}
.cart-badge[data-count='0'] {
  display: none;
}

/* --------------------------------- filters -------------------------------- */
.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-pill {
  padding: 10px 20px;
  border: 1.5px solid var(--ink);
  font-weight: 700;
  font-size: 0.84rem;
  background: transparent;
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}
.filter-pill:hover {
  background: var(--stone-20);
}
.filter-pill.active {
  background: var(--ink);
  color: var(--paper);
}

/* ------------------------------ product grid ------------------------------ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 980px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--stone);
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 34px -16px rgba(32, 23, 18, 0.22);
}

.product-media {
  aspect-ratio: 1 / 1;
  background: var(--stone-20);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%, 0 20px);
}
.product-media span.mono-tag {
  text-align: center;
  padding: 0 16px;
}
.product-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--ladha-500);
  color: var(--paper);
  font-weight: 900;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
}
.product-info {
  padding: 18px 20px 22px;
}
.product-cat {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-45);
  margin-bottom: 6px;
}
.product-info h3 {
  font-size: 1.02rem;
}
.product-price {
  font-weight: 900;
  color: var(--ladha-600);
  font-size: 1.05rem;
  margin-top: 12px;
}

/* ------------------------------ product detail ----------------------------- */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
@media (max-width: 900px) {
  .product-detail-grid {
    grid-template-columns: 1fr;
  }
}

.product-gallery-main {
  aspect-ratio: 1 / 1;
  background: var(--stone-20);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(28px 0, 100% 0, 100% 100%, 0 100%, 0 28px);
}

.option-block {
  margin-top: 26px;
}
.option-block .mono-tag {
  display: block;
  margin-bottom: 12px;
}
.swatch-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.swatch {
  padding: 11px 18px;
  border: 1.5px solid var(--stone);
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--paper);
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}
.swatch:hover {
  border-color: var(--ink);
}
.swatch.selected {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--stone);
}
.qty-stepper button {
  width: 40px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  transition: background 0.2s var(--ease);
}
.qty-stepper button:hover {
  background: var(--stone-20);
}
.qty-stepper span {
  width: 46px;
  text-align: center;
  font-weight: 700;
}

.detail-price {
  font-weight: 900;
  font-size: 1.7rem;
  color: var(--ladha-600);
  margin-top: 10px;
}
.add-to-cart-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 30px;
  flex-wrap: wrap;
}
.stock-note {
  font-size: 0.82rem;
  color: var(--ink-45);
  margin-top: 14px;
}
.pdp-desc {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px solid var(--stone);
}

/* --------------------------------- cart drawer ----------------------------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32, 23, 18, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
  z-index: 199;
}
.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(430px, 100vw);
  background: var(--paper);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s var(--ease);
  box-shadow: -12px 0 40px -20px rgba(0, 0, 0, 0.3);
}
.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-bottom: 1px solid var(--stone);
  flex-shrink: 0;
}
.cart-drawer-header h3 {
  font-size: 1.1rem;
}
.cart-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--stone);
}
.cart-close svg {
  width: 15px;
  height: 15px;
  stroke: var(--ink);
  fill: none;
  stroke-width: 2;
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 26px;
}
.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--stone-40);
}
.cart-line-thumb {
  width: 64px;
  height: 64px;
  background: var(--stone-20);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.7rem;
  color: var(--ink-45);
  text-align: center;
}
.cart-line h4 {
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.cart-line .meta {
  font-size: 0.78rem;
  color: var(--ink-45);
  margin-bottom: 10px;
}
.cart-line-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cart-line-actions .qty-stepper button {
  width: 30px;
  height: 32px;
  font-size: 0.95rem;
}
.cart-line-actions .qty-stepper span {
  width: 34px;
  font-size: 0.85rem;
}
.cart-line-remove {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ladha-600);
}
.cart-line-remove:hover {
  text-decoration: underline;
}
.cart-line-price {
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.cart-empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--ink-45);
}
.cart-empty svg {
  width: 40px;
  height: 40px;
  stroke: var(--stone);
  fill: none;
  stroke-width: 1.3;
  margin: 0 auto 18px;
}

.cart-drawer-footer {
  padding: 22px 26px 26px;
  border-top: 1px solid var(--stone);
  flex-shrink: 0;
}
.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 900;
  font-size: 1.1rem;
  margin-bottom: 16px;
}
.cart-subtotal-row .amount {
  color: var(--ladha-600);
}
.cart-drawer-footer .btn-primary {
  width: 100%;
  justify-content: center;
}
.cart-note {
  font-size: 0.76rem;
  color: var(--ink-45);
  margin-top: 12px;
  text-align: center;
}

/* -------------------------------- checkout page ----------------------------- */
.order-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--stone);
  align-items: center;
}
.order-line-thumb {
  width: 64px;
  height: 64px;
  background: var(--stone-20);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.72rem;
  color: var(--ink-45);
  text-align: center;
}
.order-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 0.95rem;
}
.order-summary-row.total {
  font-weight: 900;
  font-size: 1.2rem;
  border-top: 1px solid var(--stone);
  margin-top: 8px;
  padding-top: 18px;
}
.order-summary-row.total .amount {
  color: var(--ladha-600);
}

.checkout-empty {
  text-align: center;
  padding: 90px 20px;
}

.form-err {
  display: block;
  font-size: 0.82rem;
  color: #d92d20;
  margin-top: 12px;
}

/* success overlay — shown after Formspree submission */
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24, 18, 14, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: overlayFadeIn 0.25s var(--ease);
}
.success-overlay-card {
  background: var(--paper);
  border: 1px solid var(--stone);
  padding: 48px 40px;
  max-width: 460px;
  width: 90%;
  text-align: center;
}
.success-overlay-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ladha-100, #e8f5e9);
  color: var(--ladha-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.success-overlay-icon svg {
  width: 28px;
  height: 28px;
}

@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

:root {
  --shop-currency: 'TSh';
}
