/* =====================================================================
   ALBAN — Cart & buying flow (2026-10-28)
   Drawer, /quote-list/ cart page, configurator purchase panel, mobile buy bar.
   Built only on the theme tokens (tokens.css), so light and dark both work.
   ===================================================================== */

/* ---------- header pill ---------- */
.cart-pill { gap: 7px; }
.cart-pill svg { width: 16px; height: 16px; flex: none; }
.cart-pill .qcount { transition: transform var(--dur-2) var(--ease-spring); }
.cart-pill.is-bumped .qcount { transform: scale(1.25); }
/* desktop: an empty cart still shows the bag (the theme hid an empty Quote List pill) */
@media (max-width: 1120px) { .quote-pill.cart-pill:has(.qcount[hidden]) { display: inline-flex; } }

/* phones/tablets: cart button beside the menu (shown wherever the hamburger is) */
.cart-mobile {
  display: none; position: relative; place-items: center;
  width: 44px; height: 44px; margin-right: 4px; border-radius: var(--r-pill);
  color: var(--heading); text-decoration: none;
  transition: background var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.cart-mobile:hover { background: var(--tint-gold-weak); }
.cart-mobile:active { transform: scale(0.94); }
.cart-mobile svg { width: 22px; height: 22px; }
.cart-mobile .qcount { position: absolute; top: 3px; right: 1px; }
@media (max-width: 1240px) { .cart-mobile { display: inline-grid; } }
.nav-mobile-cta { white-space: nowrap; }
@media (max-width: 400px) { .nav-mobile-cta { padding: 9px 13px !important; } .cart-mobile { margin-right: 0; } }
@media (max-width: 1279px) { body.lang-de .cart-mobile, body.lang-fr .cart-mobile { display: inline-grid; } }

/* ---------- drawer ---------- */
html.ac-lock, html.ac-lock body { overflow: hidden; }
.ac-drawer[hidden], .ac-overlay[hidden] { display: none; }
.ac-overlay {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: rgba(8, 10, 16, 0.42);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 0.3s var(--ease-out);
}
.ac-overlay.is-open { opacity: 1; }
.ac-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-drawer);
  width: min(440px, 100vw);
  display: flex; flex-direction: column;
  background: var(--drawer-bg);
  border-left: 1px solid var(--hairline);
  box-shadow: -24px 0 80px rgba(8, 10, 16, 0.18);
  transform: translateX(104%);
  transition: transform 0.38s var(--ease-out);
  color: var(--text);
}
.ac-drawer.is-open { transform: none; }
.ac-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-5) var(--s-5) var(--s-4);
  border-bottom: 1px solid var(--hairline);
}
.ac-title { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-xl); color: var(--heading); letter-spacing: var(--ls-display); }
.ac-close {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline); background: transparent; color: var(--heading);
  font-size: 22px; line-height: 1; cursor: pointer;
  transition: border-color var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.ac-close:hover { border-color: var(--hairline-strong); }
.ac-close:active { transform: scale(0.94); }
.ac-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--s-4) var(--s-5) var(--s-6); }

/* ---------- shared cart content ---------- */
.ac-body, .ac-page { font-variant-numeric: tabular-nums; }
.ac-notice { min-height: 0; margin: 0 0 var(--s-3); font-size: var(--fs-sm); color: var(--heading); }
.ac-notice:empty { display: none; }
.ac-notice:not(:empty) {
  padding: var(--s-3) var(--s-4); border-radius: var(--r-sm);
  background: var(--tint-gold-weak); border: 1px solid var(--hairline);
  animation: ac-in 0.35s var(--ease-out);
}
@keyframes ac-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ac-muted { color: var(--muted); font-size: var(--fs-xs); }

.ac-capacity { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-2) 0 var(--s-4); }
.ac-meter { display: inline-flex; gap: 4px; }
.ac-meter__seg { width: 22px; height: 4px; border-radius: 4px; background: var(--hairline-strong); transition: background var(--dur-3) var(--ease-out); }
.ac-meter__seg.is-on { background: var(--accent-2); }

