/* ============================================
   Rabih Management — Global Design System v2
   Primary: #001f3f (Navy)  |  Accent: #FFD700 (Gold)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Variables ─── */
:root {
  /* Brand Colors */
  --navy:        #001f3f;
  --navy-light:  #002d5a;
  --navy-medium: #003d7a;
  --navy-faint:  #e8f0fa;

  --gold:        #FFD700;
  --gold-dark:   #c9a800;
  --gold-deeper: #9a7c00;
  --gold-light:  #fff3a0;
  --gold-faint:  #fffbe6;

  /* Neutrals */
  --white:    #ffffff;
  --gray-50:  #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;

  /* Semantic */
  --text-primary:   #001f3f;
  --text-secondary: #3a5070;
  --text-muted:     #6c757d;

  /* Shadows */
  --shadow-sm:   0 2px 8px rgba(0,31,63,0.07);
  --shadow-md:   0 6px 24px rgba(0,31,63,0.12);
  --shadow-lg:   0 12px 48px rgba(0,31,63,0.16);
  --shadow-gold: 0 4px 20px rgba(255,215,0,0.3);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  /* Transition */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Tajawal', 'Inter', sans-serif;
  background: var(--gray-50);
  color: var(--text-primary);
  direction: rtl;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; font-family: inherit; }

/* ─── Typography ─── */
h1 { font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 900; letter-spacing: -0.5px; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: clamp(1rem, 2vw, 1.3rem); font-weight: 600; }

/* ─── Animated Particles ─── */
.particles-container {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
}
.particle {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,0.12), transparent 70%);
  animation: floatParticle linear infinite;
}
.particle:nth-child(1) { width: 400px; height: 400px; top:  5%; right: -10%; animation-duration: 20s; }
.particle:nth-child(2) { width: 250px; height: 250px; bottom: 10%; left: 5%;  animation-duration: 26s; animation-delay: -5s; }
.particle:nth-child(3) { width: 180px; height: 180px; top: 55%; right: 25%; animation-duration: 17s; animation-delay: -9s; }
.particle:nth-child(4) { width: 300px; height: 300px; top: -8%; left: 18%;  animation-duration: 22s; animation-delay: -3s; }
.particle:nth-child(5) { width: 220px; height: 220px; bottom: 3%; right: 12%; animation-duration: 28s; animation-delay: -7s; }
@keyframes floatParticle {
  0%,100% { transform: translate(0,0) scale(1); opacity:.4; }
  25% { transform: translate(30px,-40px) scale(1.1); opacity:.6; }
  50% { transform: translate(-20px,20px) scale(.9); opacity:.3; }
  75% { transform: translate(15px,30px) scale(1.05); opacity:.5; }
}

/* ─── Gold CTA Button ─── */
.btn-gold {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 18px 44px;
  background: var(--gold);
  color: var(--navy);
  font-size: 1.1rem; font-weight: 800;
  border-radius: var(--radius-xl);
  transition: var(--transition);
  box-shadow: var(--shadow-gold);
  position: relative; overflow: hidden;
  letter-spacing: 0.3px;
}
.btn-gold::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(110%);
  transition: 0.55s ease;
}
.btn-gold:hover::before { transform: translateX(-110%); }
.btn-gold:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(255,215,0,0.5);
  background: #ffe033;
}
.btn-gold svg { transform: rotate(180deg); }

/* ─── Beta Alert Box ─── */
.beta-alert {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,215,0,0.07);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 16px 28px;
  max-width: 580px;
  margin: 0 auto;
  animation: alertGlow 3s ease-in-out infinite;
}
.beta-alert .alert-icon { font-size: 1.5rem; flex-shrink: 0; animation: rocketBounce 2s ease-in-out infinite; }
.beta-alert p { font-size: 0.93rem; color: var(--navy); line-height: 1.6; font-weight: 500; }
.beta-alert strong { color: var(--gold-deeper); }

