/* Alteco inquiry cart — icon, badge, drawer, toast.
   Uses the design tokens from the rest of the site (--gold, --cream, etc.)
   if present; otherwise falls back to safe defaults. */

#alteco-cart-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: 0.9rem;
  background: transparent;
  border: 1px solid rgba(184,157,94,0.32);
  border-radius: 50%;
  color: var(--gold, #b89d5e);
  cursor: pointer;
  outline: none;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.16,1,0.3,1);
}
#alteco-cart-icon:hover { background: var(--gold, #b89d5e); color: #fff; border-color: var(--gold, #b89d5e); }
#alteco-cart-icon svg { width: 18px; height: 18px; display: block; }
#alteco-cart-icon.flash { animation: altecoCartFlash 0.5s ease; }
@keyframes altecoCartFlash {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); box-shadow: 0 0 0 6px rgba(184,157,94,0.18); }
  100% { transform: scale(1); }
}

#alteco-cart-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--gold, #b89d5e);
  color: #fff;
  border-radius: 9px;
  font: 600 0.62rem/1 'Outfit', sans-serif;
  letter-spacing: 0.04em;
  border: 2px solid var(--cream, #faf7f0);
  pointer-events: none;
}

/* Drawer overlay */
#alteco-cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  overflow: hidden; /* clip the off-screen (closed) panel so it can't add page width on mobile */
}
#alteco-cart-drawer.open { pointer-events: auto; }

.alteco-cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30,30,30,0);
  transition: background 0.4s ease;
  pointer-events: none;
}
#alteco-cart-drawer.open .alteco-cart-backdrop {
  background: rgba(30,30,30,0.42);
  pointer-events: auto;
}

.alteco-cart-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(92vw, 400px);
  background: var(--cream, #faf7f0);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.16,1,0.3,1);
  box-shadow: -10px 0 40px rgba(0,0,0,0.12);
}
#alteco-cart-drawer.open .alteco-cart-panel { transform: translateX(0); }