.ac-lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.ac-line {
  display: grid; grid-template-columns: 84px 1fr auto; gap: var(--s-4); align-items: start;
  padding: var(--s-4) 0; border-bottom: 1px solid var(--hairline);
  animation: ac-in 0.35s var(--ease-out);
}
.ac-line__img { display: block; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; }
.ac-line__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-line__name { display: block; color: var(--heading); font-weight: var(--fw-semibold); font-size: var(--fs-sm); text-decoration: none; }
.ac-line__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.ac-line__opts { margin: 2px 0 var(--s-3); color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; }
.ac-line__price { margin: 0; color: var(--heading); font-weight: var(--fw-semibold); font-size: var(--fs-sm); white-space: nowrap; }
.ac-qty { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.ac-qty__btn {
  width: 32px; height: 32px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline-strong); background: transparent; color: var(--heading);
  font-size: 16px; line-height: 1; cursor: pointer;
  transition: border-color var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.ac-qty__btn:hover:not(:disabled) { border-color: var(--accent-2); background: var(--tint-gold-weak); }
.ac-qty__btn:active:not(:disabled) { transform: scale(0.92); }
.ac-qty__btn:disabled { opacity: 0.35; cursor: not-allowed; }
.ac-qty__n { min-width: 1.5em; text-align: center; color: var(--heading); font-weight: var(--fw-semibold); }
.ac-line__remove {
  margin-left: var(--s-2); padding: 4px 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: var(--fs-xs); text-decoration: underline; text-underline-offset: 3px;
}
.ac-line__remove:hover { color: var(--heading); }

.ac-field { margin-top: var(--s-5); }
.ac-label { display: block; margin-bottom: var(--s-2); font-size: var(--fs-2xs); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--muted); font-weight: var(--fw-semibold); }
.ac-select {
  width: 100%; min-height: 48px; padding: 0 var(--s-9) 0 var(--s-4);
  border: 1px solid var(--hairline-strong); border-radius: var(--r-sm);
  background-color: var(--bg-elevated); color: var(--heading); font: inherit; font-size: var(--fs-sm);
}

.ac-receipt { margin: var(--s-5) 0 0; padding: var(--s-4) 0 0; border-top: 1px dashed var(--hairline-strong); }
.ac-receipt > div { display: flex; justify-content: space-between; gap: var(--s-4); padding: 5px 0; font-size: var(--fs-sm); }
.ac-receipt dt { color: var(--muted); }
.ac-receipt dd { margin: 0; color: var(--heading); text-align: right; }
.ac-receipt__total { margin-top: var(--s-2); padding-top: var(--s-3) !important; border-top: 1px solid var(--hairline); }
.ac-receipt__total dt { color: var(--heading); font-weight: var(--fw-semibold); }
.ac-receipt__total dd { font-family: var(--font-display); font-size: var(--fs-xl); letter-spacing: var(--ls-display); }
.ac-fine { margin: var(--s-2) 0 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.6; }
.ac-warn { margin: var(--s-4) 0 0; font-size: var(--fs-sm); color: var(--heading); }

.ac-cta { display: flex !important; justify-content: center; width: 100%; margin-top: var(--s-5); text-align: center; }
.ac-cta:active { transform: translateY(1px) scale(0.99); }
.ac-cta.is-disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

.ac-trust { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; gap: 6px; }
.ac-trust li { position: relative; padding-left: 22px; font-size: var(--fs-xs); color: var(--text); line-height: 1.55; }
.ac-trust li::before {
  content: ''; position: absolute; left: 2px; top: 0.42em; width: 10px; height: 6px;
  border-left: 1.5px solid var(--accent-2); border-bottom: 1.5px solid var(--accent-2); transform: rotate(-45deg);
}
.ac-details { margin-top: var(--s-5); border-top: 1px solid var(--hairline); padding-top: var(--s-3); font-size: var(--fs-xs); color: var(--muted); }
.ac-details summary { cursor: pointer; color: var(--heading); font-weight: var(--fw-semibold); font-size: var(--fs-sm); padding: 4px 0; }
.ac-details p { margin: var(--s-2) 0 0; line-height: 1.65; }
.ac-details a, .ac-quote-link { color: var(--accent-2); }
.ac-quote-link { display: inline-block; margin-top: var(--s-5); font-size: var(--fs-xs); text-underline-offset: 3px; }

