/**
 * Ajva's Chocolates - Premium Luxury Gifting
 * Base Stylesheet: Design Tokens, Typography, Reset & Shared Components
 * Developed by Damerax Cloud Solutions
 */

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

:root {
  /* Master Brief Color Palette - Romantic, Celebratory, Bright Ivory & Gold */
  --c-warm-ivory: #FFF9F5;
  --c-champagne-white: #FFFCFA;
  --c-blush-pink: #F5D7D8;
  --c-rose-pink: #E8B5BE;
  --c-dusty-rose: #B96E80;
  --c-raspberry-rose: #A84F68;
  --c-lavender: #E8DDF5;
  --c-soft-purple: #B9A0D8;
  --c-royal-purple: #76518E;
  --c-champagne-gold: #D8B66A;
  --c-premium-gold: #B9944E;
  --c-deep-choc: #49302D;
  --c-soft-text: #69504C;
  --c-muted-text: #8E7774;
  --c-border-subtle: #F2E4E4;
  --c-border-gold: #E8D7B0;
  --c-card-bg: #FFFFFF;
  --c-surface-soft: #FFF5F2;
  --c-surface-lavender: #F8F4FD;
  --c-success: #2E7D32;
  --c-whatsapp: #25D366;
  --c-whatsapp-dark: #1EBE5D;

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Elevation Shadows - Soft, warm, luxury */
  --shadow-xs: 0 2px 6px rgba(73, 48, 45, 0.04);
  --shadow-sm: 0 4px 12px rgba(73, 48, 45, 0.06);
  --shadow-md: 0 8px 24px rgba(73, 48, 45, 0.08);
  --shadow-lg: 0 16px 36px rgba(73, 48, 45, 0.12);
  --shadow-gold: 0 8px 24px rgba(185, 148, 78, 0.22);
  --shadow-rose: 0 8px 24px rgba(168, 79, 104, 0.18);

  /* Transitions */
  --t-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --t-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --t-smooth: 0.45s cubic-bezier(0.16, 1, 0.3, 1);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--c-warm-ivory);
  color: var(--c-deep-choc);
}

body {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--c-soft-text);
  background-color: var(--c-warm-ivory);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* Strict Brand Constraint: NEVER USE DARK FULL-WIDTH BACKGROUNDS */
header, nav, main, footer, section, div, article {
  /* Prevent dark inversion */
  color-scheme: light;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  color: var(--c-deep-choc);
  font-weight: 600;
  line-height: 1.25;
}

h1 { font-size: clamp(2rem, 3.5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 2.5vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 1.8vw, 1.6rem); }
h4 { font-size: 1.2rem; }

/* Global Utilities */
.container {
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.text-gold { color: var(--c-premium-gold) !important; }
.text-rose { color: var(--c-raspberry-rose) !important; }
.text-purple { color: var(--c-royal-purple) !important; }
.text-muted { color: var(--c-muted-text) !important; }
.text-center { text-align: center; }

.serif { font-family: var(--font-serif); }
.italic { font-style: italic; }

.section-padding {
  padding-top: clamp(2.5rem, 5vw, 5rem);
  padding-bottom: clamp(2.5rem, 5vw, 5rem);
}

.section-header {
  margin-bottom: clamp(2rem, 3.5vw, 3rem);
}

.section-subtitle {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--c-premium-gold);
  margin-bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-subtitle::before,
.section-subtitle::after {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--c-champagne-gold);
}

.section-desc {
  max-width: 600px;
  margin: 0.75rem auto 0;
  color: var(--c-soft-text);
  font-size: 0.95rem;
}

