/* =========================================================================
   FreshPen, slide-in cart drawer (2026-07-21 redesign).
   Silver-accent design language: metallic chips and icon tiles, black CTA.
   Markup: inc/cart-drawer.php. Behaviour: assets/js/cart-drawer.js.
   ========================================================================= */

:root{
  --fp-ink:#09090b;
  --fp-paper:#fff;
  --fp-surface:#fafafa;
  --fp-line:#e4e4e7;
  --fp-muted:#71717a;
  --fp-silver:#c7c9ce;
  --fp-silver-light:#e9eaee;
  --fp-silver-deep:#8e9096;
  --fp-silver-metal:linear-gradient(135deg,#f4f4f6 0%,#d9dadf 30%,#b9bbc2 50%,#e6e7eb 70%,#c2c4ca 100%);
}

/* ---- Overlay ---- */
.fp-cartdw-overlay{
  position:fixed;
  inset:0;
  background:rgba(9,9,11,.45);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease;
  z-index:9998;
}
.fp-cartdw-overlay.is-open{
  opacity:1;
  pointer-events:auto;
}

/* ---- Panel ---- */
.fp-cartdw{
  position:fixed;
  top:0;
  right:0;
  height:100%;
  height:100dvh;
  width:min(420px,100vw);
  background:var(--fp-paper);
  z-index:9999;
  display:flex;
  flex-direction:column;
  transform:translateX(105%);
  transition:transform .3s cubic-bezier(.22,.61,.36,1),box-shadow .3s ease;
  visibility:hidden;
  box-shadow:none;
  font-family:var(--font,'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif);
  color:var(--fp-ink);
}
.fp-cartdw::before{
  content:'';
  display:block;
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:3px;
  background:var(--fp-silver-metal);
  z-index:1;
}
.fp-cartdw.is-open{
  transform:translateX(0);
  visibility:visible;
  box-shadow:-28px 0 64px rgba(9,9,11,.22);
}
/* keep the panel focusable/visible during the slide-out transition */
.fp-cartdw.is-closing{visibility:visible;}

@media (prefers-reduced-motion:reduce){
  .fp-cartdw,
  .fp-cartdw-overlay{transition:none;}
}

/* ---- Top bar (static, outside the refreshable fragment) ---- */
.fp-cartdw__top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:18px 20px 14px;
  border-bottom:1px solid var(--fp-line);
  flex:none;
}
.fp-cartdw__title{
  margin:0;
  font-size:18px;
  font-weight:800;
  letter-spacing:-.02em;
}
.fp-cartdw__close{
  width:40px;
  height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--fp-line);
  border-radius:10px;
  background:var(--fp-paper);
  color:var(--fp-ink);
  cursor:pointer;
  transition:border-color .18s ease,background .18s ease;
}
.fp-cartdw__close:hover{
  border-color:var(--fp-silver);
  background:var(--fp-surface);
}
.fp-cartdw-ic{
  width:16px;
  height:16px;
  display:block;
}

/* ---- Refreshable content ---- */
.fp-cartdw__content{
  flex:1;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  min-height:0;
  transition:opacity .18s ease;
}
.fp-cartdw__content.is-busy{
  opacity:.5;
  pointer-events:none;
}

.fp-cartdw__count{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  padding:14px 20px 6px;
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.14em;
  color:var(--fp-muted);
}
.fp-cartdw__count-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:7px;
  background:var(--fp-silver-metal);
  border:1px solid var(--fp-silver);
  color:var(--fp-ink);
  font-size:12px;
  font-weight:800;
  letter-spacing:0;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}

