/* ===== Page transition =====
   Fade-in runs as a pure CSS animation — it starts the instant the page paints,
   with zero dependency on JS finishing (so a slow script can never leave the page stuck blank).
   Fade-out (before navigating away) is the only part that needs JS, since it has to run on click. */
body{ animation: pageFadeIn .25s ease-out both; }
@keyframes pageFadeIn{ from{ opacity: 0; } to{ opacity: 1; } }
body.page-fade-out{ animation: none; opacity: 0; transition: opacity .15s ease; }

/* ===== Nav cart icon ===== */
.nav-cart{
  position:relative; display:flex; align-items:center; justify-content:center;
  width:42px; height:42px; border-radius:50%; background:var(--card); box-shadow:var(--shadow-sm);
  cursor:pointer; border:none; margin-left:10px; flex-shrink:0; transition:transform .2s ease;
}
.nav-cart.bump{ animation:cartBump .45s ease; }
@keyframes cartBump{ 0%{transform:scale(1);} 35%{transform:scale(1.22);} 60%{transform:scale(0.94);} 100%{transform:scale(1);} }
.nav-cart svg{ width:19px; height:19px; }
.cart-badge{
  position:absolute; top:-4px; right:-4px; background:var(--violet-bright); color:#fff;
  font-size:10.5px; font-weight:700; min-width:18px; height:18px; border-radius:999px;
  align-items:center; justify-content:center; display:none; padding:0 4px; box-shadow:0 3px 8px rgba(0,0,0,0.2);
}

