/* =========================================================
   VELNAURA — CART DRAWER (standalone)

   Drop-in stylesheet for the cart drawer. Include this on any
   page that has the nav's #cartToggle button. Reuses the design
   tokens already defined in styles.css (--green, --cream-soft,
   --radius-lg, etc.) so styles.css must be loaded first — this
   file adds nothing to :root itself.

   cart.js injects the drawer's HTML at runtime; this file only
   styles the classes it injects.
========================================================= */

@supports (corner-shape:squircle){
  .cart-drawer,
  .cart-drawer-close,
  .cart-item-thumb,
  .cart-empty-thumb{
    corner-shape:squircle;
  }
}

/* =========================================================
   NAV CART BADGE

   A small pulsing gold dot on the nav cart icon, so the
   icon visibly asks to be clicked now that MugTea is
   pre-loaded in the cart. cart.css loads after styles.css,
   so the same-specificity selector here wins — no edit to
   styles.css needed.
========================================================= */

.nav-cart-dot{
  position:absolute;
  top:2px;
  right:2px;

  width:10px;
  height:10px;
  padding:0;

  /* JS flips this to flex when the cart has items. */
  display:none;

  align-items:center;
  justify-content:center;

  border-radius:50%;

  background:var(--gold);

  border:1.5px solid var(--nav-pill);

  /* Pulse on the dot itself, ping ring on the box-shadow.
     Both run off the same 2s cycle so they stay in sync. */
  animation:
    cartDotPulse 2s ease-in-out infinite,
    cartDotRing  2s ease-out    infinite;
}

@keyframes cartDotPulse{
  0%,100%{ transform:scale(1); }
  50%    { transform:scale(1.15); }
}

@keyframes cartDotRing{
  0%{
    box-shadow:0 0 0 0    rgba(245,197,24,.65);
  }
  75%,100%{
    box-shadow:0 0 0 6px  rgba(245,197,24,0);
  }
}

@media(prefers-reduced-motion:reduce){
  .nav-cart-dot{
    animation:none;
    box-shadow:none;
  }
}

@keyframes cartDotPulse{
  0%,100%{ transform:scale(1); }
  50%    { transform:scale(1.12); }
}

@keyframes cartDotRing{
  0%{
    box-shadow:0 0 0 0    rgba(245,197,24,.65);
  }
  75%,100%{
    box-shadow:0 0 0 8px  rgba(245,197,24,0);
  }
}

@media(prefers-reduced-motion:reduce){
  .nav-cart-dot{
    animation:none;
    box-shadow:none;
  }
}

/* ---- Overlay ----------------------------------------------------------- */

.cart-drawer-overlay{
  position:fixed;
  inset:0;
  z-index:600;

  background:rgba(16,35,26,.45);
  backdrop-filter:blur(2px);

  opacity:0;
  pointer-events:none;

  transition:opacity .35s ease;
}

.cart-drawer-overlay.open{
  opacity:1;
  pointer-events:auto;
}

/* ---- Shell -------------------------------------------------------------
   Column flex: a flexible scrolling body on top, and a fixed-height
   footer beneath it — so the checkout button is always visible. */

.cart-drawer{
  position:fixed;
  top:70px;
  right:30px;
  bottom:14px;
  z-index:601;

  width:min(440px,92vw);

  display:flex;
  flex-direction:column;

  border-radius:var(--radius-lg);

  background:var(--cream-soft);
  box-shadow:0 24px 60px -20px rgba(16,35,26,.35);

  overflow:hidden;

  transform:translateX(calc(100% + 44px));
  transition:transform .5s cubic-bezier(.16,.84,.24,1);
}

.cart-drawer.open{
  transform:translateX(0);
}

/* ---- Scrollable body --------------------------------------------------- */

.cart-drawer-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;

  scrollbar-width:thin;
  scrollbar-color:rgba(16,35,26,.2) transparent;
}