@keyframes alertGlow {
  0%,100% { box-shadow: 0 0 0 rgba(255,215,0,0); border-color: var(--gold); }
  50% { box-shadow: 0 0 20px rgba(255,215,0,0.25); border-color: #ffe033; }
}
@keyframes rocketBounce {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ─── Glass / White Card ─── */
.glass-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.glass-card:hover {
  border-color: var(--gold);
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

/* ─── Utilities ─── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-gold { color: var(--gold-dark); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .beta-alert { flex-direction: column; text-align: center; padding: 16px 20px; }
  .btn-gold { width: 100%; justify-content: center; padding: 16px 30px; }
}
@media (max-width: 480px) {
  .glass-card { padding: 24px 16px; }
}

/* ── STACKED CARDS VARIANT UI ── */
.stacked-base-wrapper {
  position: relative;
  flex-shrink: 0;
  width: max-content;
}

.stacked-base-card {
  position: relative;
  z-index: 2;
  box-shadow: 
    -4px -4px 0px rgba(0,0,0,0.04), 
    -8px -8px 0px rgba(0,0,0,0.02) !important;
  border-right: 3px solid var(--navy) !important;
}

.btn-expand-variants {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: var(--navy);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: 'Inter', 'Almarai', sans-serif;
  font-weight: bold;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-expand-variants:hover {
  background: #1a365d;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn-expand-variants.btn-expanded {
  background: #e2e8f0;
  color: #4a5568;
}

.stacked-variant-container {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.stacked-variant-container::-webkit-scrollbar {
  height: 6px;
}
.stacked-variant-container::-webkit-scrollbar-track {
  background: #f1f1f1; 
  border-radius: 4px;
}
.stacked-variant-container::-webkit-scrollbar-thumb {
  background: #cbd5e0; 
  border-radius: 4px;
}
.stacked-variant-container::-webkit-scrollbar-thumb:hover {
  background: #a0aec0; 
}

.variants-expanded-list > div {
  scroll-snap-align: start;
}

@media (max-width: 600px) {
  .stacked-variant-container {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 10px !important;
  }
  .stacked-base-wrapper {
    width: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .stacked-base-card {
    min-width: 80% !important;
  }
  .variants-expanded-list {
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    width: 100%;
  }
  .mini-variant-card {
    min-width: 48% !important;
    max-width: 48% !important;
    flex-grow: 1;
  }
}

/* ── NEW MODAL-BASED STACKED UI ── */
.has-variants-stacked {
  position: relative;
  z-index: 2;
}

/* Create the stacked effect using pseudo-elements */
.has-variants-stacked::before,
.has-variants-stacked::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  z-index: -1;
  transition: all 0.3s ease;
}

.has-variants-stacked::before {
  transform: translate(-4px, -4px);
  box-shadow: -2px -2px 5px rgba(0,0,0,0.05);
}

.has-variants-stacked::after {
  transform: translate(-8px, -8px);
  box-shadow: -4px -4px 10px rgba(0,0,0,0.05);
  z-index: -2;
}

.has-variants-stacked:hover::before {
  transform: translate(-6px, -6px);
}

.has-variants-stacked:hover::after {
  transform: translate(-12px, -12px);
}

/* Mobile optimizations */
@media (max-width: 600px) {
  /* Make cards a bit smaller */
  .product-card {
    min-width: 150px;
    padding: 8px;
  }
  .product-image {
    height: 140px;
  }
  .name-normal, .name-sm, .name-xs {
    font-size: 0.85rem;
    min-height: 40px;
  }
  .btn-primary {
    font-size: 0.8rem !important;
    padding: 5px !important;
  }
  /* For the mini cards inside the modal */
  .mini-variant-card {
    min-width: 30% !important;
    max-width: 32% !important;
    padding: 4px !important;
  }
  .mini-variant-card .product-image {
    height: 90px !important;
  }
  .mini-variant-card .name-sm {
    font-size: 0.6rem !important;
    min-height: 25px !important;
  }
}

/* Modal Styles for Customer View */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(3px);
}
.modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #e2e8f0;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--navy);
  font-weight: 800;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #718096;
}
.modal-close:hover {
  color: #e53e3e;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
