/* =============================================
   LA TÊTE À TOTO - Responsive Styles
   Mobile First for Busy Parents
   ============================================= */

/* ========== TABLET (768px and up) ========== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

  .footer-brand {
    grid-column: 1 / -1;
    max-width: none;
    text-align: center;
  }

  .featured-grid {
    gap: var(--space-md);
  }

  .featured-item.main {
    transform: scale(1.05);
  }

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

  .boutique-image {
    min-height: 300px;
  }

  .boutique-image::after {
    background: linear-gradient(180deg, transparent 50%, var(--bg-secondary) 100%);
  }

  .boutique-content {
    padding: var(--space-xl);
  }
}

/* ========== MOBILE LARGE (640px and up) ========== */
@media (max-width: 768px) {
  :root {
    --space-2xl: 3rem;
  }

  /* Navigation */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-primary);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-xl);
    border-left: 1px solid var(--border-glass);
    transition: right 0.3s var(--smooth);
    z-index: 1001;
  }

  .nav-menu.open {
    right: 0;
  }

  .nav-menu::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: -1;
  }

  .nav-menu.open::before {
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    flex-direction: row;
    justify-content: flex-start;
    font-size: 1.1rem;
    padding: var(--space-sm) var(--space-md);
    width: 100%;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding: 120px 0 var(--space-2xl);
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

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

  /* Featured */
  .featured-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .featured-item.main {
    transform: none;
    order: -1;
  }

  .featured-item:nth-child(2) .featured-rank {
    font-size: 3rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-contact-item {
    justify-content: center;
  }

  .footer-links a {
    justify-content: center;
  }

  .footer-links a:hover {
    transform: none;
  }

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

  /* Section headers */
  .section-header h2 {
    font-size: 2rem;
  }

  /* Categories */
  .categories-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  .category-card {
    padding: var(--space-lg);
  }

  .category-icon {
    font-size: 3rem;
  }

  /* Products */
  .products-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  /* Page header */
  .page-header {
    padding: 120px 0 var(--space-xl);
  }

  /* Boutique */
  .boutique-content {
    text-align: center;
  }

  .boutique-feature {
    justify-content: center;
  }
}

/* ========== MOBILE SMALL (480px and down) ========== */
@media (max-width: 480px) {
  :root {
    --space-xl: 2rem;
    --space-2xl: 2.5rem;
  }

  html {
    font-size: 14px;
  }

  .container {
    padding: 0 var(--space-sm);
  }

  /* Logo */
  .logo {
    font-size: 1.25rem;
  }

  .logo-icon {
    font-size: 1.5rem;
  }

  /* Hero */
  .hero-badge {
    font-size: 0.75rem;
    padding: 0.4rem 1rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  /* Categories */
  .categories-grid {
    grid-template-columns: 1fr;
  }

  /* Products */
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    max-width: 350px;
    margin: 0 auto;
  }

  /* Buttons */
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
  }

  .btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
  }

  /* Filter pills */
  .filter-pills {
    gap: 0.5rem;
  }

  .filter-pill {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  /* Form */
  .form-input,
  .form-textarea,
  .form-select {
    padding: 0.875rem 1rem;
  }

  /* Section decoration */
  .section-decoration::before,
  .section-decoration::after {
    width: 40px;
  }
}

/* ========== VERY SMALL SCREENS ========== */
@media (max-width: 360px) {
  html {
    font-size: 13px;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .category-card {
    padding: var(--space-md);
  }

  .category-icon {
    font-size: 2.5rem;
  }
}

/* ========== ACCESSIBILITY & PREFERENCES ========== */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .hero-badge,
  .animate-float {
    animation: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --bg-glass: rgba(255, 255, 255, 0.15);
    --border-glass: rgba(255, 255, 255, 0.4);
  }

  .glass-card {
    border-width: 2px;
  }
}

/* Print styles */
@media print {
  .header,
  .hero-background,
  .particles-container,
  .footer-social,
  .btn {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .glass-card {
    background: white;
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

/* ========== LANDSCAPE MOBILE ========== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 100px 0 var(--space-lg);
  }

  .hero-subtitle {
    margin-bottom: var(--space-md);
  }
}

/* ========== TOUCH DEVICE OPTIMIZATIONS ========== */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .nav-link {
    min-height: 48px;
  }

  .btn {
    min-height: 48px;
  }

  .filter-pill {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .social-link {
    width: 48px;
    height: 48px;
  }

  /* Disable hover effects on touch */
  .glass-card:hover {
    transform: none;
  }

  .category-card:hover .category-icon {
    transform: none;
  }

  .product-card:hover .product-image img {
    transform: none;
  }

  /* Active states instead */
  .glass-card:active {
    transform: scale(0.98);
  }

  .btn:active {
    transform: scale(0.95);
  }
}

/* ========== DESKTOP LARGE (1400px+) ========== */
@media (min-width: 1400px) {
  .container {
    max-width: 1600px;
  }

  .hero-title {
    font-size: 4.5rem;
  }

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

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