.cart-drawer-scroll::-webkit-scrollbar{ width:8px; }
.cart-drawer-scroll::-webkit-scrollbar-thumb{
  background:rgba(16,35,26,.16);
  border-radius:8px;
}
.cart-drawer-scroll::-webkit-scrollbar-track{ background:transparent; }

/* ---- Drawer head ------------------------------------------------------- */

.cart-drawer-head{
  display:flex;
  align-items:center;
  justify-content:space-between;

  padding:20px 22px 14px;
  border-bottom:1px solid var(--line);
}

.cart-drawer-head h2{
  font-family:'Fraunces',serif;
  font-weight:650;
  font-size:1.15rem;
  color:var(--ink);
}

.cart-drawer-close{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  width:38px;
  height:38px;
  flex:none;

  background:var(--sage-light);
  border:none;
  border-radius:50%;

  transition:transform .2s ease,background-color .2s ease;
}

.cart-drawer-close svg{
  width:16px;
  height:16px;
  stroke:var(--ink);
}

.cart-drawer-close:hover{
  background:var(--cream-deep);
  transform:rotate(90deg);
}

/* ---- Congrats banner (sky blue) --------------------------------------- */

.cart-congrats{
  background:#DCEBFA;
  padding:18px 22px 0;
  text-align:center;
}

.cart-congrats-line{
  display:block;
  white-space:nowrap;
  font-size:1rem;
  line-height:1.4;
  color:var(--ink);
  margin:0;
}

.cart-green{
  color:var(--green);
  font-family:'Fraunces',serif;
  font-style:italic;
  font-weight:700;
  font-size:1.08em;
}

.cart-congrats-rule{
  height:2px;
  background:var(--green);
  margin:12px -22px 0;
}

.cart-congrats-headline{
  display:block;
  width:100%;

  margin:0;
  padding:6px 20px;

  background:var(--green);
  color:#fff;

  text-align:center;

  font-family:'Plus Jakarta Sans',sans-serif;
  font-size:1.02rem;
  font-weight:800;
  letter-spacing:-.01em;
  line-height:1.3;
}

/* ---- Line items -------------------------------------------------------- */

.cart-drawer-items{
  padding:6px 22px 0;
}

.cart-item{
  display:grid;
  grid-template-columns:80px 1fr auto;
  gap:14px;
  align-items:flex-start;

  padding:18px 0;
  border-bottom:1px solid var(--line);

  transition:opacity .3s ease,transform .3s ease;
}

.cart-item.is-removing{
  opacity:0;
  transform:translateX(10px);
}

.cart-item-thumb{
  width:80px;
  height:80px;
  flex:none;

  border-radius:var(--radius-md);
  overflow:hidden;
  background:var(--sage-light);
}

.cart-item-thumb svg{
  width:100%;
  height:100%;
  display:block;
}

.cart-item-info{ min-width:0; }

.cart-item-name{
  font-weight:700;
  font-size:.92rem;
  color:var(--ink);
  margin-bottom:2px;
}

.cart-item-sub{
  font-size:.76rem;
  color:var(--ink-soft);
  margin-bottom:10px;
}

