/* ==========================================================================
   E-GADGET WORLD — RESPONSIVE STYLES
   Mehnajpur Branch, Azamgarh
   Mobile-First & Multi-Breakpoint Engine
   Supports: 320px, 360px, 375px, 390px, 430px, 768px, 1024px, 1440px
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESKTOP & LARGE MONITORS (1200px - 1440px+)
   -------------------------------------------------------------------------- */
@media (min-width: 1200px) {
  .catalog-layout {
    grid-template-columns: 280px 1fr;
    gap: 36px;
  }

  .laptops-grid {
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 28px;
  }
}

/* --------------------------------------------------------------------------
   2. LAPTOPS & TABLETS LANDSCAPE (<= 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root {
    --fs-hero: 2.625rem;           /* 42px */
    --fs-section: 1.875rem;        /* 30px */
  }

  .container {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .hero-visual {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
  }

  .catalog-layout {
    grid-template-columns: 260px 1fr;
    gap: 28px;
  }

  .laptops-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
  }

  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .detail-gallery-box {
    position: static;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }

  .about-grid,
  .service-split,
  .contact-page-grid,
  .branch-spotlight-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

/* --------------------------------------------------------------------------
   3. TABLETS & BELOW (<= 992px) â€” Mobile Header Activation
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .top-bar {
    display: none !important;
  }

  .site-header {
    height: 72px;
  }

  .site-header .nav-menu,
  .site-header .header-actions {
    display: none !important;
  }

  .hamburger-btn {
    display: flex !important;
  }

  .brand-logo-img {
    height: 42px;
  }

  /* Mobile Nav Drawer (Slide-out Off-Canvas) */
  .mobile-nav-drawer {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    max-width: 380px;
    height: calc(100vh - 72px);
    background-color: #FFFFFF;
    border-right: 1px solid var(--color-border);
    box-shadow: 10px 0 35px rgba(15, 23, 42, 0.15);
    padding: 24px 20px;
    overflow-y: auto;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.28s;
    z-index: var(--z-sticky);
  }

  .mobile-nav-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
}

/* --------------------------------------------------------------------------
   4. TABLETS PORTRAIT & MOBILE (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    /* Mobile Typography Scales (30-36px hero, 25-28px section, 17-19px card, 16px body/nav/btn, 22-25px price, 13-14px badge) */
    --fs-hero: 2.125rem;           /* 34px */
    --fs-section: 1.6875rem;       /* 27px */
    --fs-card-title: 1.125rem;     /* 18px */
    --fs-body: 1rem;               /* 16px */
    --fs-nav: 1rem;                /* 16px */
    --fs-btn: 1rem;                /* 16px */
    --fs-price: 1.5rem;            /* 24px */
    --fs-badge: 0.84375rem;        /* 13.5px */
  }

  body {
    padding-bottom: 70px; /* Space for mobile sticky bottom action bar */
  }

  .mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
  }

  .mobile-nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg-soft);
  }

  .mobile-nav-link:hover,
  .mobile-nav-link.active {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
  }

  .mobile-nav-sublinks {
    padding-left: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
  }

  .mobile-nav-sublink {
    display: block;
    padding: 10px 14px;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--color-border);
  }

  .mobile-nav-sublink:hover {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
  }

  .mobile-nav-contact-card {
    background-color: var(--color-bg-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 20px;
  }

  /* Mobile Sticky Bottom Bar */
  .mobile-bottom-bar {
    display: block;
  }

  /* Floating WhatsApp Icon */
  .floating-whatsapp {
    bottom: 82px;
    right: 18px;
    padding: 12px 14px;
    border-radius: var(--radius-full);
  }

  .floating-whatsapp span {
    display: none;
  }

  /* Catalog Layout & Mobile Filter Drawer */
  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 330px;
    max-width: 86vw;
    height: 100vh;
    background-color: #FFFFFF;
    z-index: var(--z-modal);
    border-radius: 0;
    overflow-y: auto;
    padding: 24px;
    box-shadow: var(--shadow-xl);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }

  .filter-sidebar.is-open {
    transform: translateX(0);
  }

  .btn-filter-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg-soft);
    font-size: 1.375rem;
    color: var(--text-primary);
    cursor: pointer;
  }

  .filter-sidebar-mobile-footer {
    display: block !important;
    position: sticky;
    bottom: -24px;
    background: #FFFFFF;
    padding: 16px 0 24px 0;
    margin-top: 24px;
    border-top: 1px solid var(--color-border);
  }

  .mobile-filter-toggle-btn {
    display: inline-flex !important;
  }

  /* Hero Section Spacing */
  .hero-section {
    padding: 48px 0 56px 0;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .section {
    padding-top: 52px;
    padding-bottom: 52px;
  }

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

  .compare-dock-inner {
    flex-direction: column;
    align-items: stretch;
  }
}

