/* ── MATCHA GIRLIE — cart.css ── */
/* Cart sidebar, checkout modal, order confirmation, toast notifications */

/* ══════════════════════════════════════════════════════
   CART OVERLAY
══════════════════════════════════════════════════════ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 40, 10, 0.55);
  backdrop-filter: blur(3px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.cart-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ══════════════════════════════════════════════════════
   CART SIDEBAR
══════════════════════════════════════════════════════ */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100dvh;
  background: #FDFAF5;
  z-index: 201;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 48px rgba(45, 80, 22, 0.18);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 1px solid #E8E0D0;
}

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

/* Header */
.cart-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid #EDE5D5;
  background: #FFFFFF;
  flex-shrink: 0;
}

.cart-sidebar__header h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1E2A14;
}

.cart-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #F0E8D8;
  color: #4A5240;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  line-height: 1;
}

.cart-close-btn:hover {
  background: #4A7C2F;
  color: #FFFFFF;
  transform: rotate(90deg);
}

/* Items list */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
}

.cart-items::-webkit-scrollbar { width: 4px; }
.cart-items::-webkit-scrollbar-track { background: transparent; }
.cart-items::-webkit-scrollbar-thumb { background: #C8E6A0; border-radius: 4px; }

/* Empty state */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 280px;
  text-align: center;
  padding: 40px 24px;
  color: #7A8570;
}

.cart-empty__icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.cart-empty p {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #4A5240;
  margin-bottom: 6px;
}

.cart-empty span {
  font-size: 0.85rem;
  color: #7A8570;
}

/* Cart item row */
.cart-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  background: #FFFFFF;
  border-radius: 14px;
  margin-bottom: 10px;
  border: 1px solid #EDE5D5;
  transition: box-shadow 0.2s, transform 0.2s;
  animation: cartItemIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cartItemIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

.cart-item:hover {
  box-shadow: 0 4px 16px rgba(45, 80, 22, 0.1);
}

.cart-item__img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #EEF7E4;
}

.cart-item__info {
  flex: 1;
  min-width: 0;
}

.cart-item__name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1E2A14;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item__price {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4A7C2F;
  margin-bottom: 10px;
}

/* Quantity controls */
.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #C8E6A0;
  background: #EEF7E4;
  color: #2D5016;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  line-height: 1;
}

.qty-btn:hover {
  background: #4A7C2F;
  border-color: #4A7C2F;
  color: #FFFFFF;
  transform: scale(1.1);
}

.qty-btn:active { transform: scale(0.95); }

.qty-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1E2A14;
  min-width: 20px;
  text-align: center;
}

/* Remove button */
.cart-item__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #C4956A;
  font-size: 1.1rem;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.cart-item__remove:hover {
  color: #e53e3e;
  background: #FFF5F5;
}

/* Footer */
.cart-sidebar__footer {
  padding: 20px 24px;
  border-top: 1px solid #EDE5D5;
  background: #FFFFFF;
  flex-shrink: 0;
}

.cart-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed #EDE5D5;
}

.cart-total-row span:first-child {
  font-size: 0.875rem;
  font-weight: 600;
  color: #7A8570;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#cartTotal {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #4A7C2F;
}

#checkoutBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ══════════════════════════════════════════════════════
   MODAL OVERLAY
══════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 40, 10, 0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ══════════════════════════════════════════════════════
   MODAL BASE
══════════════════════════════════════════════════════ */
.modal {
  background: #FFFFFF;
  border-radius: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(20, 40, 10, 0.25);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-thumb { background: #C8E6A0; border-radius: 4px; }

/* Modal header */
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid #EDE5D5;
  position: sticky;
  top: 0;
  background: #FFFFFF;
  z-index: 1;
}

.modal__header h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #1E2A14;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #F0E8D8;
  color: #4A5240;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.modal-close:hover {
  background: #4A7C2F;
  color: #FFFFFF;
  transform: rotate(90deg);
}

/* Modal body */
.modal__body {
  padding: 24px 28px 32px;
}

/* ══════════════════════════════════════════════════════
   CHECKOUT MODAL
══════════════════════════════════════════════════════ */

/* Order summary in checkout */
.checkout-summary {
  background: #F5F0E8;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 24px;
  border: 1px solid #EDE5D5;
}

.checkout-summary__title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7A8570;
  margin-bottom: 12px;
}

.checkout-summary__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #4A5240;
  padding: 5px 0;
  border-bottom: 1px solid #EDE5D5;
}

.checkout-summary__item:last-of-type {
  border-bottom: none;
}

.checkout-summary__item span:last-child {
  font-weight: 600;
  color: #1E2A14;
}

.checkout-summary__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 2px solid #C8E6A0;
}

.checkout-summary__total span:first-child {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7A8570;
}

.checkout-summary__total span:last-child {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #4A7C2F;
}

/* Form section title */
.form-section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1E2A14;
  margin-bottom: 18px;
}

/* Form groups */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4A5240;
  margin-bottom: 7px;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #E0D8C8;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.9rem;
  color: #1E2A14;
  background: #FDFAF5;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #B0A898;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #4A7C2F;
  box-shadow: 0 0 0 3px rgba(74, 124, 47, 0.12);
  background: #FFFFFF;
}

