/* ================================================================
   REMEDYWALA CUSTOM CHECKOUT — checkout.css
   Brand: #900000 (dark maroon) | #fdf6ec (cream) | gold accents
   Fonts: Cinzel (headings) | EB Garamond (body)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --rw-maroon:      #900000;
  --rw-maroon-dark: #6b0000;
  --rw-maroon-light:#b30000;
  --rw-gold:        #c9a84c;
  --rw-gold-light:  #e8c97a;
  --rw-cream:       #fdf6ec;
  --rw-cream-dark:  #f5e9d4;
  --rw-text:        #2c1a1a;
  --rw-text-muted:  #7a5c5c;
  --rw-border:      #e4c9a0;
  --rw-shadow:      0 2px 20px rgba(144,0,0,0.08);
  --rw-radius:      12px;
  --rw-radius-sm:   8px;
  --rw-font-head:   'Cinzel', serif;
  --rw-font-body:   'EB Garamond', serif;
}

/* ── BASE (body prefix for theme override protection) ── */
body .rw-checkout-wrapper,
body .rw-checkout-wrapper * {
  box-sizing: border-box;
}
body .rw-checkout-wrapper {
  font-family: var(--rw-font-body) !important;
  color: var(--rw-text) !important;
  font-size: 17px;
  line-height: 1.6;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ── EMPTY CART ── */
body .rw-checkout-empty {
  text-align: center;
  padding: 80px 20px;
  background: var(--rw-cream);
  border-radius: var(--rw-radius);
}
body .rw-empty-icon { font-size: 60px; margin-bottom: 16px; }
body .rw-checkout-empty h3 {
  font-family: var(--rw-font-head) !important;
  font-size: 24px;
  color: var(--rw-maroon);
}

/* ── STEP INDICATOR ── */
body .rw-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
  flex-wrap: nowrap;
}
body .rw-step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.4;
  transition: opacity 0.3s;
}
body .rw-step.active { opacity: 1; }
body .rw-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--rw-border);
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-family: var(--rw-font-head) !important;
  font-size: 13px;
  font-weight: 600;
  color: var(--rw-text-muted);
  transition: all 0.3s;
}
body .rw-step.active .rw-step-num {
  background: var(--rw-maroon) !important;
  color: white !important;
}
body .rw-step-label {
  font-size: 13px;
  font-family: var(--rw-font-head) !important;
  letter-spacing: 0.5px;
  color: var(--rw-text-muted);
}
body .rw-step.active .rw-step-label { color: var(--rw-maroon); }
body .rw-step-line {
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: var(--rw-border);
  margin: 0 12px;
}

/* ── GRID LAYOUT ── */
body .rw-checkout-grid {
  display: grid !important;
  grid-template-columns: 1fr 400px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  body .rw-checkout-grid { grid-template-columns: 1fr !important; }
}

/* ── SECTIONS ── */
body .rw-section {
  background: #fff !important;
  border: 1px solid var(--rw-border) !important;
  border-radius: var(--rw-radius) !important;
  padding: 28px 28px !important;
  margin-bottom: 20px !important;
  box-shadow: var(--rw-shadow) !important;
  transition: box-shadow 0.2s;
}
body .rw-section:hover { box-shadow: 0 4px 28px rgba(144,0,0,0.12) !important; }
body .rw-section-compact { padding: 20px 28px !important; }

body .rw-section-header { margin-bottom: 24px; }
body .rw-section-icon { font-size: 22px; display: block; margin-bottom: 6px; }
body .rw-section-title {
  font-family: var(--rw-font-head) !important;
  font-size: 20px !important;
  font-weight: 600;
  color: var(--rw-maroon) !important;
  margin: 0 0 4px !important;
  letter-spacing: 0.5px;
}
body .rw-section-sub {
  font-size: 14px;
  color: var(--rw-text-muted);
  margin: 0;
  font-style: italic;
}

