/* ========================================
   BLUECART MASTER CSS SYSTEM v3.0
   Complete unified theme with all styles included
   NO @import dependencies - everything is here
   ======================================== */

/* ==========================================
   PHASE 1: CORE VARIABLES
   ========================================== */
:root {
  /* BRAND COLORS */
  --bluecart-primary: #2E86C1;
  --bluecart-primary-dark: #1B4F72;
  --bluecart-primary-light: #5DADE2;
  --bluecart-cyan: #00F2FE;
  --bluecart-cyan-light: #4FACFE;
  --bluecart-secondary: #F39C12;
  --bluecart-success: #27AE60;
  --bluecart-danger: #E74C3C;
  --bluecart-warning: #F39C12;
  
  /* GRADIENTS */
  --bluecart-gradient: linear-gradient(135deg, var(--bluecart-primary) 0%, var(--bluecart-cyan) 100%);
  --bluecart-gradient-reverse: linear-gradient(135deg, var(--bluecart-cyan) 0%, var(--bluecart-primary) 100%);
  --bluecart-gradient-subtle: linear-gradient(135deg, rgba(46, 134, 193, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
  --gradient-background-light: linear-gradient(135deg, var(--slate-50) 0%, rgba(46, 134, 193, 0.05) 100%);
  
  /* NEUTRAL COLORS */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  
  /* SEMANTIC COLORS */
  --text-primary: var(--slate-800);
  --text-secondary: var(--slate-600);
  --text-muted: var(--slate-500);
  --text-light: #ffffff;
  --text-white: #ffffff;
  --bg-primary: #ffffff;
  --bg-secondary: var(--slate-50);
  
  /* TYPOGRAPHY */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  
  /* SPACING */
  --spacing-0: 0;
  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-3: 0.75rem;
  --spacing-4: 1rem;
  --spacing-5: 1.25rem;
  --spacing-6: 1.5rem;
  --spacing-7: 1.75rem;
  --spacing-8: 2rem;
  --spacing-10: 2.5rem;
  --spacing-12: 3rem;
  --spacing-16: 4rem;
  --spacing-20: 5rem;
  
  /* LINE HEIGHTS */
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  
  /* BORDER RADIUS */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;
  --border-radius: var(--radius-lg);
  --border-radius-lg: var(--radius-xl);
  --border-radius-2xl: var(--radius-2xl);
  
  /* SHADOWS */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Z-INDEX LAYERS */
  --z-base: 1;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
  --z-navbar: 1100;
  /* LAYOUT */
  --navbar-height: 70px;  /* Unified navbar height */
  --container-xl: 1200px;
  
  /* GLASS EFFECTS */
  --glass: rgba(255,255,255,0.60);
  --glass-strong: rgba(255,255,255,0.88);
  
  /* OVERLAYS */
  --overlay-heavy: rgba(15,23,42,0.60);
  --overlay-light: rgba(15,23,42,0.08);
  
  /* Helper alpha / focus tokens */
  --bluecart-primary-alpha: rgba(46, 134, 193, 0.12);
  --bluecart-focus: rgba(46, 134, 193, 0.24);
}

/* ==========================================
   LEGACY COMPATIBILITY VARIABLES
   Keep old --color-* names mapped to the canonical tokens
   to allow in-place edits across the codebase while
   migrating to the new `--bluecart-` and `--text-` system.
   ========================================== */
:root {
  /* Text */
  --color-text: var(--text-primary);
  --color-text-primary: var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-text-muted: var(--text-muted);
  --color-text-light: var(--text-light);
  --text-light-secondary: rgba(255,255,255,0.9);
  --text-tertiary: var(--slate-400);

  /* Brand */
  --color-primary: var(--bluecart-primary);
  --color-primary-dark: var(--bluecart-primary-dark);
  --color-primary-light: var(--bluecart-primary-light);
  --color-secondary: var(--bluecart-secondary);
  --color-accent: var(--bluecart-cyan);

  /* Semantic */
  --color-success: var(--bluecart-success);
  --color-danger: var(--bluecart-danger);
  --color-warning: var(--bluecart-warning);
  --color-info: var(--bluecart-cyan);

  /* Backgrounds */
  --color-bg-primary: var(--bg-primary);
  --color-bg-secondary: var(--bg-secondary);
  --color-background: var(--bg-primary);
  --color-background-light: var(--bg-secondary);
  --bg-glass: var(--glass);

  /* Borders */
  --color-border: var(--slate-200);
  --color-border-light: var(--slate-100);
  --border-1: var(--slate-200);
}

/* ==========================================
   PHASE 2: RESET & BASE STYLES
   ========================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  font-family: var(--font-family);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Global focus-visible ring for keyboard users */
:where(a, button, [role="button"], input, select, textarea, summary, .btn, .section-action-btn):focus-visible {
  outline: 3px solid var(--bluecart-focus, rgba(46, 134, 193, 0.35));
  outline-offset: 3px;
  border-radius: 8px;
}

/* ==========================================
   PHASE 3: LAYOUT UTILITIES & GRID SYSTEM
   ========================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-4);
}

/* Basic Flex Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-4 {
  gap: var(--spacing-4);
}

.gap-6 {
  gap: var(--spacing-6);
}

.gap-8 {
  gap: var(--spacing-8);
}

/* Enhanced Grid System - Integrated from grid.css */
.grid {
  display: grid;
}

.inline-grid {
  display: inline-grid;
}

/* Grid Templates - Standard Columns */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

/* Auto-fit Grid Columns */
.grid-auto-fit { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-auto-fit-sm { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-auto-fit-md { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-auto-fit-lg { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }

/* Grid Gap Utilities */
.grid-gap-4 { gap: var(--spacing-4); }
.grid-gap-6 { gap: var(--spacing-6); }
.grid-gap-8 { gap: var(--spacing-8); }

/* Column Spanning */
.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-full { grid-column: 1 / -1; }

/* ==========================================
   PHASE 4: COMPONENT STYLES - NAVBAR
   ========================================== */
/* 
  NAVBAR STYLES COMPLETELY DELEGATED TO components/navbar.css
  This prevents conflicts and ensures component-based styling
  NO navbar definitions here to avoid specificity conflicts
*/

/* Remove all navbar-related styles to prevent conflicts with components/navbar.css */
/* Navbar styles are now 100% handled by components/navbar.css */

/* Only keep the navbar height variable for global layout calculations */
:root {
  /* ... other variables ... */
  --navbar-height: 70px;  /* Unified navbar height for layout calculations */
  /* ... other variables ... */
}

/* ==========================================
   PHASE 5: BUTTON SYSTEM
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  padding: var(--spacing-3) var(--spacing-6);
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--bluecart-gradient);
  color: var(--text-light);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--bluecart-gradient-reverse);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-primary);
  color: var(--bluecart-primary);
  border: 2px solid var(--bluecart-primary);
}

.btn-secondary:hover {
  background: var(--bluecart-primary);
  color: var(--text-light);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--bluecart-danger);
  color: var(--text-light);
}

.btn-danger:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

.btn-success {
  background: var(--bluecart-success);
  color: var(--text-light);
}

.btn-success:hover {
  background: #229954;
  transform: translateY(-1px);
}

/* Hero membership CTA */
.btn-member-hero {
  background: linear-gradient(135deg, #4F46E5 0%, #2E86C1 60%, #00F2FE 100%);
  color: var(--text-light);
  border: 0;
  box-shadow: 0 10px 20px rgba(46, 134, 193, 0.25), 0 6px 10px rgba(79, 70, 229, 0.18);
  position: relative;
}
.btn-member-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 120% at 0% 0%, rgba(255,255,255,0.25) 0%, transparent 50%),
              radial-gradient(120% 120% at 100% 100%, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.btn-member-hero:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(46, 134, 193, 0.35), 0 8px 18px rgba(79, 70, 229, 0.25);
  filter: brightness(1.02);
}
.btn-member-hero:active { transform: translateY(-1px); }
.btn-member-hero .btn-icon { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25)); transition: transform .25s ease; }
.btn-member-hero:hover .btn-icon { transform: translateX(2px); }

/* Extended button variants & sizes */
.btn-outline { background: transparent; color: var(--bluecart-primary); border:2px solid var(--bluecart-primary); box-shadow:none; }
.btn-outline:hover { background: var(--bluecart-primary); color: var(--text-light); }
.btn-ghost { background: transparent; color: var(--text-primary); box-shadow:none; }
.btn-ghost:hover { background: var(--slate-100); }
.btn-soft { background: var(--bluecart-primary-alpha, rgba(46,134,193,.12)); color: var(--bluecart-primary); }
.btn-soft:hover { background: var(--bluecart-primary-alpha-strong, rgba(46,134,193,.2)); }
.btn-warning { background: var(--bluecart-warning); color: var(--text-light); }
.btn-warning:hover { filter: brightness(.95); transform: translateY(-1px); }
.btn-lg { padding: var(--spacing-4) var(--spacing-7); font-size: var(--font-size-base); border-radius: var(--radius-xl); }
.btn-sm { padding: var(--spacing-2) var(--spacing-4); font-size: var(--font-size-xs); border-radius: var(--radius-md); }
.btn-icon-only { padding: var(--spacing-2); width:40px; height:40px; justify-content:center; }
.btn:focus-visible { outline:3px solid var(--bluecart-focus, var(--bluecart-primary)); outline-offset:2px; }
.btn[disabled], .btn:disabled { opacity:.55; cursor:not-allowed; transform:none; box-shadow:none; }

/* Badge component */
.badge { display:inline-flex; align-items:center; gap:.35rem; padding:.35rem .65rem; font-size: .65rem; font-weight:700; text-transform:uppercase; letter-spacing:.75px; border-radius:999px; background: var(--slate-200); color: var(--text-primary); line-height:1; }
.badge-icon { font-size:.9em; }
.badge-primary { background: var(--bluecart-gradient); color: var(--text-light); }
.badge-outline { background:transparent; border:1px solid var(--slate-300); }
.badge-soft { background: var(--bluecart-primary-alpha, rgba(46,134,193,.12)); color: var(--bluecart-primary); }
.badge-success { background: var(--bluecart-success); color: var(--text-light); }
.badge-warning { background: var(--bluecart-warning); color: var(--text-light); }
.badge-danger { background: var(--bluecart-danger); color: var(--text-light); }

/* Hero badge specialization */
.hero-badge { display:inline-flex; align-items:center; gap:.5rem; background: rgba(255,255,255,0.12); backdrop-filter: blur(6px); padding:.55rem .9rem; border:1px solid rgba(255,255,255,0.2); border-radius: 14px; font-size:.7rem; letter-spacing:.8px; font-weight:700; color: var(--text-light); margin-bottom:1rem; box-shadow:0 4px 18px -4px rgba(0,0,0,.25); animation: fadeInUp .6s ease both; }
.hero-badge .badge-icon { font-size:1rem; }

/* ==========================================
   PHASE 6: CARD SYSTEM
   Unified card visuals are the canonical source of truth.
   We also map common page-level card selectors here so pages
   inherit the same look without immediate per-file refactors.
   ========================================== */
.card,
.product-card,
.brand-card,
.category-card,
.feature-card,
.benefit-card,
.brand-item,
.market-card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover,
.product-card:hover,
.brand-card:hover,
.category-card:hover,
.feature-card:hover,
.benefit-card:hover,
.brand-item:hover,
.market-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--bluecart-primary-light);
}

.card::before,
.product-card::before,
.brand-card::before,
.category-card::before,
.feature-card::before,
.benefit-card::before,
.brand-item::before,
.market-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--bluecart-gradient);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover::before,
.product-card:hover::before,
.brand-card:hover::before,
.category-card:hover::before,
.feature-card:hover::before,
.benefit-card:hover::before,
.brand-item:hover::before,
.market-card:hover::before {
  transform: scaleX(1);
}

