/* ===== RESPONSIVE.CSS ===== */

/* ===== TABLET (max 1024px) ===== */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-brand {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 24px;
  }
  .footer-desc { margin: 0; }
  /*.footer-social { flex-direction: column; gap: 8px; }*/

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-visual { max-width: 500px; margin: 0 auto; }

  .service-detail-inner {
    grid-template-columns: 1fr;
  }
  .service-order-box { position: static; }

  .category-page-inner {
    grid-template-columns: 220px 1fr;
  }

  .offers-grid { grid-template-columns: 1fr 1fr; }
  .offers-grid .offer-card:last-child { grid-column: 1 / -1; }
}

/* ===== MOBILE (max 768px) ===== */
@media (max-width: 768px) {
  :root { --header-height: 100px; }

  /* Header */
  .header-top { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .logo { min-width: unset; }
  .search-wrapper { order: 3; width: 100%; max-width: 100%; }
  .header-actions { gap: 2px; }
  .header-btn .label { display: none; }
  .header-btn { min-width: 40px; padding: 6px; }
  .header-nav { display: none; }

  /* Mobile Menu Toggle - Show */
  .mobile-menu-toggle { display: flex !important; }

  /* Hero */
  .hero { padding: 36px 16px; }
  .hero-cards { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 16px; }
  .hero-stat-num { font-size: 1.2rem; }

  /* Categories */
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  .category-card { padding: 12px 8px; }
  .category-card .cat-icon { font-size: 1.5rem; }
  .category-card .cat-name { font-size: 0.65rem; }

  /* Services Grid */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .card-img-wrapper { height: 140px; }
  .card-body { padding: 10px; }
  .card-title { font-size: 0.85rem; }
  .card-price { font-size: 1rem; }
  .card-action-row .btn { font-size: 0.72rem; padding: 7px 8px; }

  /* Offers */
  .offers-grid {
    grid-template-columns: 1fr;
  }

  /* Category Page */
  .category-page { padding: 16px; }
  .category-page-inner { grid-template-columns: 1fr; }
  .filters-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    height: 100%;
    z-index: 1100;
    border-radius: 0;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-xl);
  }
  .filters-sidebar.open { left: 0; }
  .filter-toggle-btn { display: flex !important; }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .footer-brand { grid-column: 1 / -1; flex-direction: column; }

  /* Mobile Bottom Bar */
  .mobile-bottom-bar { display: block; }
  .floating-btns { bottom: 72px; }

  /* Page spacing for mobile bottom bar */
  footer { padding-bottom: 72px; }

  /* Section */
  .section { padding: 24px 16px; }

  /* Scroll Row */
  .scroll-row .service-card { width: 200px; }
  .scroll-row .card-img-wrapper { height: 130px; }

  /* Service Detail */
  .service-main-img { height: 250px; }
  .service-detail { padding: 16px; }

  /* FAQ */
  .faq-section { padding: 24px 16px; }

  /* Rec Tabs */
  .rec-tabs { gap: 6px; }
  .rec-tab { padding: 6px 12px; font-size: 0.75rem; }

  /* Section Header */
  .section-header { margin-bottom: 16px; }
  .section-title { font-size: 1.1rem; }

  /* Modal */
  .modal { width: 95%; border-radius: var(--radius); }
  .modal-body { padding: 16px; }

  /* Toast */
  .toast-container { right: 10px; left: 10px; }
  .toast { max-width: 100%; }
}

/* ===== SMALL MOBILE (max 480px) ===== */
@media (max-width: 480px) {
  .hero-title { font-size: 1.6rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-cards { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .hero-mini-card { padding: 10px 6px; }
  .hero-mini-card .card-icon { font-size: 1.4rem; }
  .hero-mini-card .card-name { font-size: 0.65rem; }
  .hero-mini-card .card-price { display: none; }

  .categories-grid { grid-template-columns: repeat(3, 1fr); }

  .services-grid { grid-template-columns: 1fr; gap: 10px; }
  .card-img-wrapper { height: 120px; }
  .card-title { font-size: 0.8rem; }

  .footer-top { grid-template-columns: 1fr 1fr; }

  .offers-grid { grid-template-columns: 1fr; }

  .search-category-select { display: none; }
  .search-box { border-radius: 8px; }
  .search-input { padding: 10px 12px; font-size: 0.85rem; }

  .mobile-nav-item { min-width: unset; padding: 6px 8px; }
}

/* ===== LARGE SCREENS (min 1440px) ===== */
/*@media (min-width: 1440px) {*/
/*  .container { max-width: 1400px; }*/
/*  .services-grid { grid-template-columns: repeat(5, 1fr); }*/
/*  .categories-grid { grid-template-columns: repeat(13, 1fr); }*/
/*}*/

/* ===== PRINT ===== */
@media print {
  header, footer, .floating-btns, .mobile-bottom-bar { display: none !important; }
  .service-order-box { box-shadow: none; border: 1px solid #ccc; }
}

/* ===== DARK MODE (optional) ===== */
@media (prefers-color-scheme: dark) {
  /* We keep light theme for this premium ecommerce site */
}

/* ===== HIGH DPI ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo-icon { image-rendering: crisp-edges; }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== FOCUS STYLES ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ===== FILTER SIDEBAR OVERLAY ===== */
.filter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1050;
  display: none;
  backdrop-filter: blur(2px);
}
.filter-overlay.active { display: block; }

/* ===== MOBILE SEARCH BAR ===== */
@media (max-width: 768px) {
  .header-top .search-wrapper { flex-basis: 100%; }
}

/* ===== MEGA MENU MOBILE ===== */
@media (max-width: 768px) {
  .mega-menu { padding: 16px; }
  .mega-menu-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mega-cat-item { padding: 10px 12px; }
  .mega-cat-count { display: none; }
}

/* ===== SCROLL SNAP ===== */
.snap-container {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.snap-container .service-card { scroll-snap-align: start; }

/* ===== ANIMATIONS ===== */
.fade-in { animation: fadeIn 0.5s ease forwards; }
.slide-up { animation: slideUp 0.4s ease forwards; }
.zoom-in { animation: zoomIn 0.3s ease forwards; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Stagger animation for cards */
.services-grid .service-card:nth-child(1) { animation-delay: 0ms; }
.services-grid .service-card:nth-child(2) { animation-delay: 60ms; }
.services-grid .service-card:nth-child(3) { animation-delay: 120ms; }
.services-grid .service-card:nth-child(4) { animation-delay: 180ms; }
.services-grid .service-card:nth-child(5) { animation-delay: 240ms; }
.services-grid .service-card:nth-child(6) { animation-delay: 300ms; }
