/**
 * Checkout Styles
 * Gramado Wine - Consistent with account.css dark theme
 */

:root {
  --color-marsala: #64242E;
  --color-marsala-dark: #2D2A29;
  --color-sand: #F1CC98;
  --color-black: #0f0f0f;
  --color-dark-grey: #1a1a1a;
  --bg-dark: #121212;
  --bg-card: #1E1E1E;
  --border-gold: rgba(241, 204, 152, 0.2);
  --font-heading: 'Oranienbaum', serif;
  --font-body: 'Inter', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: radial-gradient(circle at center, #1a0f10 0%, #000000 100%);
  color: #f8f9fa;
  line-height: 1.6;
  min-height: 100vh;
}

/* Container */
.checkout-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Header */
.checkout-header {
  text-align: center;
  margin-bottom: 50px;
  border-bottom: 1px solid var(--border-gold);
  padding-bottom: 30px;
}

.header-content {
  max-width: 600px;
  margin: 0 auto;
}

.checkout-header .logo {
  max-width: 200px;
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px rgba(241, 204, 152, 0.2));
}

.checkout-header h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--color-sand);
  font-weight: 400;
}

/* Progress Steps */
.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 50px;
  position: relative;
}

.progress-steps::before {
  content: '';
  position: absolute;
  top: 25px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 0;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.step-number {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #121212;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 12px;
  transition: all 0.3s;
  position: relative;
  z-index: 3;
}

.step.active .step-number {
  border-color: var(--color-sand);
  color: var(--color-sand);
  box-shadow: 0 0 15px rgba(241, 204, 152, 0.2);
}

.step.completed .step-number {
  border-color: var(--color-sand);
  color: var(--color-sand);
}

.step-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.step.active .step-label {
  color: var(--color-sand);
  font-weight: 600;
}

/* Main Checkout Content */
.checkout-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px;
}

/* Checkout Steps */
.checkout-steps {
  background: #1E1E1E;
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.checkout-step {
  min-height: 500px;
}

.checkout-step.hidden {
  display: none;
}

.checkout-step h2 {
  font-family: var(--font-body);
  font-size: 1.8rem;
  color: var(--color-sand);
  margin-bottom: 30px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 15px;
}

.step-description {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 30px;
  font-size: 0.95rem;
}

/* Authentication Modal */
.auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-modal-overlay.show {
  opacity: 1;
}

.auth-modal {
  background: #1E1E1E;
  border: 2px solid rgba(241, 204, 152, 0.3);
  max-width: 600px;
  width: 90%;
  padding: 50px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.auth-modal-overlay.show .auth-modal {
  transform: translateY(0);
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 40px;
}

.auth-modal-header i {
  font-size: 4rem;
  color: var(--color-sand);
  margin-bottom: 20px;
  display: block;
}

.auth-modal-header h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-sand);
  margin-bottom: 15px;
  font-weight: 400;
}

.auth-modal-header p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  line-height: 1.6;
}

.auth-modal-benefits {
  background: rgba(241, 204, 152, 0.05);
  border-left: 3px solid var(--color-sand);
  padding: 25px;
  margin-bottom: 35px;
}

.auth-modal-benefits h3 {
  color: var(--color-sand);
  font-size: 1.1rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.auth-modal-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.auth-modal-benefits li {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-modal-benefits li i {
  color: var(--color-sand);
  font-size: 1rem;
}

.auth-modal-options {
  display: grid;
  gap: 15px;
}

.auth-option-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 25px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--font-body);
  width: 100%;
  text-align: left;
}

.auth-option-btn:hover {
  border-color: var(--color-sand);
  background: rgba(241, 204, 152, 0.08);
  transform: translateX(5px);
}

.auth-option-btn i {
  font-size: 2.5rem;
  color: var(--color-sand);
  min-width: 50px;
  text-align: center;
}

