/* ==========================================================================
   Affordable Appliance Repairs - Responsive Stylesheet
   Website: https://affordableappliancerepairs.com/
   Mobile-First Breakpoints & Adaptive Layouts
   Tested across 320px, 360px, 375px, 393px, 768px, 1024px, and 1440px
   ========================================================================== */

/* Global viewport overflow protection */
html,
body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Laptops & Medium Desktops (992px to 1200px)
   -------------------------------------------------------------------------- */
/* Desktop View (min-width: 992px): Always hide hamburger button */
@media screen and (min-width: 992px) {
  .mobile-menu-btn {
    display: none !important;
  }

  .nav-menu-container {
    display: flex !important;
    position: static;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border-top: none;
    z-index: auto;
  }
}

/* Laptops & Medium Desktops (992px to 1200px) */
@media screen and (min-width: 992px) and (max-width: 1200px) {
  .site-header .container {
    gap: 12px;
    flex-wrap: nowrap;
  }

  .brand-logo,
  .brand-logo-link img,
  .header-logo img {
    height: 38px;
    max-height: 40px;
    max-width: 175px;
  }

  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 32px;
  }

  .hero-content h1 {
    font-size: 2.45rem;
  }

  .hero-illustration {
    max-width: 420px;
    max-height: 315px;
  }

  .nav-menu-container {
    gap: 12px;
    flex-shrink: 0;
  }

  .nav-links,
  .nav-list {
    gap: 10px;
    flex-wrap: nowrap;
  }

  .nav-link,
  .nav-list > li > a {
    font-size: 0.8125rem;
    white-space: nowrap;
    padding: 4px 0;
  }

  .header-cta-group .btn {
    padding: 7px 14px;
    font-size: 0.8125rem;
    white-space: nowrap;
  }
}

/* --------------------------------------------------------------------------
   Tablets & Mobile Navigation Drawer (max-width: 991px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 991px) {
  :root {
    --header-height: 64px;
  }

  .site-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #ffffff !important;
  }

  body.nav-open {
    overflow: hidden;
  }

  .site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .brand-logo,
  .brand-logo-link img,
  .header-logo img {
    height: 36px;
    max-height: 38px;
    max-width: 175px;
  }

  /* Mobile Navigation Menu Drawer */
  .mobile-menu-btn {
    display: inline-flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4.5px;
    width: 42px;
    height: 42px;
    padding: 8px;
    box-sizing: border-box;
    margin-left: auto;
  }

  .mobile-menu-btn .menu-bar {
    display: block;
    width: 22px;
    height: 2.5px;
    background-color: var(--color-primary);
    border-radius: 2px;
  }

  .nav-menu-container {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    padding: 16px 20px 88px;
    display: none !important;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.15);
    z-index: 1050; /* Above floating buttons (995) */
  }

  .nav-menu-container.is-open {
    display: flex !important;
  }

  .nav-links,
  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    margin-bottom: 20px;
    padding: 0;
  }

  .nav-links > li,
  .nav-list > li {
    width: 100%;
    border-bottom: 1px solid var(--color-border-light);
  }

  .nav-link,
  .nav-list > li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 4px;
    font-size: 1rem;
    border-bottom: none;
  }

  .nav-item-dropdown {
    width: 100%;
  }

  .nav-item-dropdown .dropdown-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Mobile Dropdown Accordion */
  .nav-item-dropdown .dropdown-menu {
    display: none;
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 2.5px solid var(--color-brand-blue);
    margin: 4px 0 12px 10px;
    padding: 4px 0 4px 10px;
    background: #f8fafc;
    border-radius: 4px;
    width: calc(100% - 10px);
    box-sizing: border-box;
  }

  .nav-item-dropdown.is-open .dropdown-menu {
    display: block;
  }

  .dropdown-item {
    padding: 9px 8px;
    font-size: 0.9375rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  }

  .dropdown-item:last-child {
    border-bottom: none;
  }

  .header-cta-group,
  .header-contact-action {
    width: 100%;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
  }

  .header-cta-group .btn,
  .header-contact-action .btn {
    width: 100%;
  }

  /* Hero Section Stacking for Tablets & Mobile */
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 2.35rem;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-media {
    order: 2;
    margin-top: 16px;
    width: 100%;
    min-width: 0;
  }

  .hero-illustration {
    max-width: 380px;
    max-height: 285px;
  }

  .category-pills-wrap {
    align-items: center;
    text-align: center;
  }

  .category-pills-list {
    justify-content: center;
  }

  .hero-features-list {
    justify-content: center;
  }

  .hubs-grid,
  .hub-showcase-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

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