.alteco-cart-head {
  position: relative;
  padding: 1.6rem 1.6rem 1.2rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.alteco-cart-eyebrow {
  display: block;
  font: 500 0.58rem/1 'Outfit', sans-serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold, #b89d5e);
  margin-bottom: 0.6rem;
}
.alteco-cart-title {
  font: 300 1.6rem/1.15 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--text-dark, #2a2724);
  margin: 0;
}
.alteco-cart-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  color: var(--text-mid, #7a7268);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.alteco-cart-close:hover { color: var(--gold, #b89d5e); }

.alteco-cart-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.9rem 0;
}
.alteco-cart-empty {
  padding: 2.5rem 1.6rem;
  font: 300 0.85rem/1.7 'Outfit', sans-serif;
  color: var(--text-mid, #7a7268);
  font-style: italic;
}
.alteco-cart-empty em { font-weight: 400; color: var(--text-dark, #2a2724); font-style: italic; }

.alteco-cart-list { display: flex; flex-direction: column; }

.alteco-cart-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.6rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  position: relative;
}
.alteco-cart-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.alteco-cart-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.alteco-cart-thumb-empty { background: var(--off-white, #f8f5ef); }
/* Composite thumbnail: stack each configurator layer (handle / lock / vent / shadow) so
   the cart preview mirrors what was visible on the detail page. Each layer's exact
   rect (top/left/width/height) is set inline as a % of the thumb — see renderDrawer
   in alteco-cart.js. object-fit: fill makes the PNG stretch to that rect, matching how
   the configurator stretches each layer on the detail page. */
.alteco-cart-thumb-composite { position: relative; background: #fff; }
.alteco-cart-thumb-composite .alteco-cart-thumb-layer {
  position: absolute;
  object-fit: fill;
  display: block;
  pointer-events: none;
}

.alteco-cart-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.alteco-cart-brand {
  font: 500 0.55rem/1 'Outfit', sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold, #b89d5e);
}
.alteco-cart-name {
  font: 400 1rem/1.25 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--text-dark, #2a2724);
}
.alteco-cart-spec {
  font: 300 0.72rem/1.4 'Outfit', sans-serif;
  color: var(--text-mid, #7a7268);
}
.alteco-cart-qty {
  margin-top: 0.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  background: #fff;
  width: fit-content;
  height: 26px;
  overflow: hidden;
}
.alteco-cart-qty-btn {
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  color: var(--text-dark, #2a2724);
  font: 400 1rem/1 'Outfit', sans-serif;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.alteco-cart-qty-btn:hover { background: var(--gold, #b89d5e); color: #fff; }
.alteco-cart-qty-num {
  min-width: 24px;
  padding: 0 0.35rem;
  text-align: center;
  font: 500 0.78rem/1 'Outfit', sans-serif;
  color: var(--text-dark, #2a2724);
  user-select: none;
}
.alteco-cart-remove {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.1);
  color: var(--text-mid, #7a7268);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  border-radius: 50%;
  transition: all 0.2s;
}
.alteco-cart-remove:hover { background: var(--gold, #b89d5e); color: #fff; border-color: var(--gold, #b89d5e); }

/* Per-item price line — shown when an item carries a numeric `price`. */
.alteco-cart-price {
  font: 500 0.82rem/1.2 'Outfit', sans-serif;
  color: var(--text-dark, #2a2724);
  margin-top: 0.4rem;
  font-variant-numeric: tabular-nums;
}
.alteco-cart-price-quote {
  font-style: italic;
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid, #7a7268);
}

/* Totals row above the foot buttons. Inserted dynamically by alteco-cart.js when at
   least one cart item carries a price (or any are quote-on-request). */
.alteco-cart-totals {
  flex: 0 0 auto;
  padding: 0.9rem 1.6rem 0.6rem;
  background: var(--off-white, #f8f5ef);
  border-top: 1px solid rgba(0,0,0,0.06);
}
.alteco-cart-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font: 400 0.85rem/1.4 'Outfit', sans-serif;
  color: var(--text-body, #4a4540);
  margin-bottom: 0.45rem;
}
.alteco-cart-totals-row span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text-dark, #2a2724);
}
.alteco-cart-totals-grand {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  font-size: 0.95rem;
  color: var(--text-dark, #2a2724);
}
.alteco-cart-totals-grand span:last-child {
  font: 400 1.25rem/1 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--gold, #b89d5e);
  letter-spacing: 0.01em;
}
.alteco-cart-totals-quote {
  font: 400 0.7rem/1.4 'Outfit', sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid, #7a7268);
  font-style: italic;
  margin-bottom: 0.45rem;
}

.alteco-cart-foot {
  flex: 0 0 auto;
  display: flex;
  gap: 0.6rem;
  padding: 1rem 1.6rem 1.4rem;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: var(--off-white, #f8f5ef);
}
/* When totals are present they own the top border; remove the foot's redundant border. */
#alteco-cart-totals + .alteco-cart-foot { border-top: none; padding-top: 0.4rem; }
.alteco-cart-send,
.alteco-cart-clear {
  font: 500 0.7rem/1 'Outfit', sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.95rem 1.1rem;
  outline: none;
  transition: all 0.3s;
}
.alteco-cart-send {
  flex: 1 1 auto;
  background: var(--gold, #b89d5e);
  color: #fff;
  border: 1px solid var(--gold, #b89d5e);
}
.alteco-cart-send:hover:not(:disabled) { background: #9a8245; border-color: #9a8245; }
.alteco-cart-send:disabled { opacity: 0.45; cursor: not-allowed; }
.alteco-cart-clear {
  flex: 0 0 auto;
  background: transparent;
  color: var(--text-mid, #7a7268);
  border: 1px solid rgba(0,0,0,0.12);
}
.alteco-cart-clear:hover:not(:disabled) { color: var(--gold, #b89d5e); border-color: var(--gold, #b89d5e); }
.alteco-cart-clear:disabled { opacity: 0.45; cursor: not-allowed; }

/* Toast */
#alteco-cart-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9100;
  padding: 0.75rem 1.4rem;
  background: var(--charcoal, #1e1e1e);
  color: #fff;
  font: 400 0.78rem/1.3 'Outfit', sans-serif;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.16,1,0.3,1);
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
#alteco-cart-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

body.alteco-cart-open { overflow: hidden; }