/* ── LOGGED-IN BAR ── */
body .rw-logged-in-bar {
  display: flex !important;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #fff8f0 0%, var(--rw-cream) 100%) !important;
  border: 1px solid var(--rw-border) !important;
  border-left: 4px solid var(--rw-maroon) !important;
  border-radius: var(--rw-radius-sm) !important;
  padding: 14px 18px !important;
  margin-bottom: 20px !important;
  font-size: 15px;
  color: var(--rw-text);
}
body .rw-logged-in-bar svg { color: #2d9e2d; flex-shrink: 0; }
body .rw-logout-link {
  margin-left: auto;
  color: var(--rw-text-muted);
  font-size: 13px;
  text-decoration: none !important;
}
body .rw-logout-link:hover { color: var(--rw-maroon); }

/* ── AUTH BUTTONS ── */
body .rw-auth-buttons {
  display: flex !important;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
body .rw-btn-auth {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 14px 28px !important;
  border-radius: var(--rw-radius-sm) !important;
  border: none;
  font-family: var(--rw-font-head) !important;
  font-size: 15px !important;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none !important;
  line-height: 1 !important;
}
body .rw-btn-login {
  background: var(--rw-maroon) !important;
  color: white !important;
  flex: 1;
  min-width: 160px;
  justify-content: center;
}
body .rw-btn-login:hover { background: var(--rw-maroon-dark) !important; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(144,0,0,0.3); }
body .rw-btn-register {
  background: transparent !important;
  color: var(--rw-maroon) !important;
  border: 2px solid var(--rw-maroon) !important;
  flex: 1;
  min-width: 160px;
  justify-content: center;
}
body .rw-btn-register:hover { background: var(--rw-cream) !important; transform: translateY(-1px); }
body .rw-auth-divider {
  font-size: 13px;
  color: var(--rw-text-muted);
  font-style: italic;
  flex-shrink: 0;
}
body .rw-guest-note { font-size: 13px; color: var(--rw-text-muted); margin: 0; }
body .rw-guest-note a { color: var(--rw-maroon); }

/* ── FORM GRID ── */
body .rw-form-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
body .rw-field-group.rw-full { grid-column: 1 / -1; }
body .rw-field-group { display: flex !important; flex-direction: column; gap: 6px; }

body .rw-label {
  font-size: 13px !important;
  font-family: var(--rw-font-head) !important;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--rw-text) !important;
  display: block !important;
  margin-bottom: 4px !important;
}
body .rw-req { color: var(--rw-maroon); }
body .rw-label-opt { color: var(--rw-text-muted); font-weight: 400; font-style: italic; }

body .rw-input,
body .rw-checkout-wrapper input[type="text"],
body .rw-checkout-wrapper input[type="email"],
body .rw-checkout-wrapper input[type="tel"],
body .rw-checkout-wrapper textarea,
body .rw-checkout-wrapper select {
  width: 100% !important;
  padding: 12px 16px !important;
  border: 1.5px solid var(--rw-border) !important;
  border-radius: var(--rw-radius-sm) !important;
  font-family: var(--rw-font-body) !important;
  font-size: 16px !important;
  color: var(--rw-text) !important;
  background: var(--rw-cream) !important;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
}
body .rw-input:focus,
body .rw-checkout-wrapper input[type="text"]:focus,
body .rw-checkout-wrapper input[type="email"]:focus,
body .rw-checkout-wrapper input[type="tel"]:focus,
body .rw-checkout-wrapper textarea:focus,
body .rw-checkout-wrapper select:focus {
  border-color: var(--rw-maroon) !important;
  box-shadow: 0 0 0 3px rgba(144,0,0,0.1) !important;
  background: #fff !important;
}
body .rw-input::placeholder { color: #b8a08a; }
body .rw-select,
body .rw-checkout-wrapper select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23900000' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  padding-right: 36px !important;
  cursor: pointer;
}
body .rw-textarea { resize: vertical; min-height: 80px; }

/* ── SAME AS SHIPPING CHECKBOX ── */
body .rw-same-as-shipping {
  display: flex !important;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  margin-bottom: 20px;
  padding: 14px 18px !important;
  background: linear-gradient(135deg, #fff8f0 0%, var(--rw-cream) 100%) !important;
  border: 1.5px solid var(--rw-border) !important;
  border-radius: var(--rw-radius-sm) !important;
  transition: border-color 0.2s;
  user-select: none;
}
body .rw-same-as-shipping:hover { border-color: var(--rw-maroon) !important; }
body .rw-same-as-shipping input[type="checkbox"] { display: none !important; }
body .rw-checkbox-box {
  width: 20px !important;
  height: 20px !important;
  border: 2px solid var(--rw-border) !important;
  border-radius: 4px !important;
  background: #fff !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: none !important;
}
body .rw-same-as-shipping input:checked + .rw-checkbox-box {
  background: var(--rw-maroon) !important;
  border-color: var(--rw-maroon) !important;
}
body .rw-check-icon { opacity: 0; transition: opacity 0.2s; color: white !important; }
body .rw-same-as-shipping input:checked + .rw-checkbox-box .rw-check-icon { opacity: 1 !important; }
body .rw-checkbox-text { font-size: 15px; color: var(--rw-text); }

body .rw-billing-form { animation: rwSlideDown 0.3s ease; }
@keyframes rwSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── STICKY RIGHT PANEL ── */
body .rw-sticky-panel {
  position: sticky;
  top: 24px;
}

/* ── ORDER SUMMARY ── */
body .rw-order-summary { padding: 24px !important; }
body .rw-order-items { margin-bottom: 20px; }

body .rw-order-item {
  display: flex !important;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rw-cream-dark);
}
body .rw-order-item:last-child { border-bottom: none; }
body .rw-item-thumb {
  width: 56px !important;
  height: 56px !important;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  border: 1px solid var(--rw-border) !important;
}
body .rw-item-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}
body .rw-item-qty-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--rw-maroon) !important;
  color: white !important;
  font-size: 11px;
  font-family: var(--rw-font-head) !important;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