/* --------------------------------------------------------------------------
   Small Tablets & Mobile Devices (max-width: 768px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
  /* Prevent content and footer from being covered by fixed bottom contact bar */
  body {
    padding-bottom: 68px !important;
  }

  .breadcrumb-list {
    flex-wrap: wrap !important;
    gap: 4px 6px !important;
  }

  /* Floating contact buttons on mobile */
  .floating-contact-btn {
    width: 46px;
    height: 46px;
  }

  .floating-contact-btn svg {
    width: 22px;
    height: 22px;
  }

  .floating-btn-call {
    right: 10px;
  }

  .floating-btn-whatsapp {
    left: 10px;
  }

  /* Breadcrumb & heading vertical spacing cleanup */
  .breadcrumb-nav,
  .breadcrumb-bar {
    padding: 6px 0 !important;
    font-size: 0.8rem;
  }

  .page-header {
    padding: 16px 0 14px;
  }

  .page-hero {
    padding: 16px 0 14px !important;
  }

  .page-header h1,
  .page-hero h1 {
    font-size: 1.625rem;
    line-height: 1.25;
    margin-top: 0;
    margin-bottom: 10px;
    word-break: break-word;
    overflow-wrap: break-word;
  }

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

  .section-title {
    font-size: 1.625rem;
  }

  .hero-content h1 {
    font-size: 2.05rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }

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

  .hero-media {
    order: 2;
    margin-top: 12px;
  }

  .hero-illustration {
    max-width: 320px;
    max-height: 240px;
  }

  /* Grid adjustments */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

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

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

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .footer-legal-links {
    flex-wrap: wrap;
    gap: 12px;
  }

  .form-card {
    padding: 24px 18px;
  }

  .cta-box {
    padding: 30px 18px;
  }

  .cta-box h2,
  .cta-box h3 {
    font-size: 1.45rem;
  }

  .washer-types-grid,
  .tv-types-grid,
  .fridge-types-grid,
  .case-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Ultra-Compact Screens (max-width: 480px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 480px) {
  :root {
    --header-height: 60px;
  }

  .brand-logo,
  .brand-logo-link img,
  .header-logo img {
    height: 34px;
    max-height: 36px;
    max-width: 175px;
  }

  .hero-content h1 {
    font-size: 1.75rem;
    line-height: 1.25;
  }

  .hero-illustration {
    max-width: 260px;
    max-height: 195px;
  }

  .category-pill {
    padding: 5px 12px;
    font-size: 0.8125rem;
  }

  .btn {
    padding: 10px 18px;
    font-size: 0.875rem;
  }

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

  .faq-question {
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  .faq-answer {
    padding: 0 16px 16px 16px;
  }

  .hub-showcase-card,
  .service-card {
    padding: 20px 16px;
  }
}

/* --------------------------------------------------------------------------
   Extreme Compact Mobiles (max-width: 360px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 360px) {
  .hero-content h1 {
    font-size: 1.55rem;
  }

  .brand-logo,
  .brand-logo-link img,
  .header-logo img {
    height: 30px;
    max-height: 32px;
    max-width: 150px;
  }

  .floating-contact-btn {
    width: 40px;
    height: 40px;
  }

  .floating-contact-btn svg {
    width: 19px;
    height: 19px;
  }

  .floating-btn-call {
    right: 6px;
  }

  .floating-btn-whatsapp {
    left: 6px;
  }

  .hero-illustration {
    max-width: 230px;
    max-height: 172px;
  }

  /* Fixed bottom contact bar on mobile (max-width: 480px) */
  .bottom-contact-bar {
    padding: 7px 10px;
    padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px));
  }

  .bottom-contact-bar-inner {
    gap: 8px;
  }

  .bottom-bar-btn {
    height: 44px;
    padding: 8px 10px;
    font-size: 0.875rem;
    gap: 6px;
  }

  .bottom-bar-icon {
    width: 18px;
    height: 18px;
  }
}

/* --------------------------------------------------------------------------
   Extra Small Mobile Devices (max-width: 340px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 340px) {
  .bottom-contact-bar {
    padding: 6px 8px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .bottom-contact-bar-inner {
    gap: 6px;
  }

  .bottom-bar-btn {
    height: 42px;
    padding: 6px 6px;
    font-size: 0.8125rem;
    gap: 5px;
  }

  .bottom-bar-icon {
    width: 16px;
    height: 16px;
  }
}

/* --------------------------------------------------------------------------
   Collision Prevention on Short Viewport Heights
   -------------------------------------------------------------------------- */
@media screen and (max-height: 480px) {
  .floating-contact-btn {
    top: 40%;
  }
}

@media screen and (max-height: 360px) {
  .floating-contact-actions {
    display: none !important;
  }
}

