/* ============================================
   THOMAS SUPER STORE — Mobile & Responsive
   ============================================ */

/* === TABLET (max 1024px) === */
@media (max-width: 1024px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero-text p { margin: 0 auto 32px; }
  .hero-buttons { justify-content: center; }
  .hero-visual { display: none; }
  .hero-stats { justify-content: center; }
  .hero-stat::before { display: none; }
  .hero-stat { padding-left: 0; }

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

  .new-arrivals-banner { grid-template-columns: 1fr; text-align: center; padding: 44px; }
  .new-arrivals-visual { font-size: 4rem; }

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

  .detail-grid { grid-template-columns: 1fr; }
  .detail-image-section {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 30px;
    min-height: 250px;
  }
  .detail-info-section { padding: 24px; }
}

/* === MOBILE NAV (max 768px) === */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .container { padding: 0 16px; }

  .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
  .nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }
  .nav.open { display: flex; }
  .nav a { font-size: 1.1rem; padding: 8px 0; }

  .header-search { display: none; }
  .lang-switcher { display: none; }
  .lang-select {
    display: block;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
  }

  .section { padding: 56px 0; }

  .hero { padding: 60px 0 80px; }
  .hero-text h1 { font-size: 2rem; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .hero-stat-number { font-size: 1.4rem; }
  .hero-stat { padding-left: 0; }
  .hero-stat::before { display: none; }
  .hero-clouds { display: none; }

  /* Hide wave divider on mobile */
  .trust-bar::before { display: none; }
  .footer::before { display: none; }

  .track-divider { height: 14px; }

  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .category-card { padding: 20px 12px; }
  .category-icon { width: 48px; height: 48px; font-size: 1.4rem; }
  .category-name { font-size: 0.8rem; }
  .category-count { display: none; }

  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .product-info { padding: 14px; }
  .product-name { font-size: 0.9rem; }
  .product-desc { display: none; }
  .product-price { font-size: 1.05rem; }
  .product-cart-btn { width: 38px; height: 38px; font-size: 1rem; min-height: 44px; min-width: 44px; }
  .product-overlay { display: none; }
  .product-card::before { display: none; } /* Hide gradient border on mobile for perf */

  .brands-grid { gap: 16px; }
  .brand-item { min-width: 130px; padding: 16px; }
  .brand-logo-icon { width: 56px; height: 56px; }
  .brand-logo-icon svg { width: 24px; height: 24px; }

  .usp-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .usp-card { padding: 24px 16px; }
  .usp-icon { width: 56px; height: 56px; }
  .usp-icon svg { width: 24px; height: 24px; }

  .new-arrivals-banner { padding: 32px 24px; border-radius: var(--radius); }
  .na-emoji { font-size: 4rem; }

  .newsletter-form { flex-direction: column; }
  .newsletter-form input { border-radius: var(--radius); padding: 16px 20px; }
  .newsletter-form .btn { width: 100%; justify-content: center; border-radius: var(--radius); padding: 16px 24px; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }

  .section-subtitle { font-size: 1rem; margin-bottom: 32px; }

  .trust-items { gap: 16px; }
  .trust-item { font-size: 0.8rem; }
  .trust-icon { width: 32px; height: 32px; }
  .trust-icon svg { width: 16px; height: 16px; }

  .page-content { padding: 40px 16px; }

  .back-to-top { bottom: 20px; right: 20px; width: 46px; height: 46px; }

  /* Touch-friendly targets */
  .nav a { padding: 10px 0; min-height: 44px; display: flex; align-items: center; }
  .footer-col ul a { padding: 6px 0; min-height: 44px; display: inline-flex; align-items: center; }
  .trust-item { min-height: 44px; }
  .category-card { min-height: 44px; }

  /* Filter bar mobile */
  .filter-bar { gap: 12px; }
  .filter-controls {
    gap: 8px;
    flex-wrap: wrap;
  }
  .filter-select-group {
    flex: 1;
    min-width: 120px;
  }
  .filter-select-group select {
    width: 100%;
  }
  .product-count-badge {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
  .filter-tabs {
    gap: 6px;
  }
  .filter-tab {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  /* Product detail modal mobile */
  .product-detail-overlay { padding: 8px; }
  .product-detail-modal { max-height: 95vh; }
  .detail-name { font-size: 1.2rem; }
  .detail-price { font-size: 1.4rem; }

  /* Wishlist button smaller on mobile */
  .wishlist-btn { width: 32px; height: 32px; }
  .wishlist-btn svg { width: 16px; height: 16px; }
  .wishlist-header-btn { display: flex; }

  /* Cookie consent mobile */
  .cookie-consent-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
    padding: 16px;
  }
  .cookie-consent-icon { display: none; }
  .cookie-consent-buttons {
    width: 100%;
    flex-direction: column;
  }
  .cookie-consent-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  /* Quick specs mobile */
  .quick-specs-grid { gap: 6px; }
  .spec-badge {
    padding: 4px 10px;
    font-size: 0.72rem;
  }

  /* Search dropdown mobile */
  .header-search-wrapper { display: none; }

  /* Recently viewed mobile */
  .rv-card { min-width: 150px; }
  .rv-card-name { font-size: 0.8rem; }

  /* Stock notify mobile */
  .stock-notify-form { flex-direction: column; }
  .stock-notify-form .btn { width: 100%; justify-content: center; }
}

/* === SMALL PHONE (max 480px) === */
@media (max-width: 480px) {
  .hero-text h1 { font-size: 1.8rem; }
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn { width: 100%; justify-content: center; min-height: 48px; }

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

  .products-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .product-image { font-size: 2.5rem; }
  .product-info { padding: 12px; }
  .product-brand { font-size: 0.7rem; }
  .product-name { font-size: 0.85rem; }

  .announcement-bar { font-size: 0.8rem; padding: 10px 16px; }

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

  .trust-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    text-align: center;
  }
  .trust-item {
    flex-direction: column;
    gap: 4px;
    font-size: 0.75rem;
  }

  .filter-tab {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
}

/* === LARGE SCREENS (min 1440px) === */
@media (min-width: 1440px) {
  :root { --max-width: 1400px; }
  .products-grid { grid-template-columns: repeat(4, 1fr); }
}

/* === PRINT === */
@media print {
  .header, .footer, .announcement-bar, .newsletter, .back-to-top,
  .mobile-menu-btn, .cart-btn, .track-divider, .filter-bar,
  .lang-switcher, .lang-select, .hero-clouds, .hero-steam,
  .cookie-consent, .wishlist-btn, .wishlist-header-btn,
  .recently-viewed-section, .tss-toast { display: none !important; }
  .hero { background: #fff !important; color: var(--text) !important; padding: 20px 0; }
  .hero-text h1 { color: var(--text) !important; }
  body { font-size: 12pt; }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; }
  .product-animate { animation: none !important; opacity: 1; transform: none; }
  .category-animate { animation: none !important; opacity: 1; transform: none; }
  .hero-stat { animation: none !important; opacity: 1; }
  .hero { animation: none !important; }
  .hero::before, .hero::after { animation: none !important; }
  .hero .container::before, .hero .container::after { animation: none !important; display: none; }
  .announcement-bar { animation: none !important; }
  .cloud, .steam-puff, .puff { animation: none !important; display: none; }
  .wheel { animation: none !important; }
  .hero-train { animation: none !important; }
  .train-eye::after { animation: none !important; }
  .wishlist-btn.wishlist-pulse { animation: none !important; }
  .cart-btn.cart-header-pulse { animation: none !important; }
  .cart-float-plus { animation: none !important; display: none; }
  .cookie-consent { transition: none !important; }
  .tss-toast { transition: none !important; }
  .btn-primary::before, .btn-yellow::before { display: none !important; }
}

/* === DARK MODE (respects OS preference) === */
@media (prefers-color-scheme: dark) {
  /* Keep light mode for now — e-commerce stores perform better in light mode */
}