body .rw-item-info { flex: 1; min-width: 0; }
body .rw-item-name {
  display: block !important;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--rw-text) !important;
}
body .rw-item-variation {
  display: block !important;
  font-size: 12px;
  color: var(--rw-text-muted);
  font-style: italic;
}
body .rw-item-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--rw-maroon) !important;
  white-space: nowrap;
}

body .rw-order-totals { border-top: 1.5px solid var(--rw-cream-dark); padding-top: 16px; }
body .rw-total-row {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 15px;
  color: var(--rw-text);
}
body .rw-discount-row { color: #2d7a2d !important; }
body .rw-free { color: #2d7a2d !important; font-weight: 600; }
body .rw-grand-total {
  border-top: 2px solid var(--rw-border) !important;
  margin-top: 8px;
  padding-top: 12px !important;
  font-family: var(--rw-font-head) !important;
  font-size: 18px !important;
  font-weight: 700;
  color: var(--rw-maroon) !important;
}

/* ── COUPON ── */
body .rw-coupon-section { padding: 0 !important; overflow: hidden; }
body .rw-coupon-header {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px !important;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--rw-font-head) !important;
  letter-spacing: 0.3px;
  color: var(--rw-maroon) !important;
  background: linear-gradient(135deg, #fff8f0 0%, var(--rw-cream) 100%) !important;
}
body .rw-coupon-header:hover { background: var(--rw-cream-dark) !important; }
body .rw-coupon-header span { display: flex; align-items: center; gap: 8px; }
body .rw-toggle-arrow { transition: transform 0.3s; }
body .rw-toggle-arrow.open { transform: rotate(180deg); }
body .rw-coupon-body { padding: 16px 20px !important; display: none; }
body .rw-coupon-body.open { display: block !important; }
body .rw-coupon-input-row { display: flex !important; gap: 10px; }
body .rw-coupon-input { flex: 1; text-transform: uppercase; letter-spacing: 1px; }
body .rw-btn-coupon {
  padding: 12px 20px !important;
  background: var(--rw-maroon) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--rw-radius-sm) !important;
  font-family: var(--rw-font-head) !important;
  font-size: 14px !important;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
body .rw-btn-coupon:hover { background: var(--rw-maroon-dark) !important; }
body .rw-coupon-msg {
  margin-top: 10px;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
  display: none;
}
body .rw-coupon-msg.success { background: #e8f5e9 !important; color: #2d7a2d !important; display: block !important; }
body .rw-coupon-msg.error   { background: #fce4e4 !important; color: #c00 !important; display: block !important; }
body .rw-applied-coupons { margin-top: 12px; display: flex !important; flex-wrap: wrap; gap: 8px; }
body .rw-applied-coupon {
  display: flex !important;
  align-items: center;
  gap: 8px;
  background: var(--rw-cream) !important;
  border: 1px solid var(--rw-gold) !important;
  border-radius: 20px !important;
  padding: 4px 12px !important;
  font-size: 13px;
  font-family: var(--rw-font-head) !important;
  color: var(--rw-text) !important;
}
body .rw-remove-coupon {
  background: none !important;
  border: none !important;
  color: var(--rw-text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 !important;
  line-height: 1;
  box-shadow: none !important;
}
body .rw-remove-coupon:hover { color: var(--rw-maroon) !important; }

/* ── PAYMENT ICONS ── */
body .rw-payment-info { padding: 14px 20px !important; }
body .rw-payment-icons {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
}
body .rw-pay-icon {
  background: var(--rw-cream) !important;
  border: 1px solid var(--rw-border) !important;
  border-radius: 6px !important;
  padding: 5px 12px !important;
  font-size: 12px;
  font-family: var(--rw-font-head) !important;
  color: var(--rw-text-muted) !important;
}

/* ── PLACE ORDER BUTTON ── */
body .rw-btn-place-order {
  width: 100% !important;
  padding: 18px 24px !important;
  background: linear-gradient(135deg, var(--rw-maroon) 0%, var(--rw-maroon-dark) 100%) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--rw-radius-sm) !important;
  font-family: var(--rw-font-head) !important;
  font-size: 16px !important;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s;
  margin-top: 4px;
  box-shadow: 0 4px 20px rgba(144,0,0,0.3) !important;
  position: relative;
  overflow: hidden;
}
body .rw-btn-place-order::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}
body .rw-btn-place-order:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(144,0,0,0.4) !important; }
body .rw-btn-place-order:hover::before { left: 100%; }
body .rw-btn-place-order:active { transform: translateY(0); }
body .rw-btn-place-order.loading { opacity: 0.7; cursor: not-allowed; }
body .rw-order-total-inline {
  margin-left: auto;
  background: rgba(255,255,255,0.2) !important;
  padding: 3px 10px !important;
  border-radius: 12px !important;
  font-size: 14px;
}

body .rw-secure-note {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--rw-text-muted);
  margin-top: 12px;
  font-style: italic;
}

/* ── ERROR AREA ── */
body .rw-checkout-errors {
  background: #fce4e4 !important;
  border: 1px solid #f5c0c0 !important;
  border-radius: var(--rw-radius-sm) !important;
  padding: 14px 18px !important;
  margin-top: 14px;
  font-size: 14px;
  color: #900000 !important;
}

/* ── INPUT ERROR ── */
body .rw-input-error {
  border-color: #c00 !important;
  background: #fff5f5 !important;
}

/* ── PRIMARY BUTTON ── */
body .rw-btn-primary {
  display: inline-block !important;
  padding: 12px 28px !important;
  background: var(--rw-maroon) !important;
  color: white !important;
  border-radius: var(--rw-radius-sm) !important;
  font-family: var(--rw-font-head) !important;
  text-decoration: none !important;
  font-size: 15px !important;
  margin-top: 16px;
}

/* ── MOBILE ── */
@media (max-width: 680px) {
  body .rw-form-grid { grid-template-columns: 1fr !important; }
  body .rw-field-group.rw-full { grid-column: 1 !important; }
  body .rw-section { padding: 20px 16px !important; }
  body .rw-auth-buttons { flex-direction: column !important; }
  body .rw-btn-auth { width: 100% !important; justify-content: center; }
  body .rw-auth-divider { text-align: center; }
}
@media (max-width: 480px) {
  body .rw-step-label { display: none !important; }
  body .rw-steps { gap: 4px; }
  body .rw-step-line { max-width: 40px; }
}

/* ================================================================
   PREPAID / COD PAYMENT METHOD BUTTONS
================================================================ */
.rw-payment-method-section .rw-section-header {
    margin-bottom: 12px;
}

.rw-payment-method-buttons {
    display: flex;
    gap: 10px;
}

.rw-btn-payment-method {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rw-btn-payment-method:hover {
    border-color: var(--rw-primary, #2563eb);
    color: var(--rw-primary, #2563eb);
}

.rw-btn-payment-method.active {
    border-color: var(--rw-primary, #2563eb);
    background: var(--rw-primary, #2563eb);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

/* ================================================================
   RW LOGIN POPUP MODAL
================================================================ */
.rw-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(3px);
}

body.rw-modal-open {
    overflow: hidden;
}

.rw-modal-box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: rw-modal-in 0.22s ease;
}

@keyframes rw-modal-in {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.rw-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    z-index: 10;
    transition: background 0.15s;
}

.rw-modal-close:hover {
    background: #e5e7eb;
    color: #111;
}

.rw-modal-content {
    padding: 32px 28px 24px;
}

/* Ensure RW-Login form looks good inside modal */
.rw-modal-content .rw-login-form,
.rw-modal-content form {
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    border: none !important;
}
