/* Cart drawer + Stripe checkout dialog (Section 11 e-commerce build).
   Loaded on every page via sections/cart/cart-drawer.ejs. Colors/radii match
   the site's existing gold-on-near-black identity (see assets/css/vars.css). */

/* ---------- Drawer (right-side, per confirmed decision) ---------- */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.35s;
}

.cart-drawer-overlay.active {
  visibility: visible;
  pointer-events: auto;
}

.cart-drawer-dimmer {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.cart-drawer-overlay.active .cart-drawer-dimmer {
  opacity: 1;
}

.cart-drawer-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 90%;
  max-width: 420px;
  height: 100%;
  background: #0d0a04;
  display: flex;
  flex-direction: column;
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.8);
  border-left: 1px solid rgba(220, 169, 89, 0.2);
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer-overlay.active .cart-drawer-panel {
  right: 0;
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-drawer-header h3 {
  color: #fff;
  margin: 0;
  font-size: 1.2rem;
}

.cart-drawer-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart-empty-msg {
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin-top: 40px;
}

.cart-lines {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-line {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.cart-line-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.cart-line-title {
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
}

.cart-line-category {
  display: inline-block;
  color: #dca959;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.cart-line-price {
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.cart-line-quote {
  color: #dca959;
  font-size: 0.82rem;
  font-style: italic;
}

.cart-line-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.cart-qty-value {
  color: #fff;
  min-width: 20px;
  text-align: center;
  font-size: 0.88rem;
}

.cart-remove-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.cart-remove-btn:hover {
  color: #dca959;
}

.cart-drawer-footer {
  padding: 18px 24px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.88rem;
  padding: 4px 0;
}

/* Author styles beat the UA default [hidden]{display:none} at equal
   specificity by source order — without this override, a hidden deposit/
   balance row would still render at $0.00 instead of disappearing (see the
   identical class of bug fixed in sections/header/header.css). */
.cart-summary-row[hidden] {
  display: none;
}

.cart-summary-row.cart-summary-total {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 6px;
  padding-top: 10px;
}

.cart-summary-row.cart-summary-deposit span:last-child,
.cart-summary-row.cart-summary-balance span:last-child {
  color: #dca959;
}

.cart-quote-note {
  color: #dca959;
  font-size: 0.82rem;
  margin: 10px 0;
  line-height: 1.5;
}

.cart-pay-btn {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border-radius: 999px;
}

/* ---------- Checkout dialog (in-page, no redirect) ---------- */
.cv-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100000;
  font-family: inherit;
}

.cv-modal.active {
  display: block;
}

.cv-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.cv-modal-panel {
  position: relative;
  max-width: 440px;
  width: 90%;
  margin: 8vh auto;
  max-height: 82vh;
  overflow-y: auto;
  background: #0d0a04;
  color: #fff;
  padding: 30px;
  border-radius: 16px;
  border: 1px solid rgba(220, 169, 89, 0.2);
}

.cv-modal-panel h3 {
  margin: 0 0 18px;
  color: #dca959;
}

.checkout-dialog-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.checkout-field {
  display: block;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  margin-bottom: 14px;
}

.checkout-field input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #16110a;
  color: #fff;
  font-size: 0.95rem;
}

#payment-element {
  margin-bottom: 18px;
}

.checkout-submit-btn,
#checkoutContinueBtn {
  width: 100%;
  border-radius: 999px;
  padding: 14px;
}

.checkout-error {
  color: #ff8a8a;
  font-size: 0.85rem;
  margin: 10px 0 0;
}

.checkout-success-msg {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

#checkoutCloseBtn {
  width: 100%;
  margin-top: 14px;
  border-radius: 999px;
  padding: 12px;
}

.checkout-field textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #16110a;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.checkout-field[hidden],
.cart-line-options[hidden] {
  display: none;
}

.checkout-success-title {
  color: #dca959;
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.cart-line-options {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
  line-height: 1.45;
}

.cart-qty-static {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
}

/* Toast — visible feedback when an add-to-cart or cart action fails */
.cv-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  max-width: min(90vw, 420px);
  padding: 12px 20px;
  border-radius: 999px;
  background: #16110a;
  color: #fff;
  border: 1px solid rgba(224, 185, 115, 0.4);
  font-size: 0.88rem;
  text-align: center;
  z-index: 100001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cv-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.cv-toast-error {
  border-color: rgba(255, 138, 138, 0.6);
}

/* Custom calendar pickers (car-book, catering-book, meal-book, private-dinner):
   days that aren't bookable (past, or before the paired start date). */
.calendar-day.disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: line-through;
}

.cv-modal-panel .checkout-quote-summary {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(220, 169, 89, 0.08);
  border: 1px solid rgba(220, 169, 89, 0.25);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.55;
}

.checkout-quote-summary span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
}

.checkout-quote-summary[hidden] {
  display: none;
}
