/* Suppress Blocksy's legacy cart drawer — we use #taula-cart-flyout instead */
#taula-cart-drawer { display: none !important; }

/* ==========================================================================
   TAULA — Block CART-1: Cart Flyout Panel
   Global component — all pages.

   Structure:
   - .taula-cart            — fixed overlay container (hidden by default)
   - .taula-cart__backdrop  — semi-transparent click-to-close layer
   - .taula-cart__panel     — 380px right-side slide-in panel
   ========================================================================== */

/* ── Container (fixed overlay) ─────────────────────────────────────────── */
.taula-cart {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none; /* off by default — turned on when open */
}

.taula-cart.is-open {
  pointer-events: auto;
}

/* ── Backdrop ───────────────────────────────────────────────────────────── */
.taula-cart__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.taula-cart.is-open .taula-cart__backdrop {
  opacity: 1;
}

/* ── Panel ──────────────────────────────────────────────────────────────── */
.taula-cart__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  overflow: hidden; /* children handle their own scroll */
}

.taula-cart.is-open .taula-cart__panel {
  transform: translateX(0);
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.taula-cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 18px;
  flex: 0 0 auto;
}

.taula-cart__heading {
  font-family: var(--font-heading); /* Staatliches */
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #000;
  margin: 0;
  line-height: 1;
}

.taula-cart__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #000;
  padding: 0;
  transition: opacity 0.2s ease;
}

.taula-cart__close:hover {
  opacity: 0.5;
}

/* ── Horizontal rules ───────────────────────────────────────────────────── */
.taula-cart__rule {
  margin: 0;
  border: none;
  border-top: 1px solid #000;
  flex: 0 0 auto;
}

/* ── Column headers ─────────────────────────────────────────────────────── */
.taula-cart__col-headers {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  flex: 0 0 auto;
}

.taula-cart__col-product,
.taula-cart__col-subtotal {
  font-family: var(--font-body); /* Geist */
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000;
}

/* ── Scrollable body (items + warning) ──────────────────────────────────── */
.taula-cart__body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Subtle scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

.taula-cart__body::-webkit-scrollbar {
  width: 4px;
}

.taula-cart__body::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

/* ── Empty state ────────────────────────────────────────────────────────── */
.taula-cart__empty {
  padding: 40px 24px;
  font-family: var(--font-body);
  font-size: 14px;
  color: #666;
  text-align: center;
  margin: 0;
}

/* ── Cart item ──────────────────────────────────────────────────────────── */
.taula-cart__item {
  padding: 16px 24px 14px;
}

/* Top row: image + name + line price */
.taula-cart__item-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.taula-cart__item-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  object-position: center;
  flex: 0 0 56px;
  display: block;
}

.taula-cart__item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.taula-cart__item-name {
  font-family: var(--font-heading); /* Staatliches */
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #000;
  line-height: 1.1;
  display: block;
}

.taula-cart__item-price {
  font-family: var(--font-body); /* Geist */
  font-size: 14px;
  font-weight: 500;
  color: #000;
  display: block;
  text-align: right;
}

/* Bottom row: qty controls + remove */
.taula-cart__item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Quantity control group */
.taula-cart__qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.taula-cart__units-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000;
}

.taula-cart__qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid #000;
  cursor: pointer;
  font-size: 9px;
  color: #000;
  padding: 0;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.taula-cart__qty-btn:hover {
  background: #000;
  color: #fff;
}

.taula-cart__qty-value {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: #000;
  min-width: 20px;
  text-align: center;
}

/* Remove link */
.taula-cart__remove {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #999;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.taula-cart__remove:hover {
  color: #000;
}

/* Rule below each item */
.taula-cart__item-rule {
  margin: 0;
  border: none;
  border-top: 1px solid #e0e0e0;
}

/* ── Min-order warning ──────────────────────────────────────────────────── */
.taula-cart__min-warning {
  margin: 12px 24px 4px;
  padding: 10px 14px;
  background: rgba(224, 33, 29, 0.08);
  border-left: 3px solid #e0211d;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: #e0211d;
  line-height: 1.4;
}

/* Hidden by default — JS toggles */
.taula-cart__min-warning[hidden] {
  display: none;
}

/* ── Fixed footer ───────────────────────────────────────────────────────── */
.taula-cart__footer {
  flex: 0 0 auto;
  padding: 0 24px 28px;
  background: #ffffff;
}

/* Shipping note */
.taula-cart__shipping {
  font-family: var(--font-body);
  font-size: 11px;
  color: #888;
  margin: 14px 0 12px;
  line-height: 1.4;
}

/* Subtotal row */
.taula-cart__subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0 14px;
}

.taula-cart__subtotal-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #000;
}

.taula-cart__subtotal-price {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

/* Checkout button */
.taula-cart__checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  background: #000;
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  box-sizing: border-box;
}

.taula-cart__checkout-btn:hover:not(.taula-cart__checkout-btn--disabled) {
  background: #333;
}

/* Disabled state — min-order not met */
.taula-cart__checkout-btn--disabled {
  background: #ccc;
  color: #888;
  cursor: not-allowed;
  pointer-events: none; /* belt + suspenders — JS also prevents */
}

/* ── Body scroll lock — applied to <body> when flyout is open ───────────── */
body.taula-cart-open {
  overflow: hidden;
}

/* ── CSS-driven language switching ──────────────────────────────────────── */
.taula-cart__lang {
  display: none;
}

html[data-taula-lang="CA"] .taula-cart__lang[data-lang="CA"],
html[data-taula-lang="ES"] .taula-cart__lang[data-lang="ES"],
html[data-taula-lang="EN"] .taula-cart__lang[data-lang="EN"] {
  display: inline;
}

html:not([data-taula-lang]) .taula-cart__lang[data-lang="EN"],
html[data-taula-lang=""] .taula-cart__lang[data-lang="EN"] {
  display: inline;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .taula-cart__panel {
    width: 100vw;
  }
}