/* ========================================================
   Buttons
   ======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-normal);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--c-raspberry-rose), var(--c-royal-purple));
  color: #FFFFFF;
  box-shadow: var(--shadow-rose);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #964259, #643f7a);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(168, 79, 104, 0.28);
  color: #FFFFFF;
}

.btn-gold {
  background: linear-gradient(135deg, var(--c-champagne-gold), var(--c-premium-gold));
  color: #FFFFFF;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #c4a154, #a48039);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(185, 148, 78, 0.32);
  color: #FFFFFF;
}

.btn-secondary {
  background: var(--c-champagne-white);
  color: var(--c-deep-choc);
  border: 1px solid var(--c-border-subtle);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--c-blush-pink);
  border-color: var(--c-rose-pink);
  color: var(--c-raspberry-rose);
}

.btn-outline {
  background: transparent;
  color: var(--c-deep-choc);
  border: 1.5px solid var(--c-border-gold);
}

.btn-outline:hover {
  background: var(--c-warm-ivory);
  border-color: var(--c-premium-gold);
  color: var(--c-premium-gold);
}

.btn-whatsapp {
  background: #25D366;
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
  background: #1EBE5D;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.45);
  color: #FFFFFF;
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 0.95rem 2.2rem;
  font-size: 1.05rem;
}

.btn-full {
  width: 100%;
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-champagne-white);
  border: 1px solid var(--c-border-subtle);
  color: var(--c-deep-choc);
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
}

.btn-icon:hover {
  background: var(--c-blush-pink);
  border-color: var(--c-rose-pink);
  color: var(--c-raspberry-rose);
  transform: scale(1.05);
}

/* ========================================================
   Badges
   ======================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-bestseller {
  background: #FFF4E5;
  color: #B9770E;
  border: 1px solid #FFE0B2;
}

.badge-featured {
  background: var(--c-lavender);
  color: var(--c-royal-purple);
  border: 1px solid var(--c-soft-purple);
}

.badge-discount {
  background: #FEECEB;
  color: #C0392B;
  border: 1px solid #FADBD8;
}

.badge-new {
  background: #E8F8F5;
  color: #117864;
  border: 1px solid #A3E4D7;
}

.badge-status {
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
}

.badge-status-pending { background: #FFF8E1; color: #B78103; border: 1px solid #FFE082; }
.badge-status-confirmed { background: #E3F2FD; color: #1565C0; border: 1px solid #90CAF9; }
.badge-status-preparing { background: #EDE7F6; color: #5E35B1; border: 1px solid #D1C4E9; }
.badge-status-shipped { background: #E0F2F1; color: #00695C; border: 1px solid #80CBC4; }
.badge-status-delivered { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
.badge-status-cancelled { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; }

/* ========================================================
   Form Controls
   ======================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--c-deep-choc);
  margin-bottom: 0.45rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--c-champagne-white);
  border: 1.5px solid var(--c-border-subtle);
  border-radius: var(--radius-sm);
  color: var(--c-deep-choc);
  font-size: 0.92rem;
  outline: none;
  transition: all var(--t-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--c-raspberry-rose);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(168, 79, 104, 0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

/* ========================================================
   Flash Alerts & Banners
   ======================================================== */
.alert {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.alert-success {
  background: #E8F5E9;
  color: #1B5E20;
  border: 1px solid #C8E6C9;
}

.alert-error {
  background: #FFEBEE;
  color: #B71C1C;
  border: 1px solid #FFCDD2;
}

/* ========================================================
   Floating WhatsApp Button
   ======================================================== */
.floating-whatsapp {
  position: fixed;
  bottom: 84px; /* clears mobile nav */
  right: 18px;
  z-index: 990;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: #25D366;
  border-radius: 50%;
  color: #FFFFFF;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  transition: all var(--t-normal);
  text-decoration: none;
}

.floating-whatsapp:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.55);
}

.floating-whatsapp svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* Pulse badge */
.floating-whatsapp::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #FF3B30;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* ========================================================
   PWA Install Toast / Modal
   ======================================================== */