/* --------------------------------------------------------------------------
   4. COMFORTABLE 2-COLUMN TABLET / LARGE PHONES (580px - 768px)
   Cards have enough width (270px+) to display full content comfortably
   -------------------------------------------------------------------------- */
@media (min-width: 580px) and (max-width: 768px) {
  .laptops-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px !important;
  }
}

/* --------------------------------------------------------------------------
   5. MOBILE PHONES (350px to 579px)
   Covers standard smartphones: 360px, 375px, 390px, 430px
   Single-column spacious design: full-width cards, large readable fonts (18px title, 24px price, 16px buttons), zero cramping
   -------------------------------------------------------------------------- */
@media (max-width: 579px) {
  .laptops-grid {
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }

  .laptop-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }

  .laptop-card-image-wrap {
    height: 190px;
    padding: 16px;
  }

  .laptop-card-img {
    max-height: 150px;
  }

  .laptop-card-body {
    padding: 22px 20px;
  }

  .laptop-card-title {
    font-size: var(--fs-card-title);
    min-height: auto;
    margin-bottom: 12px;
  }

  .laptop-spec-chips {
    gap: 6px;
    margin-bottom: 14px;
  }

  .laptop-spec-chip {
    padding: 4px 10px;
    font-size: var(--fs-badge);
  }

  .laptop-card-price-row {
    padding-top: 14px;
    margin-bottom: 16px;
  }

  .laptop-price-value {
    font-size: var(--fs-price);
  }

  .laptop-card-actions {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .laptop-card-actions .btn {
    min-height: 46px;
    font-size: var(--fs-btn);
  }

  .hero-cta-group {
    flex-direction: column;
    width: 100%;
    gap: 14px;
  }

  .hero-cta-group .btn {
    width: 100%;
    min-height: 48px;
  }

  .catalog-toolbar {
    padding: 16px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .catalog-search-wrap {
    min-width: 100%;
  }

  .catalog-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
  }

  .mobile-filter-toggle-btn {
    flex: 1;
    min-height: 46px;
  }

  .catalog-sort-select {
    flex: 1.5;
    min-height: 46px;
  }

  .detail-price-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .detail-price-big {
    font-size: 2.125rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* --------------------------------------------------------------------------
   6. NARROW MOBILE DEVICES (<= 349px, e.g. 320px)
   Full readability & comfortable touch targets
   -------------------------------------------------------------------------- */
@media (max-width: 349px) {
  :root {
    --fs-hero: 1.875rem;           /* 30px */
    --fs-section: 1.5625rem;       /* 25px */
    --fs-card-title: 1.0625rem;    /* 17px */
    --fs-price: 1.375rem;          /* 22px */
    --fs-btn: 0.9375rem;           /* 15px */
    --fs-badge: 0.8125rem;         /* 13px */
  }

  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero-section {
    padding: 38px 0 46px 0;
  }

  .hero-title {
    font-size: var(--fs-hero);
  }

  .laptops-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .laptop-card-image-wrap {
    height: 165px;
    padding: 12px;
  }

  .laptop-card-img {
    max-height: 130px;
  }

  .laptop-card-body {
    padding: 16px 14px;
  }

  .laptop-card-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .laptop-card-actions .btn {
    min-height: 42px;
  }

  .filter-sidebar {
    width: 290px;
  }

  .mobile-bottom-bar-inner {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mobile-bar-btn {
    padding: 9px 8px;
    font-size: 0.875rem;
  }
}
