/* ============================================================
   THE BATH & BODY SPOT — Modals (Quick View, Payment, Notify)
   ============================================================ */

/* ── Modal Base ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease-med);
}

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

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: scaleUp 0.4s var(--ease-bounce) both;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  z-index: 10;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  cursor: pointer;
  font-size: 18px;
  transition: all var(--ease-fast);
  border: 1px solid var(--border-soft);
}

.modal-close:hover {
  background: var(--blush-mid);
  color: var(--text-dark);
}

/* ── Quick View Modal ────────────────────────────── */
#modal-quick-view .modal {
  width: min(900px, 95vw);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
}

.qv-gallery {
  position: relative;
  background: var(--blush-lightest);
  overflow: hidden;
}

.qv-main-img {
  width: 100%;
  height: 100%;
  min-height: 380px;
  object-fit: cover;
}

.qv-thumbnails {
  position: absolute;
  bottom: var(--sp-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--sp-2);
}

.qv-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--ease-fast);
  opacity: 0.7;
}

.qv-thumb.active,
.qv-thumb:hover {
  border-color: var(--pink-vibrant);
  opacity: 1;
}

.qv-gallery-badges {
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.qv-content {
  padding: var(--sp-8) var(--sp-8);
  display: flex;
  flex-direction: column;
}

.qv-category {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose-gold);
  margin-bottom: var(--sp-2);
}

.qv-name {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text-dark);
  line-height: var(--leading-snug);
  margin-bottom: var(--sp-2);
}

.qv-sku {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  color: var(--text-placeholder);
  margin-bottom: var(--sp-4);
}

.qv-rating {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.qv-price-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.qv-price {
  font-family: var(--font-label);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-dark);
}

.qv-price-currency {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-light);
  vertical-align: top;
  line-height: 1.8;
}

.qv-stock-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 600;
  background: rgba(76, 175, 135, 0.12);
  color: #2E7D4B;
}

.qv-stock-badge.low {
  background: rgba(201, 149, 110, 0.12);
  color: var(--rose-gold-dark);
}

.qv-stock-badge.out {
  background: var(--cream-dark);
  color: var(--text-light);
}

.qv-description {
  font-size: var(--text-sm);
  color: var(--text-mid);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--sp-6);
  border-top: 1px solid var(--border-soft);
  padding-top: var(--sp-4);
}

.qv-actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: auto;
}

.qv-add-btn {
  flex: 1;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  background: var(--grad-pink);
  color: var(--white);
  font-family: var(--font-label);
  font-weight: 600;
  font-size: var(--text-sm);
  border: none;
  cursor: pointer;
  transition: all var(--ease-med);
  box-shadow: var(--shadow-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
}

.qv-add-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.qv-wishlist-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  cursor: pointer;
  transition: all var(--ease-fast);
  flex-shrink: 0;
}

.qv-wishlist-btn:hover {
  border-color: var(--pink-vibrant);
  color: var(--pink-vibrant);
}

.qv-wishlist-btn.active {
  border-color: var(--pink-vibrant);
  color: var(--pink-vibrant);
  background: var(--blush-lightest);
}

.qv-qty-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.qv-qty-label {
  font-family: var(--font-label);
  font-size: var(--text-sm);
  color: var(--text-mid);
  font-weight: 500;
}

/* ── Payment Info Modal ──────────────────────────── */
#modal-payment .modal {
  width: min(520px, 95vw);
  padding: var(--sp-10) var(--sp-8);
  text-align: center;
}

.payment-modal-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--grad-blush);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-5);
  font-size: 32px;
}

.payment-modal-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: var(--sp-2);
}

.payment-modal-subtitle {
  color: var(--text-light);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-8);
}

.payment-steps {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.payment-step {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}

.payment-step-num {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--blush-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--pink-vibrant);
  flex-shrink: 0;
}

.payment-step-text h4 {
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.payment-step-text p {
  font-size: var(--text-sm);
  color: var(--text-light);
}

.payment-bank-card {
  background: var(--grad-blush);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  text-align: left;
  border: 1.5px solid var(--border-soft);
  margin-bottom: var(--sp-8);
}

.bank-card-label {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: var(--sp-3);
}

.bank-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: var(--text-sm);
}

.bank-card-row:last-child { border-bottom: none; }

.bank-card-row span:first-child { color: var(--text-light); }
.bank-card-row span:last-child {
  font-weight: 600;
  color: var(--text-dark);
  font-family: var(--font-label);
}

.payment-confirm-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-full);
  background: #25D366;
  color: var(--white);
  font-family: var(--font-label);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  cursor: pointer;
  transition: all var(--ease-med);
  box-shadow: 0 6px 24px rgba(37,211,102,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
}

.payment-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(37,211,102,0.45);
}

.payment-confirm-btn svg {
  width: 20px;
  height: 20px;
}

.payment-note {
  margin-top: var(--sp-4);
  font-size: var(--text-xs);
  color: var(--text-placeholder);
  text-align: center;
}

/* ── Notify Me Modal ─────────────────────────────── */
#modal-notify .modal {
  width: min(400px, 95vw);
  padding: var(--sp-10) var(--sp-8);
  text-align: center;
}

.notify-icon {
  font-size: 48px;
  margin-bottom: var(--sp-4);
}

.notify-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: var(--sp-2);
}

.notify-subtitle {
  font-size: var(--text-sm);
  color: var(--text-light);
  margin-bottom: var(--sp-6);
}