/* ===== Add-to-cart toast ===== */
.add-toast{
  position:fixed; left:50%; bottom:30px; transform:translate(-50%,20px); z-index:2150;
  background:var(--ink); color:#fff; padding:13px 18px; border-radius:999px; font-size:13px;
  display:flex; align-items:center; gap:10px; box-shadow:0 16px 40px rgba(0,0,0,0.25);
  opacity:0; pointer-events:none; transition:all .3s cubic-bezier(.2,.8,.3,1); white-space:nowrap;
}
.add-toast.show{ opacity:1; transform:translate(-50%,0); pointer-events:auto; }
.add-toast strong{ font-weight:600; }
.add-toast-check{ width:18px; height:18px; border-radius:50%; background:#4CAF7D; display:inline-flex; align-items:center; justify-content:center; font-size:11px; flex-shrink:0; }
.add-toast-view{ background:rgba(255,255,255,0.14); border:none; color:#fff; border-radius:999px; padding:6px 12px; font-size:11.5px; cursor:pointer; margin-left:4px; }
.add-toast-view:hover{ background:rgba(255,255,255,0.24); }
@media (max-width:520px){ .add-toast{ font-size:12px; padding:11px 14px; } }

/* ===== Overlay (shared by cart + checkout) ===== */
.overlay{
  position:fixed; inset:0; background:rgba(43,26,45,0.45); backdrop-filter:blur(2px);
  opacity:0; pointer-events:none; transition:opacity .25s ease; z-index:2100;
}
.overlay.open{ opacity:1; pointer-events:auto; }

/* ===== Cart drawer ===== */
.cart-drawer{
  position:fixed; top:0; right:0; height:100%; width:420px; max-width:92vw; background:var(--bg);
  box-shadow:-20px 0 60px rgba(43,26,45,0.25); transform:translateX(100%); transition:transform .35s cubic-bezier(.2,.8,.2,1);
  z-index:2101; display:flex; flex-direction:column; border-radius:28px 0 0 28px;
}
.cart-drawer.open{ transform:translateX(0); }
.cart-head{ display:flex; align-items:center; justify-content:space-between; padding:28px 28px 20px; }
.cart-head h3{ font-family:'Fraunces',serif; font-size:21px; font-weight:500; }
.cart-head .cart-count-tag{ font-size:11.5px; color:var(--ink-soft); font-weight:400; margin-left:8px; }
.cart-close{ background:var(--lilac); border:none; width:36px; height:36px; border-radius:50%; cursor:pointer; font-size:14px; color:var(--ink-soft); transition:all .2s ease; }
.cart-close:hover{ background:var(--violet); color:#fff; }
.cart-body{ flex:1; overflow-y:auto; padding:6px 28px 20px; }
.cart-empty{ text-align:center; color:var(--ink-soft); font-size:14px; padding:70px 16px; line-height:1.7; }
.cart-empty svg{ width:44px; height:44px; margin-bottom:16px; opacity:.5; }
.cart-line{
  display:flex; align-items:center; gap:14px; padding:16px; margin-bottom:12px;
  background:var(--card); border-radius:20px; box-shadow:var(--shadow-sm);
}
.cart-line img{ width:60px; height:60px; border-radius:16px; object-fit:cover; flex-shrink:0; }
.cart-line-info{ flex:1; min-width:0; }
.cart-line-name{ font-size:14px; font-weight:500; margin-bottom:2px; }
.cart-line-price{ font-size:12px; color:var(--violet-bright); margin-bottom:10px; font-weight:600; }
.qty-control{ display:flex; align-items:center; gap:0; width:fit-content; background:var(--lilac); border-radius:999px; padding:3px; }
.qty-control button{ width:24px; height:24px; border-radius:50%; border:none; background:var(--card); cursor:pointer; font-size:14px; color:var(--violet); line-height:1; box-shadow:0 2px 6px rgba(0,0,0,0.08); }
.qty-control span{ font-size:13px; min-width:26px; text-align:center; font-weight:500; }
.cart-remove{ background:none; border:none; color:var(--ink-soft); cursor:pointer; font-size:12px; padding:6px; align-self:flex-start; opacity:.6; transition:opacity .2s ease; }
.cart-remove:hover{ opacity:1; color:var(--violet); }
.cart-foot{ padding:20px 28px 28px; border-top:1px solid var(--lilac-line); background:var(--bg); }
.cart-subtotal-row{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:18px; }
.cart-subtotal-row span:first-child{ font-size:13px; color:var(--ink-soft); }
.cart-subtotal-row span:last-child{ font-family:'Fraunces',serif; font-size:22px; color:var(--violet); }
.cart-foot .btn-primary{ width:100%; justify-content:center; }
.cart-note{ font-size:11.5px; color:var(--ink-soft); text-align:center; margin-top:14px; line-height:1.5; }

/* ===== Checkout modal ===== */
.checkout-modal{
  position:fixed; top:50%; left:50%; transform:translate(-50%,-48%) scale(.97); width:820px; max-width:94vw;
  max-height:88vh; overflow-y:auto; background:var(--card); border-radius:32px; box-shadow:var(--shadow-lg);
  opacity:0; pointer-events:none; transition:all .3s cubic-bezier(.2,.8,.2,1); z-index:2102; padding:0;
}
.checkout-modal.open{ opacity:1; pointer-events:auto; transform:translate(-50%,-50%) scale(1); }
.checkout-modal-head{
  display:flex; align-items:center; justify-content:space-between; padding:28px 32px 22px;
  position:sticky; top:0; background:var(--card); border-radius:32px 32px 0 0; z-index:2;
}
.checkout-modal-head .co-heading{ display:flex; align-items:center; gap:12px; }
.checkout-modal-head .co-icon{ width:38px; height:38px; border-radius:50%; background:var(--lilac); display:flex; align-items:center; justify-content:center; font-size:16px; color:var(--violet); flex-shrink:0; }
.checkout-modal-head h3{ font-family:'Fraunces',serif; font-size:21px; font-weight:500; }
.checkout-modal-head .co-sub{ font-size:12px; color:var(--ink-soft); margin-top:2px; }
.checkout-modal-body{ padding:0 32px 32px; }

/* Two-column layout: form is the primary column, summary is a compact sidebar next to it */
.checkout-layout{ display:grid; grid-template-columns:1.4fr 1fr; gap:28px; align-items:start; }
.checkout-form-col{ min-width:0; }
.checkout-summary-col{ position:sticky; top:0; }
.checkout-summary-card{ background:var(--lilac); border-radius:20px; padding:22px; }
.cs-label{ font-size:11px; letter-spacing:0.1em; text-transform:uppercase; color:var(--violet-bright); font-weight:600; margin-bottom:14px; }

.co-line{ display:flex; justify-content:space-between; gap:8px; padding:7px 0; color:var(--ink-soft); font-size:13px; border-bottom:1px dashed rgba(91,51,116,0.12); }
.co-line span:first-child{ min-width:0; }
.co-total{ border-top:1.5px solid var(--lilac-line); border-bottom:none; margin-top:6px; padding-top:14px; font-weight:600; color:var(--ink); font-family:'Fraunces',serif; font-size:17px; }

.form-section-label{ font-size:11.5px; letter-spacing:0.1em; text-transform:uppercase; color:var(--violet-bright); font-weight:600; margin-bottom:14px; }
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:12px; }
.form-row.full{ grid-template-columns:1fr; }
.form-field label{ font-size:12px; color:var(--ink-soft); display:block; margin-bottom:6px; }
.form-field input, .form-field textarea{
  width:100%; border:1.5px solid var(--lilac-line); border-radius:16px; padding:15px 16px; font-family:'Inter',sans-serif;
  font-size:16px; background:var(--bg); color:var(--ink); resize:none; transition:border-color .2s ease;
}
.form-field input:focus, .form-field textarea:focus{ outline:none; border-color:var(--violet-bright); }

.checkout-actions{ margin-top:24px; display:flex; flex-direction:column; align-items:center; gap:14px; }
.checkout-actions .btn-primary{ width:100%; justify-content:center; }
.or-divider{ font-size:11.5px; color:var(--ink-soft); text-transform:uppercase; letter-spacing:0.06em; }
.btn-whatsapp-outline{
  width:100%; background:transparent; color:var(--ink); border:1.5px solid var(--lilac-line); padding:14px; border-radius:999px;
  font-size:13px; font-weight:500; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:9px;
  transition:all .2s ease;
}
.btn-whatsapp-outline svg{ flex-shrink:0; }
.btn-whatsapp-outline:hover{ border-color:#25D366; background:rgba(37,211,102,0.06); }
.payment-note{ font-size:11.5px; color:var(--ink-soft); text-align:center; margin-top:18px; line-height:1.6; padding:14px 16px; background:var(--lilac); border-radius:14px; }
.checkout-close{ background:var(--lilac); border:none; width:36px; height:36px; border-radius:50%; cursor:pointer; font-size:14px; color:var(--ink-soft); flex-shrink:0; transition:all .2s ease; }
.checkout-close:hover{ background:var(--violet); color:#fff; }

/* success view */
#checkoutSuccessView{ display:none; text-align:center; padding:44px 32px 36px; }
#checkoutSuccessView .success-icon{ width:60px; height:60px; border-radius:50%; background:var(--lilac); display:flex; align-items:center; justify-content:center; margin:0 auto 18px; font-size:26px; color:var(--violet); }
#checkoutSuccessView h3{ font-family:'Fraunces',serif; font-size:21px; margin-bottom:10px; }
#checkoutSuccessView p{ font-size:13.5px; color:var(--ink-soft); line-height:1.7; max-width:360px; margin:0 auto 22px; }
#checkoutSuccessView .btn-whatsapp-outline{ max-width:300px; margin:0 auto 14px; text-decoration:none; }

/* honeypot field (spam trap, hidden from real users) */
.hp-field{ position:absolute; left:-9999px; top:-9999px; }

/* ===== Product card two-action row (Add to Cart + Buy Now) — shared across shop.html and index.html ===== */
.shop-actions{ display:flex; gap:8px; margin-top:12px; }
.btn-outline-small{
  flex:1; background:transparent; color:var(--violet); border:1.5px solid var(--lilac-line); border-radius:999px;
  padding:10px 12px; font-size:12px; font-weight:500; cursor:pointer; transition:all .2s ease; white-space:nowrap; font-family:'Inter',sans-serif;
}
.btn-outline-small:hover{ border-color:var(--violet-bright); background:var(--lilac); }
.btn-buy-now{
  flex:1; background:var(--violet); color:#fff; border:none; border-radius:999px;
  padding:10px 12px; font-size:12px; font-weight:600; cursor:pointer; box-shadow:var(--shadow-sm);
  transition:all .2s ease; white-space:nowrap; font-family:'Inter',sans-serif;
}
.btn-buy-now:hover{ background:var(--violet-deep); transform:translateY(-1px); box-shadow:var(--shadow-md); }

@media (max-width: 640px){
  .form-row{ grid-template-columns:1fr; }
  .cart-drawer{ border-radius:20px 0 0 20px; }
  .checkout-layout{ grid-template-columns:1fr; }
  .checkout-summary-col{ position:static; order:2; margin-top:20px; padding-top:20px; border-top:1px solid var(--lilac-line); }
  .checkout-form-col{ order:1; }

  .checkout-modal{
    width:100vw; max-width:100vw; height:100dvh; max-height:100dvh;
    border-radius:0; top:0; left:0; transform:translateY(20px);
  }
  .checkout-modal.open{ transform:translateY(0); }
  .checkout-modal-head{ padding:20px 20px 16px; border-radius:0; }
  .checkout-modal-body{ padding:0 20px 24px; }
}
