/**
 * Sokonia Affiliate Portal — Modern DoorDash-Inspired Design System
 * Clean, airy, human, consumer-first UI with modern cards and polished typography.
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
  /* Surface & Neutrals */
  --bg-main: #f7f7f8;
  --bg-surface: #ffffff;
  --bg-subtle: #f3f4f6;
  --border-light: #e5e7eb;
  --border-subtle: #f0f1f3;
  
  /* Text - High Contrast & Opacity */
  --text-main: #0f172a; /* Deep Charcoal Black */
  --text-muted: #334155; /* Slate Gray (High Contrast) */
  --text-faint: #475569; /* Darker Subtitle Gray */
  
  /* Brand Accents */
  --brand-primary: #eb1700; /* DoorDash energetic red-orange */
  --brand-hover: #c41400;
  --brand-orange: #f97316;
  --brand-dark: #111827;
  --brand-green: #059669;
  
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
  --shadow-elevated: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  
  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

/* Container */
.app-container {
  width: 100%;
  max-width: 1520px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .app-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .app-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* DoorDash Style Responsive Product Grid */
/* Mobile: 2 columns minimum */
.door-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .door-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 768px) {
  .door-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.125rem;
  }
}

/* Laptop: Minimum 5 columns */
@media (min-width: 1024px) {
  .door-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.125rem;
  }
}

/* Large Monitor: 6 columns */
@media (min-width: 1380px) {
  .door-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

/* Sidebar Filter Grid */
.door-sidebar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .door-sidebar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 768px) {
  .door-sidebar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .door-sidebar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.125rem;
  }
}

@media (min-width: 1400px) {
  .door-sidebar-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.125rem;
  }
}

/* DoorDash-Style Card */
.door-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.door-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #d1d5db;
}

.door-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--bg-subtle);
}

.door-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.door-card:hover .door-card-img-wrap img {
  transform: scale(1.04);
}

.door-card-body {
  padding: 0.75rem 0.875rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .door-card-body {
    padding: 0.875rem 1rem;
  }
}

/* Buttons */
.door-btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.door-btn-primary:hover {
  background-color: var(--brand-hover);
  color: #ffffff;
}

.door-btn-primary:active {
  transform: scale(0.98);
}

.door-btn-secondary {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  font-weight: 600;
  font-size: 13px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.door-btn-secondary:hover {
  background-color: #e5e7eb;
}

/* Pills & Badges */
.door-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.door-pill:hover,
.door-pill.active {
  background: var(--brand-dark);
  color: #ffffff;
  border-color: var(--brand-dark);
}

.door-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.door-badge-discount {
  background-color: var(--brand-primary);
  color: #ffffff;
}

.door-badge-green {
  background-color: #ecfdf5;
  color: #065f46;
}

.door-badge-gray {
  background-color: #f3f4f6;
  color: #374151;
}

/* Inputs */
.door-search-box {
  background: #ffffff;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 6px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.door-search-box:focus-within {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  border-color: #9ca3af;
}

.door-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  width: 100%;
  padding: 8px 16px;
}

.door-search-input::placeholder {
  color: var(--text-faint);
}

/* Header */
.door-header {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 40;
}

/* Product Detail Page 2-Column Responsive Layout */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .product-detail-grid {
    grid-template-columns: 1.05fr 1fr;
    gap: 3rem;
    align-items: start;
  }
}

/* Legal Document Styles */
.legal-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-card);
}

@media (min-width: 768px) {
  .legal-card {
    padding: 3.5rem 3rem;
  }
}

.legal-prose h1 {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
}

.legal-prose h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.legal-prose p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.legal-prose ul {
  list-style-type: disc;
  padding-left: 1.25rem;
  margin-bottom: 1.25rem;
}

.legal-prose li {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}