.notify-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  #modal-quick-view .modal {
    grid-template-columns: 1fr;
    max-width: 440px;
  }

  .qv-main-img {
    min-height: 260px;
  }

  .qv-content {
    padding: var(--sp-6);
    padding-bottom: 90px; /* Space for sticky actions */
  }

  .qv-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--sp-4) var(--sp-6);
    background: linear-gradient(0deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0.95) 80%, rgba(255,255,255,0) 100%);
    backdrop-filter: blur(8px);
    z-index: 10;
    margin: 0 -var(--sp-6) -var(--sp-6) -var(--sp-6); /* offset modal padding */
  }

  .qv-name {
    font-size: var(--text-2xl);
  }

  #modal-payment .modal {
    padding: var(--sp-8) var(--sp-5);
  }
}

@media (max-width: 480px) {
  .modal {
    border-radius: var(--radius-lg);
  }
}

/* ══ POPUP OFFER (First-Time Visitor Welcome) ════════════════ */
#popup-offer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(30, 10, 20, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#popup-offer-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.popup-offer-card {
  position: relative;
  width: min(780px, 96vw);
  max-height: 92vh;
  border-radius: 28px;
  background: var(--white);
  box-shadow: 0 32px 80px rgba(180, 80, 120, 0.22), 0 8px 30px rgba(0,0,0,0.14);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  animation: popupSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes popupSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Close button ─────────────────────────────────── */
.popup-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  color: #888;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.popup-close:hover {
  background: #fff;
  color: var(--pink-vibrant);
  transform: scale(1.1);
}

/* ── Left: image ──────────────────────────────────── */
.popup-offer-img {
  width: 100%;
  height: 100%;
  min-height: 400px;
  object-fit: cover;
  display: block;
}

/* ── Right: content ───────────────────────────────── */
.popup-offer-content {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-4);
  background: linear-gradient(145deg, #fff9fb 0%, #fff 100%);
}

.popup-offer-eyebrow {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose-gold);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.popup-offer-eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 2px;
  background: var(--grad-pink);
  border-radius: 2px;
}

.popup-offer-title {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 64px);
  font-weight: 800;
  line-height: 1;
  background: var(--grad-pink);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: var(--sp-1) 0;
}

.popup-offer-subtitle {
  font-size: var(--text-sm);
  color: var(--text-mid);
  line-height: var(--leading-relaxed);
}

.popup-offer-subtitle strong {
  color: var(--text-dark);
  font-family: var(--font-label);
  background: var(--blush-lightest);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--blush-mid);
}

.popup-offer-input-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}

.popup-offer-input-row .form-input {
  padding: 13px 18px;
  font-size: var(--text-sm);
}

.popup-offer-input-row .btn {
  padding: 14px 24px;
  font-size: var(--text-sm);
}

.popup-offer-skip {
  font-size: var(--text-xs);
  color: var(--text-placeholder);
  text-align: center;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
  margin-top: var(--sp-1);
}

.popup-offer-skip:hover {
  color: var(--text-light);
}

.popup-offer-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  font-size: 11px;
  color: var(--text-placeholder);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-soft);
  margin-top: auto;
}

.popup-offer-trust span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .popup-offer-card {
    grid-template-columns: 1fr;
    max-width: 480px;
    max-height: 95dvh;
    overflow-y: auto;
  }

  .popup-offer-img {
    min-height: 200px;
    max-height: 220px;
  }

  .popup-offer-content {
    padding: 32px 28px;
  }

  .popup-offer-title {
    font-size: clamp(32px, 10vw, 48px);
  }

  /* Quick View Modal Mobile Fix */
  #modal-quick-view .modal {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    /* Ensure modal doesn't stretch to 95dvh unnecessarily */
    max-height: 85vh;
  }

  .qv-gallery {
    min-height: unset;
    height: 40vh; /* Keeps image prominent */
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
  }

  .qv-main-img {
    min-height: unset; /* Removes desktop 380px restriction */
  }

  .qv-content {
    padding: var(--sp-4) var(--sp-4) var(--sp-5) var(--sp-4);
  }

  /* Compact text spacing to reduce bottom height */
  .qv-category { margin-bottom: var(--sp-1); font-size: 10px; }
  .qv-name { margin-bottom: var(--sp-1); font-size: 20px; line-height: 1.1; } /* Reduced from 24px */
  .qv-price { font-size: 22px; } /* Slightly reduced font size for price */
  .qv-sku { margin-bottom: var(--sp-2); }
  
  /* Hide reviews on mobile */
  .qv-rating { display: none; }
  
  .qv-price-row { margin-bottom: var(--sp-3); }
  
  .qv-description { 
    margin-bottom: var(--sp-3); 
    font-size: 13px; 
    /* Truncate long descriptions to 2 lines on mobile */
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    line-clamp: 2;
    -webkit-box-orient: vertical; 
    overflow: hidden; 
  }
  
  /* Put Qty, Add to Cart, and Wishlist on the same line */
  .qv-controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
  }
  
  .qv-qty-row { 
    margin-bottom: 0; 
    flex-shrink: 0;
  }
  
  .qv-actions {
    margin-top: 0;
    gap: var(--sp-2);
    justify-content: flex-end;
    margin-right: -16px; /* Pushed further right per user request */
  }
  
  /* Make Add to Cart button a small icon button like product cards */
  .qv-add-btn {
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .qv-add-btn span:not(.cart-icon) {
    display: none;
  }
  
  .qv-wishlist-btn {
    width: 44px;
    height: 44px;
  }
}