/* ---- Line items ---- */
.fp-cartdw__items{
  list-style:none;
  margin:0;
  padding:4px 20px 12px;
}
.fp-cartdw-item{
  position:relative;
  display:grid;
  grid-template-columns:64px minmax(0,1fr);
  gap:14px;
  padding:14px 0;
  border-bottom:1px dashed var(--fp-line);
}
.fp-cartdw-item:last-child{border-bottom:none;}
.fp-cartdw-item__thumb{
  width:64px;
  height:64px;
  border-radius:12px;
  border:1px solid var(--fp-line);
  background:var(--fp-surface);
  overflow:hidden;
  display:block;
}
.fp-cartdw-item__thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.fp-cartdw-item__info{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
.fp-cartdw-item__name{
  font-size:14px;
  font-weight:700;
  line-height:1.3;
  padding-right:34px;
}
.fp-cartdw-item__meta{
  font-size:12px;
  color:var(--fp-muted);
  line-height:1.4;
}
.fp-cartdw-item__meta dl.variation{margin:0;display:block;}
.fp-cartdw-item__meta dl.variation dt,
.fp-cartdw-item__meta dl.variation dd{
  display:inline;
  margin:0;
  font-weight:500;
}
.fp-cartdw-item__meta dl.variation dd p{display:inline;margin:0;}
.fp-cartdw-item__row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px 10px;
  margin-top:6px;
  /* Let price wrap to its own line on very narrow screens (<=~340px, e.g.
     320px iPhone SE) instead of squeezing the qty stepper below its
     40x40 tap target -- flex-shrink on .fp-cartdw-qty would otherwise
     silently shrink the +/- buttons back down under the accessible
     minimum whenever the row runs out of horizontal room. */
  flex-wrap:wrap;
}
.fp-cartdw-item__price{
  font-size:13.5px;
  font-weight:700;
  white-space:nowrap;
  margin-left:auto;
}
.fp-cartdw-item__price .woocommerce-Price-amount{font-weight:700;}
.fp-cartdw-item__remove{
  position:absolute;
  top:11px;
  right:0;
  width:32px;
  height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:none;
  border-radius:50%;
  background:transparent;
  color:var(--fp-muted);
  cursor:pointer;
  transition:color .18s ease,background .18s ease;
}
.fp-cartdw-item__remove:hover{
  color:var(--fp-ink);
  background:var(--fp-silver-light);
}
.fp-cartdw-item__remove .fp-cartdw-ic{
  width:14px;
  height:14px;
}

/* ---- Quantity stepper ----
   Buttons sized 40x40 (up from an earlier 30x30) so +/- is a comfortable
   thumb target on mobile -- 30px sits noticeably under the ~40-44px minimum
   tap target guidance (Apple HIG / Material / WCAG 2.5.5 Target Size). */
.fp-cartdw-qty{
  display:inline-flex;
  align-items:center;
  flex:none;
  border:1px solid var(--fp-line);
  border-radius:999px;
  overflow:hidden;
  transition:border-color .18s ease;
}
.fp-cartdw-qty:hover{border-color:var(--fp-silver-deep);}
.fp-cartdw-qty__btn{
  width:40px;
  height:40px;
  border:none;
  background:transparent;
  color:var(--fp-ink);
  font-size:17px;
  font-weight:600;
  line-height:1;
  cursor:pointer;
  transition:background .15s ease;
}
.fp-cartdw-qty__btn:hover{background:var(--fp-silver-light);}
.fp-cartdw-qty__val{
  min-width:28px;
  text-align:center;
  font-size:13px;
  font-weight:700;
}