/* Map common inner element names used across pages to the canonical
   card subcomponents so images, titles and actions keep consistent spacing */
.card-image,
.product-card .product-image,
.category-card .category-image,
.brand-card .brand-image,
.brand-item .image,
.market-card .product-image {
  width: 100%;
  /* height: 200px; -- Foundation only, let components override */
  object-fit: contain;      /* Foundation: show full image, no cropping */
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-4);
  background: var(--bg-secondary);
}

.card-title,
.product-card .product-title,
.category-card .category-name,
.brand-card .brand-name,
.brand-item .name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-2);
  line-height: 1.4;
}

.card-description,
.product-card .product-desc,
.category-card .category-description,
.brand-card .brand-desc {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  margin-bottom: var(--spacing-4);
}

.card-actions,
.product-card .product-actions,
.category-card .category-actions,
.brand-card .brand-actions {
  display: flex;
  gap: var(--spacing-3);
  margin-top: auto;
  flex-wrap: wrap;
}

/* ==========================================
   PHASE 7: HERO SECTION SYSTEM
   ========================================== */
.hero-section {
  background: var(--bluecart-gradient);
  color: var(--text-light);
  padding: var(--spacing-20) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--spacing-4);
}

.hero-title {
  font-size: var(--font-size-5xl);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--spacing-6);
  letter-spacing: -0.025em;
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-8);
  opacity: 0.9;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: var(--spacing-4);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--spacing-12);
}

