/* ==========================================================================
   LE BENIC — cart drawer (all pages)

   Slides in from the right over a quiet dark veil (no blur behind it). Warm
   near-black with a trace of botanical green and earth; warm ivory type in the
   site's own faces (Instrument Serif, Jost); a restrained bronze edge on the
   one strong action, CHECKOUT.
   ========================================================================== */

.lb-cart {
  --ivory: #ece4d6;
  --ivory-soft: rgb(236 228 214 / 0.66);
  --ivory-quiet: rgb(236 228 214 / 0.44);
  --line: rgb(236 228 214 / 0.09);
  --bronze: rgb(190 146 92 / 0.55);
  --ease-drawer: cubic-bezier(0.22, 0.61, 0.24, 1);
  position: fixed;
  inset: 0;
  z-index: 120;                 /* above the header (100) and its menu (99) */
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 0.9s;
}
.lb-cart.is-open {
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s;
}

/* the page behind settles and recedes a little */
.lb-cart__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 90% at 30% 50%, rgb(6 6 5 / 0.5), rgb(6 6 5 / 0.72)),
    rgb(6 6 5 / 0.1);
  opacity: 0;
  transition: opacity 0.8s var(--ease-drawer);
}
.lb-cart.is-open .lb-cart__veil { opacity: 1; }

/* the drawer */
.lb-cart__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(440px, 100vw);
  color: var(--ivory);
  background:
    radial-gradient(ellipse 90% 45% at 100% 100%, rgb(26 30 20 / 0.55), rgb(26 30 20 / 0) 70%),
    radial-gradient(ellipse 80% 40% at 0% 0%, rgb(34 26 19 / 0.45), rgb(34 26 19 / 0) 70%),
    #0d0c0a;
  box-shadow: -1px 0 0 rgb(236 228 214 / 0.06), -40px 0 90px rgb(0 0 0 / 0.45);
  transform: translate3d(100%, 0, 0);
  transition: transform 0.9s var(--ease-drawer);
  overscroll-behavior: contain;
}
.lb-cart.is-open .lb-cart__panel { transform: none; }

/* contents follow the panel in, a breath later */
.lb-cart__head,
.lb-cart__body,
.lb-cart__foot {
  opacity: 0;
  transform: translate3d(14px, 0, 0);
  transition: opacity 0.7s var(--ease-drawer), transform 0.9s var(--ease-drawer);
}
.lb-cart.is-open .lb-cart__head,
.lb-cart.is-open .lb-cart__body,
.lb-cart.is-open .lb-cart__foot { opacity: 1; transform: none; }
.lb-cart.is-open .lb-cart__head { transition-delay: 0.18s; }
.lb-cart.is-open .lb-cart__body { transition-delay: 0.26s; }
.lb-cart.is-open .lb-cart__foot { transition-delay: 0.34s; }

/* ---------------------------------------------------------------- top */
.lb-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(28px, 4.4vh, 40px) clamp(28px, 3.2vw, 40px) clamp(22px, 3.4vh, 30px);
  border-bottom: 1px solid var(--line);
}
.lb-cart__title {
  margin: 0;
  font-family: var(--font-nav);
  font-weight: 400;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ivory);
}
.lb-cart__count {
  margin-left: 0.9em;
  letter-spacing: 0.06em;
  color: var(--ivory-quiet);
}
.lb-cart__close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -10px -12px -10px 0;
  color: var(--ivory-soft);
  transition: color 0.6s var(--ease-drawer);
}
.lb-cart__close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; }
.lb-cart__close:hover,
.lb-cart__close:focus-visible { color: var(--ivory); }

/* ---------------------------------------------------------------- lines */
.lb-cart__body {
  flex: 1;
  overflow-y: auto;
  padding: clamp(26px, 4vh, 38px) clamp(28px, 3.2vw, 40px);
}
.lb-cart__lines { margin: 0; padding: 0; list-style: none; }
.lb-cart__line {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  align-items: start;
}
.lb-cart__line + .lb-cart__line { margin-top: 30px; padding-top: 30px; border-top: 1px solid var(--line); }
.lb-cart__media {
  position: relative;
  display: grid;
  place-items: end center;
  height: 128px;
  margin: 0;
}
/* the bottle stands on a whisper of shadow */
.lb-cart__media::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 120%;
  height: 10px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0));
}
.lb-cart__media img { position: relative; z-index: 1; height: 124px; width: auto; max-width: none; }

.lb-cart__detail { display: flex; flex-direction: column; min-height: 128px; }
.lb-cart__row { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.lb-cart__name {
  margin: 0;
  font-family: var(--font-nav);
  font-weight: 400;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ivory);
}
.lb-cart__size {
  margin: 0.35rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--ivory-soft);
}
.lb-cart__price {
  flex: none;
  font-family: var(--font-nav);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ivory-soft);
  white-space: nowrap;
}
.lb-cart__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 18px;
}

