/* ═══════════════════════════════════════════════════════════════════
   Copango — Layout & Composants
   Hero, Navbar, Footer, Cards, Grid, Buttons, Stats, Progress, Badges
   ═══════════════════════════════════════════════════════════════════ */

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky, 200);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  padding: 0 var(--container-padding, 1.5rem);
  height: 64px;
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-xl);
  color: var(--color-primary-700, #15803d);
  text-decoration: none;
}

.navbar-brand:hover {
  color: var(--color-primary-800, #166534);
}

.navbar-brand-logo {
  font-size: 1.5rem;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
}

.navbar-links a {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text, #334155);
  text-decoration: none;
  transition: color var(--transition-fast);
  padding: var(--space-2) 0;
  position: relative;
}

.navbar-links a:hover,
.navbar-links a.active {
  color: var(--color-primary-600, #16a34a);
}

.navbar-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary-600, #16a34a);
  border-radius: var(--radius-full);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Burger menu (mobile) */
.navbar-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.navbar-burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-strong, #0f172a);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.navbar-burger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar-burger.open span:nth-child(2) {
  opacity: 0;
}
.navbar-burger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Hero ─────────────────────────────────────────────────────── */

/* ── Sticky Footer ────────────────────────────────────────────── */
body { display: flex; flex-direction: column; }
main { flex: 1; }

.hero {
  background: linear-gradient(135deg, var(--color-primary-600, #16a34a) 0%, var(--color-primary-800, #166534) 100%);
  color: #ffffff;
  padding: var(--space-20) 0 var(--space-16);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, var(--text-5xl));
  color: #ffffff;
  margin-bottom: var(--space-4);
  line-height: 1.15;
}

.hero p {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
  margin: 0 auto var(--space-8);
  line-height: var(--leading-relaxed);
}

.hero-buttons {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-6);
}

/* ── Sections ─────────────────────────────────────────────────── */
section {
  padding: var(--section-padding, 5rem) 0;
}

section:nth-child(even):not(.hero):not(.solidarity-section) {
  background: var(--color-surface-soft, #f8fafc);
}

/* ── Solidarity section ───────────────────────────────────────── */
.solidarity-section {
  background: linear-gradient(135deg, var(--color-solidarity-600, #2563eb) 0%, var(--color-solidarity-800, #1e40af) 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.solidarity-section::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.solidarity-section .section-title {
  color: #ffffff;
}

.solidarity-section .section-subtitle {
  color: rgba(255, 255, 255, 0.8);
}

/* ── Grid ─────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ── Cards ────────────────────────────────────────────────────── */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-xl, 1rem);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card-link:hover .card {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--color-primary-100, #dcfce7), var(--color-primary-200, #bbf7d0));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.card-body {
  padding: var(--space-5);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
  color: var(--color-text-strong, #0f172a);
}

.card-price {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary-700, #15803d);
  margin-bottom: var(--space-2);
}

.card-shop {
  font-size: var(--text-sm);
  color: var(--color-text-soft, #64748b);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--color-text-soft, #64748b);
  margin-top: var(--space-3);
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-lg, 0.75rem);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary-600, #16a34a);
  color: #ffffff;
  border-color: var(--color-primary-600, #16a34a);
}

.btn-primary:hover {
  background: var(--color-primary-700, #15803d);
  border-color: var(--color-primary-700, #15803d);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
  color: #ffffff;
}

.btn-solidarity {
  background: var(--color-solidarity-600, #2563eb);
  color: #ffffff;
  border-color: var(--color-solidarity-600, #2563eb);
}

.btn-solidarity:hover {
  background: var(--color-solidarity-700, #1d4ed8);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-secondary-500, #eab308);
  color: var(--color-text-strong, #0f172a);
  border-color: var(--color-secondary-500, #eab308);
}

.btn-secondary:hover {
  background: var(--color-secondary-600, #ca8a04);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  color: var(--color-text, #334155);
  border-color: var(--color-border, #e2e8f0);
}

.btn-ghost:hover {
  background: var(--color-muted, #f1f5f9);
  border-color: var(--color-text-soft, #64748b);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

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

/* ── Stats ────────────────────────────────────────────────────── */
.stats {
  display: flex;
  justify-content: center;
  gap: var(--space-12);
  margin: var(--space-8) 0;
  flex-wrap: wrap;
}

.stat {
  text-align: center;
  padding: var(--space-4);
}

.stat-value {
  font-size: var(--text-4xl);
  font-weight: var(--weight-extrabold);
  color: #ffffff;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-label {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Progress bar ─────────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 10px;
  background: var(--color-muted, #f1f5f9);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: var(--space-3) 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-500, #22c55e), var(--color-primary-600, #16a34a));
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}

.progress-fill.blue {
  background: linear-gradient(90deg, var(--color-solidarity-500, #3b82f6), var(--color-solidarity-700, #1d4ed8));
}

.progress-fill.orange {
  background: linear-gradient(90deg, var(--color-accent-orange-500, #f97316), var(--color-accent-orange-600, #ea580c));
}

/* ── Badges ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  line-height: 1.6;
}

.badge-actif {
  background: var(--color-primary-100, #dcfce7);
  color: var(--color-primary-700, #15803d);
}

.badge-en-cours {
  background: var(--color-secondary-100, #fef9c3);
  color: var(--color-secondary-700, #a16207);
}

.badge-termine {
  background: var(--color-muted, #f1f5f9);
  color: var(--color-text-soft, #64748b);
}

.badge-urgent {
  background: var(--color-danger-muted, #fef2f2);
  color: var(--color-danger-strong, #dc2626);
  animation: badge-pulse 2s ease-in-out infinite;
}

.badge-solidarity {
  background: var(--color-solidarity-100, #dbeafe);
  color: var(--color-solidarity-700, #1d4ed8);
}

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
  background: #0f172a;
  color: #e2e8f0;
  padding: var(--space-8) 0 var(--space-6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-6);
}

.footer-brand {
  font-size: var(--text-xl);
  font-weight: var(--weight-extrabold);
  color: var(--color-primary-400, #4ade80);
  margin-bottom: var(--space-3);
}

.footer-desc {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  max-width: 320px;
}

.footer h4 {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: #ffffff;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
}

.footer-links li { margin-bottom: var(--space-2); }

.footer-links a {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-primary-400, #4ade80);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.4);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: var(--color-primary-400, #4ade80);
}

/* ── Forms ────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-strong, #0f172a);
  margin-bottom: var(--space-2);
}

.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--color-text, #334155);
  background: var(--color-surface, #ffffff);
  border: 1.5px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-lg, 0.75rem);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--color-primary-500, #22c55e);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.form-input::placeholder {
  color: var(--color-text-soft, #64748b);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-danger, #ef4444);
  margin-top: var(--space-1);
}

/* ── Auth pages ───────────────────────────────────────────────── */
.auth-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--container-padding);
}

.auth-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-2xl, 1.5rem);
  padding: var(--space-10);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  text-align: center;
  margin-bottom: var(--space-2);
}

.auth-card .auth-subtitle {
  text-align: center;
  color: var(--color-text-soft, #64748b);
  margin-bottom: var(--space-8);
}

.auth-card .btn {
  width: 100%;
  justify-content: center;
  margin-top: var(--space-4);
}

.auth-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-soft, #64748b);
}

.auth-footer a {
  font-weight: var(--weight-semibold);
}

/* ── Toast notifications ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast, 500);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-lg, 0.75rem);
  box-shadow: var(--shadow-lg);
  animation: slide-in-right 0.3s ease-out both;
}

.toast.removing {
  animation: slide-out-right 0.3s ease-in forwards;
}

.toast-success { border-left: 4px solid var(--color-success, #22c55e); }
.toast-error   { border-left: 4px solid var(--color-danger, #ef4444); }
.toast-warning { border-left: 4px solid var(--color-warning, #f59e0b); }
.toast-info    { border-left: 4px solid var(--color-info, #3b82f6); }

.toast-icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-body { flex: 1; }
.toast-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-strong, #0f172a);
  margin-bottom: 2px;
}
.toast-message {
  font-size: var(--text-xs);
  color: var(--color-text-soft, #64748b);
}
.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-soft, #64748b);
  font-size: var(--text-lg);
  padding: 0;
  line-height: 1;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 3rem;
    --container-padding: 1rem;
  }

  .navbar-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-surface, #ffffff);
    flex-direction: column;
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    box-shadow: var(--shadow-lg);
  }

  .navbar-links.mobile-open {
    display: flex;
  }

  .navbar-burger {
    display: flex;
  }

  .hero {
    padding: var(--space-12) 0 var(--space-8);
  }

  .hero h1 {
    font-size: var(--text-3xl);
  }

  .hero p {
    font-size: var(--text-base);
  }

  .stats {
    gap: var(--space-6);
  }

  .stat-value {
    font-size: var(--text-2xl);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .auth-card {
    padding: var(--space-6);
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

/* ── Responsive hardening global ──────────────────────────────── */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

*, *::before, *::after { box-sizing: border-box; }

img, svg, video, canvas, iframe {
  max-width: 100%;
}

img, video {
  height: auto;
}

.container {
  width: min(100% - calc(var(--container-padding, 1.5rem) * 2), var(--container-max, 1200px));
}

main {
  min-width: 0;
}

.card,
.card-body,
.product-card,
.campaign-card,
.dashboard-card,
.stats-card,
.form-card,
section,
.container {
  min-width: 0;
}

.table-responsive,
.table-wrapper,
.data-table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  max-width: 100%;
}

pre, code {
  white-space: pre-wrap;
  word-break: break-word;
}

.btn {
  max-width: 100%;
  white-space: normal;
}

input, select, textarea, button {
  max-width: 100%;
}

@media (max-width: 1024px) {
  .navbar-links { gap: var(--space-4); }
  .navbar-actions { gap: var(--space-2); }
}

@media (max-width: 900px) {
  .navbar {
    height: auto;
    min-height: 64px;
    padding: 0 var(--container-padding, 1rem);
  }

  .navbar .container {
    flex-wrap: wrap;
    gap: .5rem;
    padding-top: .5rem;
    padding-bottom: .5rem;
  }

  .navbar-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .navbar-burger {
    display: flex;
    order: 2;
  }

  .navbar-links {
    display: none;
    order: 4;
    position: static;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    padding: .75rem 0 0;
    border-top: 1px solid var(--color-border, #e2e8f0);
    border-bottom: 0;
    box-shadow: none;
    background: transparent;
  }

  .navbar-links.mobile-open {
    display: flex;
  }

  .navbar-links a {
    display: block;
    padding: .75rem .25rem;
  }

  .navbar-actions {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: .25rem;
    -webkit-overflow-scrolling: touch;
  }

  .navbar-actions > * {
    flex: 0 0 auto;
  }

  .hero-buttons,
  .stats,
  .footer-bottom {
    align-items: stretch;
  }

  .hero-buttons .btn {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  table:not(.no-responsive-table) {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .card-body {
    padding: var(--space-4, 1rem);
  }

  .hero::before,
  .hero::after,
  .solidarity-section::before {
    transform: scale(.72);
    opacity: .6;
  }
}

@media (max-width: 520px) {
  :root {
    --container-padding: .875rem;
    --section-padding: 2.25rem;
  }

  .navbar-actions .btn,
  .navbar-actions select,
  .navbar-actions .lang-switcher a {
    min-height: 36px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 9vw, 2.35rem);
  }

  .hero p {
    font-size: .98rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  .auth-page {
    padding-left: .75rem;
    padding-right: .75rem;
  }

  .auth-card {
    padding: var(--space-5, 1.25rem);
    border-radius: var(--radius-xl, 1rem);
  }

  .toast-container {
    left: .75rem;
    right: .75rem;
    top: .75rem;
    max-width: none;
  }
}

/* ── Marketplace responsive ──────────────────────────────────── */
.product-search-form {
  margin-bottom: 1.5rem;
  display: flex;
  gap: .5rem;
  align-items: stretch;
}

.products-layout {
  display: grid;
  grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.products-filters {
  position: sticky;
  top: 1rem;
  align-self: start;
  min-width: 0;
}

.products-results { min-width: 0; }

.products-toolbar,
.products-sort-form,
.price-filter-range,
.products-pagination {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}

.products-toolbar {
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.products-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
}

.products-pagination {
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .products-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .products-filters {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .875rem;
  }

  .products-filters .card {
    margin-bottom: 0 !important;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  }
}

@media (max-width: 640px) {
  h1 { font-size: clamp(1.75rem, 8vw, 2.35rem); }
  h2, .section-title { font-size: clamp(1.45rem, 7vw, 2rem); }
  h3 { font-size: clamp(1.1rem, 5vw, 1.45rem); }

  .products-filters,
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-search-form,
  .products-toolbar,
  .products-sort-form,
  .price-filter-range {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .product-search-form .btn,
  .products-sort-form select,
  .products-sort-form label,
  .price-filter-range input,
  .products-toolbar > span {
    width: 100% !important;
  }

  .price-filter-range > span {
    display: none;
  }

  .card,
  .auth-card,
  .empty {
    max-width: 100%;
  }

  .stats,
  .hero-buttons,
  .footer-bottom {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .navbar .container {
    align-items: stretch;
  }

  .navbar-actions {
    flex-wrap: wrap;
    overflow: visible;
    gap: .35rem;
  }

  .navbar-actions .lang-switcher {
    margin-left: 0 !important;
  }

  .navbar-actions .btn,
  .navbar-actions select,
  .navbar-actions .lang-switcher {
    flex: 0 1 auto;
    font-size: .78rem;
  }

  .navbar-actions .btn {
    padding: .45rem .6rem;
  }

  .products-pagination .btn {
    flex: 1 1 calc(50% - .5rem);
    justify-content: center;
  }
}

/* ── Print ────────────────────────────────────────────────────── */
@media print {
  .navbar, .footer, .toast-container { display: none; }
  body { background: #fff; color: #000; }
}