/* Homepage hero dynamic elements */
.hero-image-container { position:relative; }
.hero-float-layer { position:absolute; inset:0; pointer-events:none; }
.float-item { position:absolute; font-size:1.6rem; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.25)); animation: floatWave 6s ease-in-out infinite; }
.float-item.veg { top:12%; left:6%; animation-duration:7s; }
.float-item.bread { top:55%; left:10%; animation-duration:6.2s; }
.float-item.cheese { top:22%; right:14%; animation-duration:7.4s; }
.float-item.milk { bottom:14%; right:12%; animation-duration:6.5s; }
@keyframes floatWave { 0%,100% { transform:translateY(0) rotate(0deg); } 50% { transform:translateY(-12px) rotate(6deg); } }
@media (prefers-reduced-motion:reduce){ .float-item { animation:none; } }

.grocery-bag { position:relative; background:linear-gradient(145deg,#fff 0%,#f5f7fa 50%,#eef2f7 100%); width:240px; height:240px; border-radius:28px; display:flex; align-items:center; justify-content:center; box-shadow:0 12px 48px -12px rgba(0,0,0,0.25); overflow:hidden; animation: bagHover 8s ease-in-out infinite; }
.grocery-bag .bag-inner { display:flex; gap:.6rem; font-size:2rem; animation: itemsDrift 5.5s ease-in-out infinite; }
@keyframes bagHover { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-10px); } }
@keyframes itemsDrift { 0%,100% { transform:translateY(0) rotate(0deg); } 50% { transform:translateY(-8px) rotate(-4deg); } }
@media (prefers-reduced-motion:reduce){ .grocery-bag, .grocery-bag .bag-inner { animation:none; } }