.ac-empty { padding: var(--s-4) 0; }
.ac-empty__title { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--heading); margin: 0 0 var(--s-2); }
.ac-empty__picks { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-5); }
.ac-pick {
  display: flex; flex-direction: column; gap: 4px; padding: var(--s-3);
  border: 1px solid var(--hairline); border-radius: var(--r-md); text-decoration: none; background: var(--surface-2);
  transition: border-color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.ac-pick:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.ac-pick img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-xs); }
.ac-pick__name { color: var(--heading); font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.ac-pick__from { color: var(--muted); font-size: var(--fs-xs); }

/* ---------- full-page cart (/quote-list/) ---------- */
.ac-page { max-width: 640px; }
.ac-page .ac-lines { margin-top: var(--s-2); }
@media (min-width: 900px) { .ac-page .ac-line { grid-template-columns: 120px 1fr auto; } }

/* ---------- configurator purchase panel ---------- */
@media (min-width: 900px) {
  .configurator .split--top > aside.panel { position: sticky; top: calc(var(--header-h) + var(--s-5)); }
}
.radio-card { transition: border-color var(--dur-2) var(--ease-standard), background var(--dur-2) var(--ease-standard), transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.radio-card:hover { transform: translateY(-1px); }
.radio-card:has(input:checked) { box-shadow: 0 0 0 1px var(--accent-2) inset; }
.radio-card:has(input:checked)::after,
.radio-card.is-checked::after {
  content: ''; position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
  animation: ac-in 0.25s var(--ease-out);
}
.buy-online .price strong, .price strong { font-variant-numeric: tabular-nums; }
.buy-online__actions { display: grid; gap: var(--s-3); margin-top: var(--s-5); }
.buy-online__actions .cta-pill { justify-content: center; width: 100%; }
.buy-online__actions .cta-pill:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.buy-online__now { justify-self: center; font-size: var(--fs-xs); color: var(--accent-2); text-underline-offset: 3px; }
.buy-online__now[hidden] { display: none; }
.buy-online__msg { margin: var(--s-3) 0 0; font-size: var(--fs-xs); color: var(--heading); }
.buy-online__msg:empty { display: none; }
.buy-online__details { margin-top: var(--s-4); font-size: var(--fs-xs); color: var(--muted); line-height: 1.65; }
.buy-online__details summary { cursor: pointer; color: var(--heading); font-weight: var(--fw-semibold); }
.buy-online__details p { margin: var(--s-2) 0 0; }
.buy-online__details a { text-decoration: underline; }

/* ---------- mobile buy bar ---------- */
.ac-buybar { display: none; }
@media (max-width: 899px) {
  .ac-buybar {
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 44;
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
    padding: 10px 10px 10px 18px; border-radius: var(--r-pill);
    background: var(--header-bg); border: 1px solid var(--hairline-strong);
    backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
    box-shadow: var(--shadow-md);
    transform: translateY(140%); opacity: 0; pointer-events: none;
    transition: transform 0.4s var(--ease-out), opacity 0.3s var(--ease-out);
  }
  .ac-buybar.is-on { transform: none; opacity: 1; pointer-events: auto; }
  .ac-buybar__txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
  .ac-buybar__name { color: var(--heading); font-weight: var(--fw-semibold); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ac-buybar__price { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
  .ac-buybar__btn { flex: none; }
  /* keep the "Questions? Ask ALBAN" launcher clear of the bar */
  html.ac-has-bar #alban-buying-guide, html.ac-has-bar [data-alban-guide] { bottom: 92px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .ac-drawer, .ac-overlay, .ac-buybar, .ac-line, .ac-notice, .radio-card { transition: none !important; animation: none !important; }
}
