/* ==========================================================================
   ETERNAL SUNDARI — Slide-Out Luxury Cart Drawer Styles
   ========================================================================== */

/* Backdrop Overlay */
.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 30, 28, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.cart-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* Off-canvas Drawer Container */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: var(--color-bg);
  z-index: 1210;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer.open {
  transform: translateX(0);
}

/* Drawer Header */
.cart-drawer-header {
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(212, 175, 106, 0.2);
  background: var(--color-white);
}

.cart-drawer-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cart-drawer-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-emerald);
  margin: 0;
}

.cart-drawer-count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.cart-drawer-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.cart-drawer-close:hover {
  color: var(--color-emerald);
  transform: scale(1.1);
}

/* Free Shipping Progress Bar */
.cart-shipping-bar {
  padding: 14px 24px;
  background: var(--color-bg-alt);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cart-shipping-msg {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-shipping-msg strong {
  color: var(--color-emerald);
}

.cart-shipping-track {
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.cart-shipping-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold-deep), var(--color-emerald));
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Alert Box for Inventory Validation Errors */
.cart-drawer-alert {
  margin: 14px 24px 0;
  padding: 12px 14px;
  background: #FFF5F5;
  border-left: 3px solid #E53E3E;
  border-radius: 4px;
  color: #C53030;
  font-size: 0.82rem;
  line-height: 1.4;
  display: none;
}

.cart-drawer-alert.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* Items List Viewport */
.cart-drawer-items {
  flex-grow: 1;
  overflow-y: auto;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Single Cart Item Card */
.cart-item {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cart-item-img {
  width: 74px;
  height: 98px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item-name {
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
  margin: 0;
}

.cart-item-name a:hover {
  color: var(--color-emerald);
}

.cart-item-variant {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.cart-item-pricing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.cart-item-price {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-emerald);
}

.cart-item-compare-price {
  font-size: 0.8rem;
  color: var(--color-text-light);
  text-decoration: line-through;
}

/* Quantity Stepper inside Cart Item */
.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.cart-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 6px;
  background: var(--color-white);
  height: 28px;
}

.cart-stepper-btn {
  width: 26px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.cart-stepper-btn:hover {
  background: var(--color-bg-alt);
  color: var(--color-emerald);
}

.cart-stepper-qty {
  width: 28px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--color-text-light);
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.cart-item-remove:hover {
  color: #E53E3E;
}

/* Empty State */
.cart-empty-state {
  margin: auto;
  text-align: center;
  padding: 40px 20px;
}

.cart-empty-state svg {
  width: 48px;
  height: 48px;
  stroke: var(--color-gold);
  stroke-width: 1.5;
  fill: none;
  margin-bottom: 16px;
}

.cart-empty-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-emerald);
  margin-bottom: 8px;
}

.cart-empty-sub {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.btn-cart-empty-explore {
  display: inline-block;
  background: var(--color-emerald);
  color: var(--color-white);
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.2s ease;
}

.btn-cart-empty-explore:hover {
  background: var(--color-teal);
}

/* Drawer Footer */
.cart-drawer-footer {
  padding: 20px 24px;
  background: var(--color-white);
  border-top: 1px solid rgba(212, 175, 106, 0.2);
}

.cart-savings-banner {
  background: rgba(0, 95, 91, 0.08);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-emerald);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.cart-subtotal-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
}

.cart-subtotal-amount {
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-emerald);
}

.cart-tax-notice {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.btn-cart-checkout {
  width: 100%;
  background: var(--color-emerald);
  color: var(--color-white);
  border: none;
  border-radius: 8px;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 95, 91, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-cart-checkout:hover:not(:disabled) {
  background: var(--color-teal);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 95, 91, 0.35);
}

.btn-cart-checkout:disabled {
  background: #bbb;
  cursor: not-allowed;
  box-shadow: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile Breakpoints (320px - 480px) */
@media (max-width: 480px) {
  .cart-drawer {
    max-width: 100vw;
  }

  .cart-drawer-header,
  .cart-shipping-bar,
  .cart-drawer-items,
  .cart-drawer-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .cart-drawer-alert {
    margin-left: 16px;
    margin-right: 16px;
  }

  .cart-item {
    grid-template-columns: 64px 1fr;
    gap: 12px;
  }

  .cart-item-img {
    width: 64px;
    height: 86px;
  }

  .cart-item-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .btn-cart-checkout {
    padding: 13px 16px;
    font-size: 0.85rem;
  }
}