/* Product page hero variant reservations */
:root {
  --hero-height-default: 80vh;
  --hero-products-accent: var(--bluecart-primary);
  --hero-products-overlay: linear-gradient(135deg, rgba(2,6,23,0.65), rgba(2,6,23,0.35));
  --hero-products-pattern-opacity: 0.12;
}

.products-hero { position:relative; }
.products-hero .hero-overlay { position:absolute; inset:0; background: var(--hero-products-overlay); backdrop-filter: blur(4px); }
.products-hero.enhanced::after { content:""; position:absolute; inset:0; background:
  radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08), transparent 60%),
  radial-gradient(circle at 80% 70%, rgba(255,255,255,0.06), transparent 55%);
  mix-blend-mode:overlay; pointer-events:none; }
.products-hero.enhanced .hero-content { position:relative; z-index:2; }
.products-hero.enhanced .hero-floating-icon { position:absolute; font-size:3rem; opacity:.18; filter:blur(2px); animation: spinSlow 28s linear infinite; }
.products-hero.enhanced .icon-a { top:12%; left:8%; }
.products-hero.enhanced .icon-b { bottom:10%; right:12%; animation-direction:reverse; }
@keyframes spinSlow { from { transform:rotate(0deg); } to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce){ .products-hero.enhanced .hero-floating-icon { animation:none; } }

/* ==========================================
   PHASE 8: SECTION SYSTEM
   ========================================== */
.section {
  padding: var(--spacing-16) 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-12);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: var(--spacing-4);
  position: relative;
  display: inline-block;
  color: var(--text-primary);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--bluecart-primary);
  border-radius: 2px;
}

.section-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Section Backgrounds */
.section-primary {
  background: var(--bluecart-gradient);
  color: var(--text-light);
}

.section-primary .section-title {
  color: var(--text-light);
}

.section-primary .section-title::after {
  background: var(--text-light);
}

.section-primary .section-subtitle {
  color: rgba(255, 255, 255, 0.9);
}

.section-secondary {
  background: var(--bg-secondary);
}

.section-light {
  background: var(--bg-primary);
}

/* ==========================================
   PHASE 9: GRID SYSTEMS
   ========================================== */