/* ---- Footer ---- */
.fp-cartdw__footer{
  margin-top:auto;
  flex:none;
  border-top:1px solid var(--fp-line);
  background:var(--fp-paper);
  padding:16px 20px 18px;
}
.fp-cartdw__subtotal{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.fp-cartdw__subtotal-label{
  font-size:11px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.14em;
  color:var(--fp-muted);
  padding-top:4px;
}
.fp-cartdw__subtotal-value{
  text-align:right;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:2px;
}
.fp-cartdw__subtotal-value strong{
  font-size:17px;
  font-weight:800;
  letter-spacing:-.02em;
}
.fp-cartdw__discount{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-top:8px;padding-top:8px;border-top:1px dashed var(--fp-line);}
.fp-cartdw__discount-label{display:flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;color:var(--fp-ink);}
.fp-cartdw__discount-label .fp-cartdw-ic{width:13px;height:13px;color:var(--fp-silver-deep);flex:none;}
.fp-cartdw__discount-remove{border:none;background:none;padding:2px;margin-left:2px;color:var(--fp-muted);cursor:pointer;display:flex;}
.fp-cartdw__discount-remove .fp-cartdw-ic{width:12px;height:12px;}
.fp-cartdw__discount-remove:hover{color:var(--fp-ink);}
.fp-cartdw__discount-value{font-size:12.5px;font-weight:700;color:var(--fp-ink);white-space:nowrap;display:flex;flex-direction:column;align-items:flex-end;gap:2px;}
.fp-cartdw__discount-value .fp-usd-est{font-size:11px;font-weight:600;}
.fp-cartdw__coupon{display:flex;gap:8px;margin-top:12px;}
.fp-cartdw__coupon-field{flex:1;display:flex;align-items:center;gap:8px;height:40px;padding:0 12px;border:1px solid var(--fp-line);border-radius:9999px;background:var(--fp-surface);transition:border-color .15s;}
.fp-cartdw__coupon-field:focus-within{border-color:var(--fp-ink);}
.fp-cartdw__coupon-field .fp-cartdw-ic{width:14px;height:14px;color:var(--fp-muted);flex:none;}
.fp-cartdw__coupon-field input{flex:1;border:none;background:none;outline:none;font-size:13px;color:var(--fp-ink);min-width:0;}
.fp-cartdw__coupon-field input::placeholder{color:var(--fp-muted);}
.fp-cartdw__coupon-apply{flex:none;height:40px;padding:0 18px;border:none;border-radius:9999px;background:var(--fp-ink);color:#fff;font-size:12.5px;font-weight:700;cursor:pointer;transition:opacity .15s;}
.fp-cartdw__coupon-apply:hover{opacity:.85;}
.fp-cartdw__coupon-msg{margin:8px 0 0;font-size:12px;line-height:1.4;padding:8px 10px;border-radius:8px;}
.fp-cartdw__coupon-msg.is-error{background:#fdecec;color:#a3231f;}
.fp-cartdw__coupon-msg.is-success{background:#eef7ef;color:#1f7a3f;}
/* Final Total row (2026-07-25): the amount the customer actually pays
   (subtotal minus all discounts) -- the largest, boldest figure in the
   footer, sitting just above the note + Checkout button so it's the last
   thing read before checking out. Re-renders with the drawer fragment on
   every qty/coupon change. */
.fp-cartdw__total{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-top:12px;padding-top:12px;border-top:1px solid var(--fp-line);}
.fp-cartdw__total-label{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.12em;color:var(--fp-ink);padding-top:6px;}
.fp-cartdw__total-value{text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:2px;}
.fp-cartdw__total-value strong{font-size:20px;font-weight:800;letter-spacing:-.02em;color:var(--fp-ink);}
/* Clearer USD estimates across the whole footer (subtotal / discount / total):
   darker than the muted default so the "≈ $X USD" lines are easily readable. */
.fp-cartdw__footer .fp-usd-est{color:#52525b;font-weight:600;}
.fp-cartdw__total-value .fp-usd-est{font-size:12px;}
.fp-cartdw__note{
  margin:8px 0 14px;
  font-size:12px;
  color:var(--fp-muted);
  line-height:1.5;
}
.fp-cartdw__checkout{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  width:100%;
  height:52px;
  border-radius:12px;
  background:var(--fp-ink);
  color:#fff;
  font-size:15px;
  font-weight:700;
  text-decoration:none;
  transition:opacity .18s ease,transform .18s ease;
}
.fp-cartdw__checkout:hover{
  opacity:.9;
  color:#fff;
  transform:translateY(-1px);
}
.fp-cartdw__checkout .fp-cartdw-ic{
  width:16px;
  height:16px;
}
.fp-cartdw__viewcart{
  display:block;
  text-align:center;
  margin:12px 0 0;
  font-size:13px;
  font-weight:600;
  color:var(--fp-muted);
  text-decoration:underline;
  text-underline-offset:3px;
  transition:color .18s ease;
}
.fp-cartdw__viewcart:hover{color:var(--fp-ink);}

/* ---- Trust row ---- */
.fp-cartdw__trust{
  list-style:none;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin:16px 0 0;
  padding:14px 0 0;
  border-top:1px solid var(--fp-line);
}
.fp-cartdw__trust li{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  text-align:center;
  font-size:10.5px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--fp-muted);
  line-height:1.35;
}
.fp-cartdw__trust-ic{
  width:30px;
  height:30px;
  border-radius:9px;
  background:var(--fp-silver-metal);
  border:1px solid var(--fp-silver);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--fp-ink);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
}
.fp-cartdw__trust-ic .fp-cartdw-ic{
  width:15px;
  height:15px;
}

/* ---- Empty state ---- */
.fp-cartdw__empty{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:40px 28px;
}
.fp-cartdw__empty-art{
  width:84px;
  height:84px;
  margin-bottom:18px;
}
.fp-cartdw__empty-title{
  margin:0 0 6px;
  font-size:16px;
  font-weight:800;
  letter-spacing:-.02em;
}
.fp-cartdw__empty-sub{
  margin:0 0 22px;
  font-size:13.5px;
  color:var(--fp-muted);
  line-height:1.55;
  max-width:260px;
}
.fp-cartdw__browse{max-width:240px;padding:0 26px;}

/* ---- Body lock while open ---- */
body.fp-cartdw-open{overflow:hidden;}

@media (max-width:480px){
  .fp-cartdw{width:100vw;}
}
