/**
 * CSS Variables
 * Global CSS custom properties for theming and consistency
 *
 * @package FastTheme
 */

:root {
  /* ===========================
   * Color Palette - EsencialPack Design System
   * =========================== */

  /* Primary Brand Color (Blue) - Matches EsencialPack */
  --color-primary-50: #eff6ff;
  --color-primary-100: #dbeafe;
  --color-primary-200: #bfdbfe;
  --color-primary-300: #93c5fd;
  --color-primary-400: #60a5fa;
  --color-primary-500: #3b82f6;
  --color-primary-600: #2563eb;  /* MAIN BRAND COLOR */
  --color-primary-700: #1d4ed8;
  --color-primary-800: #1e40af;
  --color-primary-900: #1e3a8a;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #60a5fa;

  /* Secondary Colors (Gray/Slate) */
  --color-secondary-50: #f8fafc;
  --color-secondary-100: #f1f5f9;
  --color-secondary-200: #e2e8f0;
  --color-secondary-300: #cbd5e1;
  --color-secondary-400: #94a3b8;
  --color-secondary-500: #64748b;
  --color-secondary-600: #475569;
  --color-secondary-700: #334155;
  --color-secondary-800: #1e293b;
  --color-secondary-900: #0f172a;
  --color-secondary: #64748b;
  --color-secondary-dark: #334155;
  --color-secondary-light: #94a3b8;

  /* Accent Orange */
  --color-orange-50: #fff7ed;
  --color-orange-100: #ffedd5;
  --color-orange-200: #fed7aa;
  --color-orange-300: #fdba74;
  --color-orange-400: #fb923c;
  --color-orange-500: #f97316;
  --color-orange-600: #ea580c;
  --color-orange-700: #c2410c;
  --color-orange-800: #9a3412;
  --color-orange-900: #7c2d12;
  --color-accent: #f97316;
  --color-accent-dark: #ea580c;
  --color-accent-light: #fb923c;

  /* Accent Yellow */
  --color-yellow-50: #fefce8;
  --color-yellow-100: #fef9c3;
  --color-yellow-200: #fef08a;
  --color-yellow-300: #fde047;
  --color-yellow-400: #facc15;
  --color-yellow-500: #eab308;
  --color-yellow-600: #ca8a04;
  --color-yellow-700: #a16207;
  --color-yellow-800: #854d0e;
  --color-yellow-900: #713f12;

  /* Success (Green) */
  --color-success-50: #f0fdf4;
  --color-success-100: #dcfce7;
  --color-success-200: #bbf7d0;
  --color-success-300: #86efac;
  --color-success-400: #4ade80;
  --color-success-500: #22c55e;
  --color-success-600: #16a34a;
  --color-success-700: #15803d;
  --color-success-800: #166534;
  --color-success-900: #14532d;
  --color-success: #22c55e;

  /* Error (Red) */
  --color-error-50: #fef2f2;
  --color-error-100: #fee2e2;
  --color-error-200: #fecaca;
  --color-error-300: #fca5a5;
  --color-error-400: #f87171;
  --color-error-500: #ef4444;
  --color-error-600: #dc2626;
  --color-error-700: #b91c1c;
  --color-error-800: #991b1b;
  --color-error-900: #7f1d1d;
  --color-error: #ef4444;

  /* Neutral Colors */
  --color-white: #ffffff;
  --color-black: #000000;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* ===========================
   * WooCommerce Colors
   * =========================== */

  --wc-success: #22c55e;
  --wc-success-light: #dcfce7;
  --wc-error: #ef4444;
  --wc-error-light: #fee2e2;
  --wc-info: #2563eb;
  --wc-info-light: #dbeafe;
  --wc-warning: #f97316;
  --wc-warning-light: #ffedd5;

  /* ===========================
   * Typography
   * =========================== */

  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Poppins', sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* ===========================
   * Spacing
   * =========================== */

  --spacing-xs: 0.25rem;   /* 4px */
  --spacing-sm: 0.5rem;    /* 8px */
  --spacing-md: 1rem;      /* 16px */
  --spacing-lg: 1.5rem;    /* 24px */
  --spacing-xl: 2rem;      /* 32px */
  --spacing-2xl: 3rem;     /* 48px */
  --spacing-3xl: 4rem;     /* 64px */

  /* Numeric spacing aliases (Tailwind-style) */
  --spacing-1: 0.25rem;    /* 4px */
  --spacing-2: 0.5rem;     /* 8px */
  --spacing-3: 0.75rem;    /* 12px */
  --spacing-4: 1rem;       /* 16px */
  --spacing-5: 1.25rem;    /* 20px */
  --spacing-6: 1.5rem;     /* 24px */
  --spacing-8: 2rem;       /* 32px */
  --spacing-10: 2.5rem;    /* 40px */
  --spacing-12: 3rem;      /* 48px */
  --spacing-16: 4rem;      /* 64px */

  /* Container */
  --container-max-width: 1280px;
  --gutter: 1rem;

  /* ===========================
   * Border Radius - EsencialPack Standard
   * =========================== */

  --radius-sm: 10px;       /* Small (tags, badges) */
  --radius-md: 12px;       /* Medium (small buttons) */
  --radius-default: 15px;  /* DEFAULT - ESENCIALPACK STANDARD */
  --radius-lg: 15px;       /* Large (buttons, inputs, cards) */
  --radius-xl: 20px;       /* Extra Large (containers) */
  --radius-2xl: 24px;      /* 2XL (large containers) */
  --radius-full: 50%;      /* Circles, pills */

  /* ===========================
   * 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), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* ===========================
   * Transitions
   * =========================== */

  --transition-fast: 150ms;
  --transition-base: 200ms;
  --transition-slow: 300ms;
  --transition-slower: 500ms;

  /* HTMX Transitions */
  --htmx-transition-duration: 300ms;
  --htmx-transition-timing: cubic-bezier(0.4, 0, 0.2, 1);

  /* ===========================
   * Z-Index Scale
   * =========================== */

  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-header: 50;
  --z-overlay: 500;
  --z-modal: 1000;
  --z-mini-cart: 999;
  --z-toast: 1100;
  --z-tooltip: 1200;

  /* ===========================
   * Layout
   * =========================== */

  --header-height: 80px;
  --footer-height: auto;

  /* ===========================
   * Breakpoints (for reference in JS)
   * =========================== */

  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;

  /* ===========================
   * Borders
   * =========================== */

  --border-width-thin: 1px;
  --border-width-base: 2px;
  --border-width-thick: 3px;
  --border-width-heavy: 4px;

  --border-style-solid: solid;
  --border-style-dashed: dashed;
  --border-style-dotted: dotted;

  /* ===========================
   * Opacity
   * =========================== */

  --opacity-0: 0;
  --opacity-5: 0.05;
  --opacity-10: 0.1;
  --opacity-15: 0.15;
  --opacity-20: 0.2;
  --opacity-25: 0.25;
  --opacity-30: 0.3;
  --opacity-40: 0.4;
  --opacity-50: 0.5;
  --opacity-60: 0.6;
  --opacity-75: 0.75;
  --opacity-80: 0.8;
  --opacity-90: 0.9;
  --opacity-95: 0.95;
  --opacity-100: 1;

  /* ===========================
   * Gradients
   * =========================== */

  --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  --gradient-secondary: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-dark));
  --gradient-accent: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));

  /* Directional Gradients */
  --gradient-to-bottom: linear-gradient(to bottom, var(--color-white), var(--color-gray-50));
  --gradient-to-top: linear-gradient(to top, var(--color-white), var(--color-gray-50));
  --gradient-to-right: linear-gradient(to right, var(--color-white), var(--color-gray-50));
  --gradient-to-left: linear-gradient(to left, var(--color-white), var(--color-gray-50));

  /* Overlay Gradients */
  --gradient-overlay-dark: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5));
  --gradient-overlay-light: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8));

  /* ===========================
   * Blur Effects
   * =========================== */

  --blur-none: 0;
  --blur-sm: 4px;
  --blur-md: 8px;
  --blur-lg: 16px;
  --blur-xl: 24px;
  --blur-2xl: 40px;

  /* ===========================
   * Letter Spacing
   * =========================== */

  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* ===========================
   * Max Widths (Containers)
   * =========================== */

  --max-w-xs: 320px;
  --max-w-sm: 384px;
  --max-w-md: 448px;
  --max-w-lg: 512px;
  --max-w-xl: 576px;
  --max-w-2xl: 672px;
  --max-w-3xl: 768px;
  --max-w-4xl: 896px;
  --max-w-5xl: 1024px;
  --max-w-6xl: 1152px;
  --max-w-7xl: 1280px;
  --max-w-full: 100%;

  /* ===========================
   * Aspect Ratios
   * =========================== */

  --aspect-square: 1 / 1;
  --aspect-video: 16 / 9;
  --aspect-4-3: 4 / 3;
  --aspect-3-2: 3 / 2;
  --aspect-21-9: 21 / 9;

  /* ===========================
   * Grid & Gap
   * =========================== */

  --gap-0: 0;
  --gap-1: 0.25rem;
  --gap-2: 0.5rem;
  --gap-3: 0.75rem;
  --gap-4: 1rem;
  --gap-5: 1.25rem;
  --gap-6: 1.5rem;
  --gap-8: 2rem;
  --gap-10: 2.5rem;
  --gap-12: 3rem;
  --gap-16: 4rem;

  /* ===========================
   * Animation Durations
   * =========================== */

  --duration-75: 75ms;
  --duration-100: 100ms;
  --duration-150: 150ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;
  --duration-700: 700ms;
  --duration-1000: 1000ms;

  /* ===========================
   * Easing Functions
   * =========================== */

  --ease-linear: linear;
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* ===========================
   * Component Specific
   * =========================== */

  /* Buttons */
  --btn-padding-x: 1.5rem;
  --btn-padding-y: 0.75rem;
  --btn-font-size: 1rem;
  --btn-font-weight: var(--font-semibold);
  --btn-border-radius: var(--radius-default);
  --btn-transition: all var(--duration-200) var(--ease-in-out);

  /* Inputs */
  --input-padding-x: 1rem;
  --input-padding-y: 0.5rem;
  --input-border-width: var(--border-width-thin);
  --input-border-color: var(--color-gray-300);
  --input-border-radius: var(--radius-default);
  --input-focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.1);

  /* Cards */
  --card-padding: var(--spacing-lg);
  --card-border-radius: var(--radius-default);
  --card-shadow: var(--shadow-md);
  --card-shadow-hover: var(--shadow-lg);

  /* Mini Cart */
  --mini-cart-width: 28rem;
  --mini-cart-padding: 1.5rem;
  --mini-cart-item-gap: 1rem;
  --mini-cart-backdrop: rgba(0, 0, 0, 0.5);

  /* WooCommerce Specific */
  --wc-product-image-size: 5rem;
  --wc-mini-cart-image-size: 5rem;
  --wc-thumbnail-size: 60px;
}

/* ===========================
 * Dark Mode Support (Optional)
 * =========================== */

@media (prefers-color-scheme: dark) {
  :root {
    /* Override colors for dark mode if needed */
    /* Uncomment and customize as needed */

    /* --color-primary: #60a5fa;
    --color-primary-dark: #3b82f6;
    --color-gray-50: #1f2937;
    --color-gray-900: #f9fafb; */
  }
}

/* ===========================
 * Print Styles
 * =========================== */

@media print {
  :root {
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-xl: none;
    --shadow-2xl: none;
  }
}

/* ===========================
 * Alpine.js Cloak
 * Hide elements before Alpine.js initializes
 * =========================== */
[x-cloak] {
  display: none !important;
}

/* ===========================
 * Mini Cart Z-Index
 * Ensures proper stacking order
 * =========================== */
.z-mini-cart-overlay {
  z-index: 998 !important;
}

.z-mini-cart-drawer {
  z-index: 999 !important;
}