.grid-system {
  display: grid;
  gap: var(--spacing-6);
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-auto-lg { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }

/* ==========================================
   PHASE 10: FORM SYSTEM
   ========================================== */
.form-group {
  margin-bottom: var(--spacing-4);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-2);
  font-weight: 500;
  color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--spacing-3);
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  transition: all 0.3s ease;
  background: var(--bg-primary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--bluecart-primary);
  box-shadow: 0 0 0 3px rgba(46, 134, 193, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* ==========================================
   PHASE 11: UTILITY CLASSES
   ========================================== */
.hidden { display: none !important; }
.visible { display: block !important; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--bluecart-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-success { color: var(--bluecart-success); }
.text-danger { color: var(--bluecart-danger); }

.bg-primary { background-color: var(--bluecart-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-light { background-color: var(--bg-primary); }
.bg-gradient { background: var(--bluecart-gradient); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.m-0 { margin: 0; }
.m-4 { margin: var(--spacing-4); }
.p-0 { padding: 0; }
.p-4 { padding: var(--spacing-4); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ==========================================
   PHASE 12: ANIMATIONS
   ========================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out;
}

.animate-slideInLeft {
  animation: slideInLeft 0.6s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ==========================================
   PHASE 13: RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--spacing-3);
  }
  
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  
  .hero-title {
    font-size: var(--font-size-3xl);
  }
  
  .navbar-nav {
    gap: var(--spacing-3);
  }
}

@media (max-width: 768px) {
  .grid-4,
  .grid-3,
  .grid-2 { 
    grid-template-columns: 1fr; 
  }
  
  .hero-title {
    font-size: var(--font-size-2xl);
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .navbar-container {
    flex-direction: column;
    gap: var(--spacing-4);
  }
  
  .navbar-nav {
    flex-direction: column;
    gap: var(--spacing-2);
  }
  
  .section {
    padding: var(--spacing-12) 0;
  }
  
  .hero-section {
    padding: var(--spacing-16) 0;
    min-height: 60vh;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--spacing-2);
  }
  
  .section {
    padding: var(--spacing-8) 0;
  }
  
  .section-title {
    font-size: var(--font-size-xl);
  }
  
  .hero-title {
    font-size: var(--font-size-xl);
  }
  
  .card {
    padding: var(--spacing-4);
  }
}

/* ==========================================
   LOADING CONFIRMATION
   ========================================== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--bluecart-success);
  z-index: 9999;
  animation: loadSuccess 1s ease-out forwards;
}

@keyframes loadSuccess {
  0% { 
    background: var(--bluecart-warning);
    transform: scaleX(0); 
  }
  100% { 
    background: var(--bluecart-success);
    transform: scaleX(1);
    opacity: 0;
  }
}

/* ...existing code... */
:root {
  /* ...existing tokens... */

  /* ===== LEGACY COMPATIBILITY & SEMANTIC ALIASES =====
    These map older `--color-*` names and a few semantic helpers
    to the canonical master tokens so the site remains visually
    intact while we migrate files incrementally. */
  --glass: rgba(255,255,255,0.60);
  --glass-strong: rgba(255,255,255,0.88);

  --overlay-heavy: rgba(15,23,42,0.60); /* slate-900 @ 60% */
  --overlay-light: rgba(15,23,42,0.08);

  --border-1: var(--slate-200);
  --border-2: rgba(15,23,42,0.06);

  /* Backwards-compatible aliases (common legacy names -> canonical tokens) */
  --color-border: var(--border-1);
  --color-border-light: var(--slate-100);
  --color-background: var(--color-bg-primary);
  --color-background-light: var(--color-bg-secondary);
  --color-text: var(--color-text-primary);
  --color-text-secondary: var(--text-secondary);

  --color-overlay-heavy: var(--overlay-heavy);
  --color-overlay-light: var(--overlay-light);

  --color-primary: var(--bluecart-primary);
  --color-accent: var(--bluecart-cyan);
  --color-danger: var(--bluecart-danger);
  --color-success: var(--bluecart-success);
  --color-warning: var(--bluecart-warning);
  --color-info: var(--bluecart-info);

  /* Minimal compatibility tokens used by some page-level CSS (membership, etc.)
    These ensure older per-page styles resolve variables when the larger
    unified theme file isn't loaded. Keep these small and conservative. */
  --gradient-primary: linear-gradient(135deg, var(--bluecart-primary) 0%, var(--bluecart-cyan) 100%);
  --container-xl: 1200px;
  --bg-glass: var(--glass);
  --text-light-secondary: rgba(255,255,255,0.9);
  --border-radius-2xl: var(--radius-2xl);
  --font-weight-black: 900;
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --transition-fast: 200ms ease-in-out;
  --transition-medium: 300ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  
  /* Page-specific variables (consolidated from individual page files) */
  --card-bg: var(--bg-primary);
  --card-radius: var(--radius-2xl);
  --cart-border-radius: var(--radius-2xl);
  --cart-spacing: var(--spacing-6);
  --cart-item-height: 120px;
  --cart-sidebar-width: 400px;
  --cart-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --cart-hover-lift: translateY(-2px);
  --profile-premium-gradient: linear-gradient(135deg, var(--bluecart-primary) 0%, var(--bluecart-secondary) 50%, var(--bluecart-cyan) 100%);
  --profile-glass: rgba(255, 255, 255, 0.95);
  --profile-glass-border: rgba(255, 255, 255, 0.2);
  --profile-card-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.06);
  --profile-hover-shadow: 0 20px 40px -12px rgba(37, 99, 235, 0.25), 0 16px 32px -8px rgba(0, 0, 0, 0.1);
  --profile-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --profile-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* End legacy compatibility block */
}