/* − 1 + */
.lb-cart__qty {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-nav);
  color: var(--ivory);
}
.lb-cart__qty button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgb(236 228 214 / 0.2);
  color: var(--ivory-soft);
  transition: box-shadow 0.6s var(--ease-drawer), color 0.6s var(--ease-drawer), opacity 0.4s;
}
.lb-cart__qty svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; }
.lb-cart__qty button:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--bronze); color: var(--ivory); }
.lb-cart__qty button:disabled { opacity: 0.32; cursor: default; }
.lb-cart__qty output {
  min-width: 2.2ch;
  font-size: 13px;
  letter-spacing: 0.12em;
  margin-right: -0.12em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* quiet text links: remove, continue */
.lb-cart__textlink {
  position: relative;
  padding: 6px 0 4px;
  font-family: var(--font-nav);
  font-weight: 400;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ivory-quiet);
  transition: color 0.6s var(--ease-drawer);
}
.lb-cart__textlink::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0.24em;
  bottom: 0;
  height: 1px;
  background: var(--bronze);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.8s var(--ease-drawer);
}
.lb-cart__textlink:hover,
.lb-cart__textlink:focus-visible { color: var(--ivory); }
.lb-cart__textlink:hover::after,
.lb-cart__textlink:focus-visible::after { transform: scaleX(1); }

/* ---------------------------------------------------------------- bottom */
.lb-cart__foot {
  padding: clamp(22px, 3.4vh, 30px) clamp(28px, 3.2vw, 40px) calc(env(safe-area-inset-bottom, 0px) + clamp(26px, 4vh, 38px));
  border-top: 1px solid var(--line);
}
.lb-cart__subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0;
}
.lb-cart__subtotal-label {
  font-family: var(--font-nav);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ivory-soft);
}
.lb-cart__subtotal-value {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ivory);
}
.lb-cart__note {
  margin: 0.7rem 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ivory-quiet);
}

/* CHECKOUT — the one strong action: warm lacquer, near-white type, a fine bronze edge */
.lb-cart__checkout {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  margin-top: clamp(20px, 3vh, 28px);
  border-radius: 999px;
  background: linear-gradient(180deg, #1a150f 0%, #0e0c09 60%, #13100c 100%);
  box-shadow: inset 0 0 0 1px rgb(190 146 92 / 0.62), 0 14px 34px rgb(0 0 0 / 0.35);
  font-family: var(--font-nav);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: #f8f6f1;
  transition: box-shadow 0.7s var(--ease-drawer), background-color 0.7s var(--ease-drawer);
}
.lb-cart__checkout span { margin-right: -0.34em; transition: translate 0.8s var(--ease-drawer); }
.lb-cart__checkout:hover,
.lb-cart__checkout:focus-visible {
  background: linear-gradient(180deg, #221b13 0%, #120f0b 60%, #18140f 100%);
  box-shadow: inset 0 0 0 1px rgb(214 172 112 / 0.9), 0 14px 34px rgb(0 0 0 / 0.35);
}
.lb-cart__checkout:hover span { translate: 3px 0; }
.lb-cart__checkout:focus-visible { outline-offset: 4px; }

/* ---------------------------------------------------------------- empty */
.lb-cart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  min-height: 100%;
  padding-bottom: 8vh;
  text-align: center;
}
.lb-cart__empty p {
  margin: 0;
  max-width: 18rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.55rem;
  line-height: 1.2;
  color: var(--ivory-soft);
}
.lb-cart__continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 32px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgb(236 228 214 / 0.26);
  font-family: var(--font-nav);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ivory);
  transition: box-shadow 0.7s var(--ease-drawer);
}
.lb-cart__continue span { margin-right: -0.3em; }
.lb-cart__continue:hover,
.lb-cart__continue:focus-visible { box-shadow: inset 0 0 0 1px var(--bronze); }
.lb-cart[data-state="empty"] .lb-cart__foot,
.lb-cart[data-state="empty"] .lb-cart__lines,
.lb-cart[data-state="filled"] .lb-cart__empty { display: none; }

/* ---------------------------------------------------------------- phones */
@media (max-width: 760px) {
  .lb-cart__panel { width: 100vw; }
  .lb-cart__head { padding: calc(env(safe-area-inset-top, 0px) + 22px) 22px 18px; }
  .lb-cart__body { padding: 28px 22px; }
  .lb-cart__foot { padding: 20px 22px calc(env(safe-area-inset-bottom, 0px) + 22px); }
  .lb-cart__close { width: 48px; height: 48px; margin-right: -14px; }
  .lb-cart__line { grid-template-columns: 58px 1fr; gap: 18px; }
  .lb-cart__qty { gap: 14px; }
  .lb-cart__qty button { width: 44px; height: 44px; }
  .lb-cart__qty output { font-size: 15px; }
  .lb-cart__textlink { padding: 12px 0 8px; font-size: 11px; }
  .lb-cart__checkout { min-height: 60px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .lb-cart__panel, .lb-cart__veil, .lb-cart__head, .lb-cart__body, .lb-cart__foot { transition-duration: 0.01s; transition-delay: 0s !important; }
}