.pwa-install-banner {
  position: fixed;
  bottom: 78px;
  left: 12px;
  right: 12px;
  max-width: 420px;
  margin: 0 auto;
  background: var(--c-champagne-white);
  border: 1px solid var(--c-border-gold);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-install-banner.show {
  transform: translateY(0);
  opacity: 1;
}

.pwa-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
}

.pwa-banner-text h4 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--c-deep-choc);
  margin-bottom: 2px;
}

.pwa-banner-text p {
  font-size: 0.76rem;
  color: var(--c-muted-text);
  line-height: 1.3;
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ========================================================
   Quick Quantity Controls
   ======================================================== */
.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--c-border-subtle);
  border-radius: var(--radius-full);
  background: var(--c-champagne-white);
  padding: 2px 4px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--c-deep-choc);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  transition: background var(--t-fast);
}

.qty-btn:hover {
  background: var(--c-blush-pink);
  color: var(--c-raspberry-rose);
}

.qty-input {
  width: 40px;
  text-align: center;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--c-deep-choc);
  outline: none;
}

/* Rating Stars */
.rating-stars {
  display: inline-flex;
  gap: 3px;
  color: #F5B041;
  font-size: 0.88rem;
}

/* ========================================================
   Product Cards Unconditional Base Visibility
   ======================================================== */
.desktop-product-card,
.product-card {
  opacity: 1;
  visibility: visible;
}

/* Shared Responsive Form & Row Utilities */
.form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cart-item-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--c-border-subtle);
}

/* ========================================================
   AJVA'S LUXURY HEARTS PRELOADER (1-Second Boutique Entrance)
   ======================================================== */
.ajva-preloader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #FFF9F5 0%, #FFF4F0 50%, #FAF0F5 100%);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.45s ease;
  pointer-events: auto;
}

.ajva-preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  max-width: 360px;
}

.preloader-heart-wrap {
  position: relative;
  width: 120px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.preloader-dual-hearts {
  filter: drop-shadow(0 8px 20px rgba(168, 79, 104, 0.25));
  animation: ajvaHeartPulse 1.2s ease-in-out infinite;
}

.preloader-dual-hearts .heart-gold {
  fill: #D8B66A;
  opacity: 0.88;
}

.preloader-dual-hearts .heart-rose {
  fill: #E8B5BE;
  opacity: 0.92;
}

@keyframes ajvaHeartPulse {
  0% { transform: scale(1); }
  14% { transform: scale(1.15); }
  28% { transform: scale(1); }
  42% { transform: scale(1.12); }
  70% { transform: scale(1); }
  100% { transform: scale(1); }
}

.sparkle-heart {
  position: absolute;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  animation: ajvaSparkleFloat 1.2s ease-in-out infinite;
}

.sparkle-heart.sh-1 {
  top: 0;
  left: 10px;
  animation-delay: 0.1s;
}

.sparkle-heart.sh-2 {
  top: 10px;
  right: 12px;
  font-size: 16px;
  animation-delay: 0.35s;
}

.sparkle-heart.sh-3 {
  bottom: 5px;
  left: 30px;
  animation-delay: 0.6s;
}

@keyframes ajvaSparkleFloat {
  0% { transform: translateY(10px) scale(0.6); opacity: 0; }
  50% { opacity: 0.9; }
  100% { transform: translateY(-24px) scale(1.1); opacity: 0; }
}

.preloader-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: #49302D;
  margin: 0 0 0.35rem 0;
  letter-spacing: 2px;
  font-weight: 600;
}

.preloader-sub {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: #B9944E;
  margin: 0 0 1.5rem 0;
  font-weight: 500;
}

.preloader-progress-track {
  width: 140px;
  height: 3px;
  background: rgba(216, 182, 106, 0.25);
  border-radius: 99px;
  overflow: hidden;
  margin: 0 auto;
}

.preloader-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #D8B66A, #A84F68);
  border-radius: 99px;
  animation: ajvaProgressFill 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes ajvaProgressFill {
  0% { width: 0%; }
  100% { width: 100%; }
}
