/**
 * GlamFit Premium Checkout - Design System
 * Senior UI/UX Design Tokens
 */

:root {
  /* ============================================
     BRAND COLORS
     ============================================ */
  --brand-purple: #5A5BA3;
  --brand-pink: #C65A9B;
  --brand-gradient: linear-gradient(135deg, #5A5BA3 0%, #C65A9B 100%);
  
  /* Purple Shades */
  --purple-50: #F2F2FA;
  --purple-100: #E5E5F5;
  --purple-600: #5A5BA3;
  --purple-700: #4A4B8A;
  --purple-800: #3A3B6D;
  
  /* ============================================
     SURFACE & BACKGROUND
     ============================================ */
  --surface-base: #FFFFFF;
  --surface-raised: #FFFFFF;
  --bg-page: #F7F8FC;
  --bg-subtle: #F2F2FA;
  --bg-hover: #F9FAFB;
  
  /* ============================================
     TEXT COLORS
     ============================================ */
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --text-white: #FFFFFF;
  
  /* ============================================
     BORDERS
     ============================================ */
  --border-default: #E5E7EB;
  --border-hover: #D1D5DB;
  --border-focus: #5A5BA3;
  --border-selected: #5A5BA3;
  
  /* ============================================
     SEMANTIC COLORS
     ============================================ */
  --success: #10B981;
  --success-bg: #D1FAE5;
  --error: #EF4444;
  --error-bg: #FEE2E2;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --info: #3B82F6;
  --info-bg: #DBEAFE;
  
  /* ============================================
     SPACING (8pt Grid System)
     ============================================ */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  
  /* ============================================
     TYPOGRAPHY
     ============================================ */
  --font-heading: 'Poppins', 'Urbanist', sans-serif;
  --font-body: 'Inter', 'Urbanist', sans-serif;
  
  /* Font Sizes */
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  
  /* 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;
  
  /* ============================================
     SHADOWS
     ============================================ */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --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-focus: 0 0 0 3px rgba(90, 91, 163, 0.1);
  
  /* ============================================
     BORDER RADIUS
     ============================================ */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* ============================================
     TRANSITIONS
     ============================================ */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* ============================================
     Z-INDEX LAYERS
     ============================================ */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-modal: 1050;
  --z-tooltip: 1080;
}

/* ============================================
   BASE RESET & UTILITIES
   ============================================ */
.checkout-container {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--bg-page);
}

/* ============================================
   COMPONENT: Progress Stepper
   ============================================ */
.progress-stepper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-base);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-lg);
}

.stepper-step {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex: 1;
  position: relative;
}

.stepper-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: calc(50% + 60px);
  right: calc(-50% + 60px);
  height: 2px;
  background: var(--border-default);
  top: 16px;
}

.stepper-step.completed::after,
.stepper-step.active::after {
  background: var(--brand-purple);
}

.stepper-circle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  transition: all var(--transition-base);
}

.stepper-step.upcoming .stepper-circle {
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  border: 2px solid var(--border-default);
}

.stepper-step.active .stepper-circle {
  background: var(--brand-purple);
  color: var(--text-white);
  box-shadow: var(--shadow-focus);
}

.stepper-step.completed .stepper-circle {
  background: var(--brand-purple);
  color: var(--text-white);
}

.stepper-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.stepper-step.active .stepper-label {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
}

/* ============================================
   COMPONENT: Premium Card
   ============================================ */
.premium-card {
  background: var(--surface-base);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  border: 1px solid var(--border-default);
  transition: all var(--transition-base);
}

.premium-card:hover {
  box-shadow: var(--shadow-md);
}

.premium-card-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-default);
}

.premium-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin: 0;
}

/* ============================================
   COMPONENT: Form Inputs
   ============================================ */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.form-label-required::after {
  content: '*';
  color: var(--error);
  margin-left: 4px;
}

.form-input,
.form-select {
  width: 100%;
  height: 48px;
  padding: 12px 16px;
  font-size: var(--text-base);
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-input:hover,
.form-select:hover {
  border-color: var(--border-hover);
}

.form-input:focus,
.form-select:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

.form-input.error {
  border-color: var(--error);
}

.form-error {
  color: var(--error);
  font-size: var(--text-sm);
  margin-top: var(--space-xs);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   COMPONENT: Shipping Method Cards
   ============================================ */
.shipping-methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.shipping-method-card {
  background: var(--surface-base);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.shipping-method-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.shipping-method-card.selected {
  border-color: var(--border-selected);
  background: var(--bg-subtle);
  box-shadow: var(--shadow-focus);
}

.shipping-method-card.selected::before {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  background: var(--brand-purple);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
}

.shipping-method-icon {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  font-size: 24px;
}

.shipping-method-card.selected .shipping-method-icon {
  color: var(--brand-purple);
}

.shipping-method-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: 4px;
}

.shipping-method-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ============================================
   COMPONENT: Primary Button
   ============================================ */
.btn-primary {
  width: 100%;
  height: 52px;
  padding: 0 var(--space-lg);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-white);
  background: var(--brand-purple);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--brand-gradient);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary:focus {
  outline: none;
  box-shadow: var(--shadow-focus), var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary.loading {
  pointer-events: none;
}

/* ============================================
   COMPONENT: Summary Sidebar
   ============================================ */
.summary-sidebar {
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-lg);
  position: sticky;
  top: 24px;
}

.summary-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-default);
}

.summary-line:last-of-type {
  border-bottom: 2px solid var(--border-default);
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

.summary-label {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.summary-value {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.summary-total .summary-label,
.summary-total .summary-value {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 1024px) {
  .summary-sidebar {
    position: static;
    margin-top: var(--space-lg);
  }
  
  .shipping-methods-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --text-2xl: 20px;
    --text-xl: 18px;
    --text-lg: 16px;
    --space-lg: 24px;
    --space-md: 16px;
  }
  
  .progress-stepper {
    padding: var(--space-sm);
  }
  
  .stepper-label {
    display: none;
  }
  
  .premium-card {
    padding: var(--space-md);
  }
}