.auth-option-btn span {
  display: block;
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.auth-option-btn small {
  display: block;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.auth-option-btn.auth-login:hover {
  border-color: #10b981;
}

.auth-option-btn.auth-login:hover i {
  color: #10b981;
}

.auth-option-btn.auth-register:hover {
  border-color: #3b82f6;
}

.auth-option-btn.auth-register:hover i {
  color: #3b82f6;
}

.auth-option-btn.auth-guest {
  border-style: dashed;
  opacity: 0.8;
}

.auth-option-btn.auth-guest:hover {
  opacity: 1;
}

/* Login Button in Header */
.checkout-header-login {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: 1px solid rgba(241, 204, 152, 0.3);
  color: var(--color-sand);
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkout-header-login:hover {
  background: rgba(241, 204, 152, 0.1);
  border-color: var(--color-sand);
}

.checkout-header-login i {
  font-size: 1rem;
}


/* Form Styles */
.form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* Saved Addresses */
.saved-addresses {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.address-option {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.address-option:hover {
  border-color: var(--color-sand);
  background: rgba(241, 204, 152, 0.05);
}

.address-option.selected {
  border-color: var(--color-sand);
  background: rgba(241, 204, 152, 0.08);
}

.address-option input[type="radio"] {
  display: none;
}

.address-option label {
  cursor: pointer;
  display: block;
  width: 100%;
}

.address-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.address-header strong {
  font-size: 1.1rem;
  color: var(--color-sand);
}

.badge-default {
 /*  background: rgba(100, 36, 46, 0.2); */
  color: var(--color-sand);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid var(--color-sand);
}

.address-details {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  line-height: 1.8;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-sand);
  font-weight: 500;
}

.form-group input,
.form-group select {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-sand);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 15px rgba(241, 204, 152, 0.1);
}

/* Shipping Options */
.shipping-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.shipping-option {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.shipping-option:hover {
  border-color: var(--color-sand);
  background: rgba(241, 204, 152, 0.05);
}

.shipping-option input[type="radio"] {
  display: none;
}

.shipping-option input[type="radio"]:checked + label {
  color: var(--color-sand);
}

.shipping-option label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

.option-name {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.option-name strong {
  font-size: 1.1rem;
}

.option-days {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.option-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-sand);
}

/* Coupon Form */
.coupon-form {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.coupon-form input {
  flex: 1;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-transform: uppercase;
}

.coupon-result {
  padding: 15px;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.coupon-result.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.coupon-result.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.btn-remove-coupon {
  padding: 8px 16px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ef4444;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-remove-coupon:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  transform: translateY(-1px);
}

.btn-remove-coupon i {
  font-size: 0.9rem;
}


/* Payment Methods */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.payment-option {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.payment-option:hover {
  border-color: var(--color-sand);
  background: rgba(241, 204, 152, 0.05);
}

.payment-option input[type="radio"] {
  display: none;
}

.payment-option input[type="radio"]:checked + label {
  color: var(--color-sand);
}

.payment-option label {
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  width: 100%;
}

.payment-icon {
  width: 50px;
  height: 50px;
  background: rgba(100, 36, 46, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.5rem;
  color: var(--color-sand);
}

.payment-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.payment-info strong {
  font-size: 1.1rem;
}

.payment-info small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

/* Order Review */
.review-section {
  background: rgba(255, 255, 255, 0.03);
  padding: 25px;
  margin-bottom: 25px;
  border-left: 3px solid var(--color-sand);
}

.review-section h3 {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--color-sand);
  margin-bottom: 15px;
  font-weight: 500;
}

.review-section p {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.8;
}

.review-totals {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-line {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.review-line.total {
  font-size: 1.3rem;
  font-weight: 700;
  border-top: 2px solid var(--color-sand);
  border-bottom: none;
  margin-top: 10px;
  padding-top: 15px;
  color: var(--color-sand);
}

/* Buttons */
.step-actions {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 40px;
}

.button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
}

.btn-primary,
.btn-secondary {
  padding: 16px 32px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-sand) 0%, #d4b07e 100%);
  color: var(--color-marsala-dark);
}

.btn-primary:hover {
  background: white;
  box-shadow: 0 0 20px rgba(241, 204, 152, 0.4);
  transform: translateY(-2px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  padding: 14px 24px;
}

.btn-secondary:hover {
  border-color: var(--color-sand);
  color: var(--color-sand);
}

/* Empty Address State */
.empty-address-state {
  text-align: center;
  padding: 80px 40px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  margin: 40px 0;
}

.empty-icon {
  font-size: 4rem;
  color: var(--color-sand);
  margin-bottom: 30px;
  opacity: 0.5;
}

.empty-address-state h3 {
  font-family: var(--font-body);
  font-size: 1.8rem;
  color: var(--color-sand);
  margin-bottom: 15px;
  font-weight: 500;
}

.empty-address-state p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.1rem;
  margin-bottom: 40px;
  line-height: 1.6;
}

.empty-address-state .btn-primary {
  display: inline-flex;
  margin: 0 auto;
}

/* Order Summary Sidebar */
.order-summary {
  background: #1E1E1E;
  padding: 35px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  height: fit-content;
  position: sticky;
  top: 20px;
}

.order-summary h3 {
  font-family: var(--font-body);
  font-size: 1.5rem;
  color: var(--color-sand);
  margin-bottom: 25px;
  font-weight: 500;
}

.cart-items {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 25px;
  padding-right: 15px; /* Prevent content cutoff and space for scrollbar */
}

/* Custom Scrollbar for Cart Items */
.cart-items::-webkit-scrollbar {
  width: 6px;
}

.cart-items::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb {
  background: rgba(241, 204, 152, 0.2);
  border-radius: 3px;
  transition: all 0.3s;
}

.cart-items::-webkit-scrollbar-thumb:hover {
  background: rgba(241, 204, 152, 0.5);
}

.cart-item {
  display: flex;
  justify-content: space-between;
  padding: 15px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.item-info strong {
  font-size: 0.75rem;
  color: white;
  padding-right: 10px;
}

.item-info small {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

.item-price {
  font-weight: 700;
  color: var(--color-sand);
  font-size: 0.75rem;
}

.summary-totals {
  border-top: 2px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
}

.summary-line.discount-line {
  color: #10b981;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  padding: 20px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-sand);
  border-top: 2px solid var(--color-sand);
  margin-top: 15px;
}

.secure-badge {
  margin-top: 25px;
  padding: 15px;
  background: rgba(241, 204, 152, 0.1);
  border: 1px solid rgba(241, 204, 152, 0.3);
  color: var(--color-sand);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.hidden {
  display: none;
}

.loading-content {
  text-align: center;
  color: white;
  padding: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(241, 204, 152, 0.3);
}

.loading-content i {
  font-size: 4rem;
  color: var(--color-sand);
  margin-bottom: 25px;
  animation: spin 1s linear infinite;
  display: block;
}

.loading-content p {
  font-size: 1.3rem;
  color: var(--color-sand);
  margin-bottom: 10px;
  font-weight: 600;
}

.loading-content small {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  display: block;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-text,
.error-text {
  text-align: center;
  padding: 30px;
  font-size: 0.95rem;
}

.loading-text {
  color: rgba(255, 255, 255, 0.6);
}

.error-text {
  color: #ef4444;
}

.hidden {
  display: none;
}

/* ✅ CRÍTICO: Esconder mobile-cart-toggle no checkout (conflito visual identificado pelo browser agent) */
.mobile-cart-toggle,
#mobileCartToggle {
  display: none !important;
}

/* Responsive & Mobile Optimizations */
@media (max-width: 1024px) {
  .checkout-content {
      grid-template-columns: 1fr;
      padding-bottom: 100px; /* Space for the toggle bar */
  }

  /* Mobile Drawer (Order Summary) */
  .order-summary {
      position: fixed;
      bottom: 0 !important;
      left: 0;
      width: 100%;
      height: 85vh !important; /* ✅ Aumentado de 80vh para 85vh - mais espaço */
      max-height: 85vh !important;
      border-radius: 20px 20px 0 0;
      transform: translateY(110%);
      transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      z-index: 2000; /* Higher than toggle */
      background: #1E1E1E; 
      border-top: 2px solid var(--color-sand);
      box-shadow: 0 -10px 40px rgba(0,0,0,0.8);
      padding: 0;
      display: flex;
      flex-direction: column;
      overflow-y: auto !important; /* ✅ Container PODE rolar */
      -webkit-overflow-scrolling: touch; /* Smooth scrolling iOS */
      
      /* Safe area for iPhone home bar */
      padding-bottom: env(safe-area-inset-bottom); 
  }
  
  .order-summary.open {
      transform: translateY(0);
  }

  /* Drawer Header */
  .order-summary h3 {
      text-align: center;
      background: #1E1E1E;
      padding: 20px 15px;
      margin: 0;
      font-size: 1.1rem;
      border-bottom: 1px solid rgba(255,255,255,0.05);
      flex-shrink: 0;
      position: relative;
      color: var(--color-sand);
      touch-action: none; /* Prevent scroll/zoom on the handle */
      cursor: grab;
  }
  
  .order-summary h3:active {
      cursor: grabbing;
  }
  
  /* Drag Handle */
  .order-summary h3::before {
      content: '';
      display: block;
      width: 40px;
      height: 4px;
      background: rgba(255,255,255,0.2);
      border-radius: 2px;
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
  }

  /* Scrollable Content - Otimizado para evitar conflito */
  .cart-items {
      flex: 1; /* ✅ Ocupa espaço disponível */
      overflow-y: auto !important; /* ✅ Lista PODE rolar independentemente */
      max-height: none !important;
      padding: 20px;
      margin: 0;
      -webkit-overflow-scrolling: touch; /* Smooth scrolling iOS */
  }
  
  .summary-totals, .secure-badge, .btn-secondary {
      padding: 0 20px 10px 20px;
      flex-shrink: 0;
  }
  
  .secure-badge {
      font-size: 0.75rem;
      padding: 10px;
      margin: 10px 20px 20px 20px;
  }

  /* Show the toggle button */
  .mobile-cart-toggle {
      display: flex !important; /* Override .hidden class */
      align-items: center;
      justify-content: space-between;
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      background: #2D2A29;
      border-top: 1px solid var(--color-sand);
      padding: 15px 20px;
      padding-bottom: calc(15px + env(safe-area-inset-bottom));
      z-index: 1010;
      color: var(--color-sand);
      box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
      cursor: pointer;
      transition: all 0.3s;
      transform: translateY(0);
      visibility: visible;
  }

  .mobile-cart-toggle:active {
      background: #1a1818;
  }

  .cart-icon-wrapper {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
  }

  .cart-count {
      position: absolute;
      top: -8px;
      right: -8px;
      background: var(--color-sand);
      color: var(--bg-dark);
      font-size: 0.7rem;
      font-weight: bold;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
  }

  .cart-label {
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 1px;
      font-size: 0.9rem;
      margin-left: 15px;
  }

  .cart-total {
      font-weight: 700;
      font-size: 1.1rem;
      margin-left: auto;
      margin-right: 15px;
  }

  .toggle-icon {
      transition: transform 0.3s;
  }

  .mobile-cart-toggle.active .toggle-icon {
      transform: rotate(180deg);
  }
}

@media (max-width: 768px) {
  /* Container & Layout */
  .checkout-container {
      padding: 20px 20px; /* Increased padding from edges */
      padding-bottom: 90px;
      overflow-x: hidden;
  }
  
  .checkout-header {
      margin-bottom: 25px;
      padding-bottom: 15px;
  }
  
  .checkout-header .logo {
      max-width: 120px;
      margin-bottom: 10px;
  }
  
  .checkout-header h1 {
      font-size: 1.3rem; /* Slightly reduced */
  }
  
  .checkout-steps {
      padding: 0;
      background: transparent;
      border: none;
  }
  
  /* Steps Navigation - Compact & Centered */
  .progress-steps {
      margin-bottom: 30px;
      display: flex;
      flex-wrap: nowrap;
      overflow-x: auto;
      padding: 5px;
      gap: 15px;
      justify-content: center; /* Centered */
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
  }
  
  .progress-steps::-webkit-scrollbar {
      display: none;
  }
  
  .progress-steps::before {
      display: none;
  }
  
  .step {
      min-width: auto;
      flex: 0 0 auto;
      padding: 0;
  }
  
  .step-number {
      width: 36px; /* Slightly larger touch target but compact visual */
      height: 36px;
      font-size: 0.9rem;
      border-width: 1px;
      margin-bottom: 8px;
  }
  
  .step-label {
      font-size: 0.7rem;
      white-space: nowrap;
      display: none; /* Hide labels on very small screens if needed, or keep small */
  }

  /* Step Headings */
  .checkout-step h2 {
      font-size: 1.3rem;
      margin-bottom: 20px;
      padding-bottom: 12px;
      border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  
  .step-description {
      font-size: 0.9rem;
      line-height: 1.5;
      margin-bottom: 25px;
  }

  /* Forms & Coupon - Spacing */
  .form-row {
      grid-template-columns: 1fr;
      gap: 15px;
  }
  
  /* Coupon Box - More Padding */
  .coupon-form {
      flex-direction: column;
      gap: 12px;
      padding: 5px; /* Added inner padding context */
  }
  
  .coupon-form input {
      width: 100%;
      height: 44px; /* Slightly reduced height */
  }
  
  .coupon-form button {
      width: 100%;
      height: 44px;
      justify-content: center;
  }

  /* Compact Input Fields */
  .form-group label {
      font-size: 0.75rem;
      margin-bottom: 5px;
  }
  
  .form-group input, 
  .form-group select {
      padding: 0 12px;
      height: 44px; 
      font-size: 0.9rem; 
  }

  /* Payment Cards - Compact */
  .payment-methods-grid {
      grid-template-columns: 1fr;
      gap: 10px;
  }
  
  .payment-method-card {
      padding: 12px 15px; /* Reduced padding */
      min-height: auto;
      display: flex;
      align-items: center;
      text-align: left;
      gap: 15px;
  }
  
  .payment-method-card .method-icon {
      width: 32px;
      height: 32px;
      font-size: 1rem;
      margin-bottom: 0;
      background: rgba(241, 204, 152, 0.1);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
  }
  
  .payment-method-card h3 {
      font-size: 0.9rem; /* Reduced */
      margin: 0;
      flex: 1;
  }
  
  .payment-method-card p, 
  .payment-method-card .badge {
      display: none; /* Hide extra info on mobile for compactness */
  }
  
  /* Buttons & Actions - Improved Standard */
  .step-actions {
      flex-direction: column-reverse;
      gap: 12px;
      margin-top: 25px;
  }
  
  .step-actions button {
      width: 100%;
      justify-content: center;
      height: 46px; /* Reduced height */
      padding: 0 12px;
      font-size: 0.8rem; /* Reduced font size */
      letter-spacing: 0.5px;
      text-transform: uppercase;
  }
  
  .btn-primary {
      font-weight: 700;
  }

  /* Guest Notice */
  .guest-notice {
      padding: 12px;
      font-size: 0.8rem;
  }

  /* Step 1 Specific - CEP Field & Button */
  #step-1 .form-row:first-of-type {
      flex-direction: column;
      gap: 12px;
  }

  #step-1 #searchZipCode {
      margin-top: 0 !important; /* Override inline style */
      width: 100%;
      height: 46px;
      font-size: 0.8rem;
  }

  #step-1 #continueToShipping {
      margin-top: 20px;
      width: 100%;
      height: 46px;
      justify-content: center;
  }

  /* Address List Buttons (Step 1 Saved Addresses) */
  .button-row {
      flex-direction: column-reverse; /* Stack with Continue on top */
      gap: 12px;
      margin-top: 25px;
  }
  
  .button-row button {
      width: 100%;
      height: 46px;
      justify-content: center;
      padding: 0 12px;
      font-size: 0.8rem;
      letter-spacing: 0.5px;
      text-transform: uppercase;
  }

  /* Compact Shipping Option Cards */
  .shipping-option {
      padding: 12px;
  }
  
  .shipping-option label {
      align-items: center;
  }
  
  .option-name strong {
      font-size: 0.85rem;
  }
  
  .option-days {
      font-size: 0.75rem;
  }
  
  .option-price {
      font-size: 0.9rem;
      font-weight: 600;
  }

  /* Ultra-Compact Review Section for "Single Screen" feel */
  .review-section {
      padding: 12px;
      margin-bottom: 10px;
      border-radius: 8px;
  }

  .review-section h3 {
      font-size: 0.9rem;
      margin-bottom: 8px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      opacity: 0.7;
  }

  .review-section p {
      font-size: 0.8rem;
      line-height: 1.3;
      margin-bottom: 0;
  }

  /* Compact rows in review lines */
  .review-line {
      font-size: 0.8rem;
      padding: 4px 0;
      display: flex;
      justify-content: space-between;
  }
  
  .review-line.total {
      font-size: 1rem;
      padding-top: 8px;
      margin-top: 5px;
      border-top: 1px dashed rgba(255,255,255,0.1);
  }
}

/* Modal Overlay Fix */
.mobile-cart-overlay {
    z-index: 1020; /* Ensure strictly above everything */
}

/* Small Phones */
@media (max-width: 360px) {
    .checkout-header h1 {
        font-size: 1.2rem;
    }
    
    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .btn-primary, .btn-secondary {
        font-size: 0.8rem;
    }
}

/* Mobile Responsive Styles for Auth Modal */
@media (max-width: 768px) {
  .auth-modal {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    padding: 30px 20px;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  .auth-modal-header {
    margin-bottom: 25px;
  }
  
  .auth-modal-header i {
    font-size: 3rem;
    margin-bottom: 15px;
  }
  
  .auth-modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }
  
  .auth-modal-header p {
    font-size: 0.9rem;
  }
  
  .auth-modal-benefits {
    padding: 20px;
    margin-bottom: 25px;
  }
  
  .auth-modal-benefits h3 {
    font-size: 1rem;
    margin-bottom: 12px;
  }
  
  .auth-modal-benefits li {
    font-size: 0.85rem;
    padding: 6px 0;
  }
  
  .auth-modal-benefits li i {
    font-size: 0.9rem;
  }
  
  .auth-modal-options {
    gap: 12px;
  }
  
  .auth-option-btn {
    padding: 20px;
    gap: 15px;
  }
  
  .auth-option-btn i {
    font-size: 2rem;
    min-width: 40px;
  }
  
  .auth-option-btn span {
    font-size: 1rem;
  }
  
  .auth-option-btn small {
    font-size: 0.8rem;
  }
}

/* Very Small Mobile */
@media (max-width: 480px) {
  .auth-modal {
    padding: 20px 15px;
  }
  
  .auth-modal-header i {
    font-size: 2.5rem;
  }
  
  .auth-modal-header h2 {
    font-size: 1.3rem;
  }
  
  .auth-modal-header p {
    font-size: 0.85rem;
  }
  
  .auth-modal-benefits {
    padding: 15px;
    margin-bottom: 20px;
  }
  
  .auth-modal-benefits h3 {
    font-size: 0.95rem;
  }
  
  .auth-modal-benefits li {
    font-size: 0.8rem;
  }
  
  .auth-option-btn {
    padding: 18px 15px;
  }
  
  .auth-option-btn i {
    font-size: 1.8rem;
  }
  
  .auth-option-btn span {
    font-size: 0.95rem;
  }
  
  .auth-option-btn small {
    font-size: 0.75rem;
  }
}




/* ============================================
   TOAST NOTIFICATIONS SYSTEM
   ============================================ */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #1E1E1E;
  color: white;
  border-left: 4px solid var(--color-sand);
  padding: 16px 24px;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  min-width: 320px;
  max-width: 500px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  position: relative;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s, transform 0.3s;
}

.toast.fade-out {
  opacity: 0;
  transform: translateX(-20px);
}

.toast i {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.toast.success { border-left-color: #10b981; }
.toast.success i { color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.error i { color: #ef4444; }
.toast.warning{ border-left-color: #f59e0b; }
.toast.warning i { color: #f59e0b; }
.toast.info { border-left-color: #3b82f6; }
.toast.info i { color: #3b82f6; }

@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .toast-container {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
  .toast {
    min-width: auto;
    max-width: 100%;
    font-size: 0.85rem;
    padding: 14px 18px;
  }
}