.cart-item-controls{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.cart-qty{
  display:inline-flex;
  align-items:center;
  border:1.5px solid var(--line);
  border-radius:999px;
  overflow:hidden;
  background:var(--cream-soft);
}

.cart-qty button{
  width:26px;
  height:26px;
  border:none;
  background:transparent;
  font-size:14px;
  color:var(--ink);
  display:flex;
  align-items:center;
  justify-content:center;
}

.cart-qty button:hover{ background:var(--cream-deep); }

.cart-qty span{
  width:24px;
  text-align:center;
  font-size:.82rem;
  font-weight:700;
}

.cart-item-remove{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  width:26px;
  height:26px;

  background:transparent;
  border:none;
  border-radius:50%;

  color:var(--ink-soft);
  padding:0;

  transition:
    color .2s ease,
    background-color .2s ease,
    transform .2s ease;
}

.cart-item-remove svg{
  width:15px;
  height:15px;
  stroke:currentColor;
}

.cart-item-remove:hover{
  color:var(--red, #D64545);
  background:rgba(214,69,69,.10);
  transform:scale(1.06);
}

.cart-item-price{
  font-weight:700;
  font-size:.92rem;
  color:var(--ink);
  white-space:nowrap;
}

/* ---- Empty state -------------------------------------------------------
   The block itself keeps the drawer's normal cream background — the
   only red element is the "Nothing scooped yet" heading, which is
   given a full-bleed red band via negative horizontal margins. */

.cart-drawer-empty{
  container-type:inline-size;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  text-align:center;

  padding:0 22px 34px;

  background:var(--cream-soft);
  color:var(--ink);
}

.cart-empty-title{
  align-self:stretch;

  margin:0 -22px 14px;
  padding:14px 22px;

  background:#D64545;
  color:#fff;

  font-family:'Fraunces',serif;
  font-weight:650;
  font-size:1.4rem;
  text-align:center;
}

.cart-empty-text{
  font-size:clamp(.62rem,3.6cqw,.88rem);
  line-height:1.35;
  white-space:nowrap;

  color:var(--ink);
}

.cart-empty-product{
  width:100%;
  max-width:330px;
  margin-top:18px;

  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;

  padding:22px 20px;

  border-radius:var(--radius-md);
  background:#fff;
  color:var(--ink);

  box-shadow:0 14px 32px -22px rgba(16,35,26,.45);
}

.cart-empty-thumb{
  width:140px;
  height:140px;

  border-radius:var(--radius-md);
  background:var(--sage-light);
  overflow:hidden;
}

.cart-empty-thumb svg{
  width:100%;
  height:100%;
  display:block;
}

.cart-empty-product-name{
  font-family:'Plus Jakarta Sans',sans-serif;
  font-weight:800;
  font-size:1rem;
  letter-spacing:-.01em;
  color:var(--ink);
  margin-top:4px;
}

.cart-empty-product-desc{
  font-size:.78rem;
  color:var(--ink-soft);
}

.cart-empty-product-price{
  margin-top:2px;

  font-weight:800;
  font-size:1.1rem;
  color:var(--ink);
}

.cart-empty-product .btn{
  margin-top:8px;
  width:100%;
}

/* ---- Empty-state links ------------------------------------------------- */

.cart-empty-links{
  display:flex;
  gap:24px;
  flex-wrap:wrap;
  justify-content:center;

  margin-top:18px;
}

.cart-empty-links a{
  color:var(--ink);
  font-weight:700;
  font-size:.86rem;

  text-decoration:underline;
  text-underline-offset:3px;

  transition:color .2s ease;
}

.cart-empty-links a:hover{
  color:var(--green-dark);
}

/* ---- White spacer band ------------------------------------------------- */

.cart-spacer{
  height:18px;
  background:#fff;
}

/* ---- Promo section (full bleed) --------------------------------------- */

.cart-promo{
  margin:18px 0;
  padding:22px 22px 20px;

  border-radius:0;

  background:#fff2cb;

  border-top:1px solid rgba(16,35,26,.08);
  border-bottom:1px solid rgba(16,35,26,.08);
}

.cart-promo h4{
  font-family:'Plus Jakarta Sans',sans-serif;
  font-size:.98rem;
  font-weight:800;
  letter-spacing:-.01em;

  color:var(--ink);
  margin-bottom:12px;
}

.cart-promo p{
  font-size:.83rem;
  line-height:1.55;
  color:var(--ink-soft);
}

.cart-promo p + p{
  margin-top:10px;
}

.cart-promo-footnote{
  margin-top:14px !important;

  font-size:.72rem !important;
  font-style:italic;

  color:var(--ink-soft);
  opacity:.82;
}

/* ---- Order summary ----------------------------------------------------- */

.cart-summary{
  padding:0 22px 20px;
}

.cart-summary h5{
  font-family:'Plus Jakarta Sans',sans-serif;
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;

  color:var(--ink-soft);
  margin-bottom:10px;
}

.cart-summary-row{
  display:flex;
  justify-content:space-between;
  align-items:baseline;

  padding:5px 0;

  font-size:.88rem;
  color:var(--ink-soft);
}

.cart-summary-row span:last-child{
  color:var(--ink);
  font-weight:600;
}

.cart-summary-row.total{
  margin-top:10px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

.cart-summary-row.total span:first-child{
  font-weight:800;
  color:var(--ink);
}

.cart-summary-row.total span:last-child{
  font-weight:800;
  font-size:1.25rem;
  color:var(--ink);
}

/* ---- Sticky footer ----------------------------------------------------- */

.cart-drawer-foot{
  flex:0 0 auto;

  border-top:1px solid var(--line);
  padding:14px 22px 16px;

  background:var(--cream-soft);

  box-shadow:0 -10px 24px -20px rgba(16,35,26,.35);
}

.cart-checkout-btn{
  width:100%;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;

  font-size:.96rem;
}

.cart-checkout-btn svg{
  width:15px;
  height:15px;
  flex-shrink:0;
}

.cart-checkout-btn:disabled{
  opacity:.5;
  cursor:not-allowed;
  box-shadow:none;
  transform:none;
}

/* ---- Trust row --------------------------------------------------------- */

.cart-trust-row{
  container-type:inline-size;

  display:flex;
  align-items:center;
  justify-content:center;

  gap:6px;
  margin-top:11px;
}

.cart-trust-item{
  flex:1 1 0;
  min-width:0;

  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:3px;

  white-space:nowrap;

  font-size:clamp(.5rem,2.6cqw,.68rem);
  line-height:1.2;

  color:var(--ink-soft);
}

.cart-trust-item svg{
  width:clamp(10px,2.4cqw,13px);
  height:clamp(10px,2.4cqw,13px);

  color:var(--green-dark);
  flex-shrink:0;
}

/* ---- State-driven visibility ------------------------------------------ */

.cart-drawer.is-empty .cart-congrats,
.cart-drawer.is-empty .cart-congrats-headline,
.cart-drawer.is-empty .cart-drawer-items,
.cart-drawer.is-empty .cart-spacer,
.cart-drawer.is-empty .cart-promo,
.cart-drawer.is-empty .cart-summary{
  display:none;
}

.cart-drawer:not(.is-empty) .cart-drawer-empty{
  display:none;
}

/* ---- Responsive -------------------------------------------------------- */

@media(max-width:520px){

  .cart-drawer{
    top:64px;
    right:14px;
    bottom:8px;

    width:calc(100vw - 28px);
    border-radius:var(--radius-md);
  }

  .cart-drawer-head{ padding:16px 18px 12px; }

  .cart-congrats{ padding:16px 18px 0; }
  .cart-congrats-rule{ margin-left:-18px; margin-right:-18px; }
  .cart-congrats-headline{ padding:5px 16px; font-size:.96rem; }

  .cart-drawer-items{ padding:4px 18px 0; }

  .cart-item{
    grid-template-columns:72px 1fr auto;
    gap:12px;
    padding:16px 0;
  }

  .cart-item-thumb{ width:72px; height:72px; }

  .cart-spacer{ height:14px; }

  .cart-promo{ margin:14px 0; padding:18px 18px 16px; }

  .cart-summary{ padding:0 18px 16px; }

  .cart-drawer-foot{ padding:12px 18px 14px; }

  .cart-drawer-empty{ padding:0 18px 30px; }

  .cart-empty-title{
    margin-left:-18px;
    margin-right:-18px;
    padding:12px 18px;
    font-size:1.25rem;
  }

  .cart-empty-product{ padding:18px 16px; }
  .cart-empty-thumb{ width:120px; height:120px; }
}