.form-group input.error,
.form-group textarea.error {
  border-color: #e53e3e;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.form-error-msg {
  font-size: 0.75rem;
  color: #e53e3e;
  margin-top: 5px;
  display: none;
}

.form-group.has-error .form-error-msg { display: block; }

/* ══════════════════════════════════════════════════════
   ORDER CONFIRMATION MODAL
══════════════════════════════════════════════════════ */
.confirm-modal {
  text-align: center;
  padding: 48px 36px;
}

.confirm-modal__icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: confirmBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes confirmBounce {
  from { transform: scale(0) rotate(-20deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

.confirm-modal h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #1E2A14;
  margin-bottom: 12px;
}

.confirm-modal__sub {
  font-size: 1rem;
  color: #4A5240;
  margin-bottom: 24px;
  line-height: 1.6;
}

.confirm-modal__id {
  display: inline-block;
  background: #EEF7E4;
  border: 1px solid #C8E6A0;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 0.875rem;
  color: #2D5016;
  margin-bottom: 12px;
  font-weight: 500;
}

.confirm-modal__id strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: #4A7C2F;
}

.confirm-modal__total {
  font-size: 1rem;
  color: #4A5240;
  margin-bottom: 16px;
  font-weight: 500;
}

.confirm-modal__total strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #4A7C2F;
}

.confirm-modal__note {
  font-size: 0.875rem;
  color: #7A8570;
  margin-bottom: 28px;
  font-style: italic;
}

/* ══════════════════════════════════════════════════════
   TOAST NOTIFICATION
══════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  background: #2D5016;
  color: #FFFFFF;
  border-radius: 999px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(20, 40, 10, 0.3);
  white-space: nowrap;
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: all;
}

.toast.toast--out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(10px) scale(0.9); }
}

.toast__icon { font-size: 1rem; }

/* ══════════════════════════════════════════════════════
   ADD TO CART BUTTON FEEDBACK
══════════════════════════════════════════════════════ */
.add-to-cart-btn.added {
  background: #2D5016;
  animation: addedPulse 0.4s ease;
}

@keyframes addedPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.92); }
  70%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Cart badge update animation */
.cart-badge.bump {
  animation: badgeBump 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgeBump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* ══════════════════════════════════════════════════════
   ORDER CARDS (rendered by cart.js into #orderStatusList)
══════════════════════════════════════════════════════ */
.no-orders {
  text-align: center;
  padding: 60px 24px;
  color: #7A8570;
  font-size: 1rem;
}

.order-card {
  background: #FDFAF5;
  border: 1px solid #EDE5D5;
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 2px 12px rgba(45,80,22,.06);
  transition: box-shadow 0.25s;
}

.order-card:hover {
  box-shadow: 0 8px 28px rgba(45,80,22,.12);
}

.order-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.order-card__id {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.order-id-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7A8570;
}

.order-card__id strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1E2A14;
}

.order-card__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--status-color, #f59e0b) 15%, white);
  border: 1.5px solid color-mix(in srgb, var(--status-color, #f59e0b) 40%, white);
}

.status-icon { font-size: 0.9rem; }

.status-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--status-color, #f59e0b);
}

/* Progress steps */
.order-card__progress {
  margin-bottom: 18px;
}

.progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.progress-step span {
  font-size: 0.7rem;
  font-weight: 600;
  color: #B0A898;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.progress-step.done span { color: #4A7C2F; }

.step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #E0D8C8;
  border: 2px solid #C8BFB0;
  transition: background 0.3s, border-color 0.3s;
}

.progress-step.done .step-dot {
  background: #4A7C2F;
  border-color: #4A7C2F;
  box-shadow: 0 0 0 3px rgba(74,124,47,.15);
}

.progress-line {
  flex: 1;
  height: 2px;
  background: #E0D8C8;
  margin: 0 4px;
  margin-bottom: 22px;
  transition: background 0.3s;
}

.progress-line.done { background: #4A7C2F; }

/* Order body */
.order-card__body {
  margin-bottom: 16px;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 12px;
}

.order-meta span {
  font-size: 0.8rem;
  color: #4A5240;
}

.order-items-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.order-item-tag {
  display: inline-block;
  padding: 4px 12px;
  background: #EEF7E4;
  border: 1px solid #C8E6A0;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2D5016;
}

/* Order footer */
.order-card__footer {
  padding-top: 14px;
  border-top: 1px solid #EDE5D5;
  display: flex;
  justify-content: flex-end;
}

.order-total {
  font-size: 0.875rem;
  color: #4A5240;
}

.order-total strong {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #4A7C2F;
}

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .cart-sidebar {
    width: 100vw;
    border-radius: 20px 20px 0 0;
    top: auto;
    bottom: 0;
    height: 92dvh;
    transform: translateY(100%);
    border-left: none;
    border-top: 1px solid #EDE5D5;
    box-shadow: 0 -8px 48px rgba(45, 80, 22, 0.18);
  }

  .cart-sidebar.open {
    transform: translateY(0);
  }

  .modal {
    border-radius: 20px 20px 0 0;
    max-height: 95dvh;
    margin-top: auto;
    align-self: flex-end;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .confirm-modal {
    padding: 36px 24px;
  }

  .modal__body {
    padding: 20px 20px 28px;
  }

  .modal__header {
    padding: 20px 20px 16px;
  }

  .toast {
    font-size: 0.8rem;
    padding: 10px 18px;
  }
}