/* ==========================================================================
   TTS — Tahir Termite Services (Pvt.) Ltd.
   Responsive Stylesheet (responsive.css)
   ========================================================================== */

/* Breakpoint: Desktop (<= 1200px) */
@media (max-width: 1200px) {
  :root {
    --container-max-width: 1080px;
  }

  .mega-menu {
    min-width: 620px;
  }

  .hero-grid {
    gap: 2.5rem;
  }

  .about-grid {
    gap: 2.5rem;
  }

  .footer-grid {
    grid-template-columns: 1.2fr 0.8fr 1fr 1fr 1.2fr;
    gap: 1.75rem;
  }
}

/* Breakpoint: Laptop / Small Desktop (<= 1024px) */
@media (max-width: 1024px) {
  :root {
    --header-height-top: 84px;
  }

  .desktop-nav {
    display: none;
    /* Switch to mobile drawer */
  }

  .nav-toggle-btn {
    display: flex;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3.5rem;
  }

  .hero-content {
    max-width: 100%;
    text-align: center;
  }

  .hero-badge-container {
    display: flex;
    justify-content: center;
  }

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

  .hero-trust-row {
    justify-content: center;
  }

  .hero {
    padding: 3.5rem 0 4.5rem;
  }

  .hero-title {
    font-size: clamp(2rem, 7vw, 2.8rem);
  }

  .hero-description {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
  }

  .hero-actions {
    gap: 0.8rem;
    margin-bottom: 1.75rem;
  }

  .hero-actions .btn {
    min-height: 48px;
  }

  .hero-visual-wrapper {
    max-width: 580px;
    margin: 0 auto;
  }

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

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

  .process-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem 1.5rem;
  }

  .timeline-track-svg {
    display: none;
  }

  .split-features-grid {
    grid-template-columns: 1fr;
  }

  .spotlight-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .service-page-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .service-sidebar {
    position: static;
    top: auto;
  }

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

  .footer-col-about {
    grid-column: span 2;
  }

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

/* Breakpoint: Tablet (<= 768px) */
@media (max-width: 768px) {
  h1 {
    font-size: clamp(2rem, 8vw, 2.65rem);
    line-height: 1.12;
  }

  h2 {
    font-size: clamp(1.55rem, 6.2vw, 2.15rem);
    line-height: 1.2;
  }

  .lead {
    font-size: 1rem;
    line-height: 1.65;
  }

  .breadcrumbs-bar {
    overflow: hidden;
  }

  .breadcrumbs-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
    white-space: nowrap;
  }

  .breadcrumbs-list::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav-link {
    min-height: 44px;
  }

  .mobile-nav-link a {
    display: flex;
    flex: 1;
    min-height: 44px;
    align-items: center;
  }

  .mobile-sub-item a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 1.1fr 0.9fr"] {
    grid-template-columns: 1fr !important;
  }

  .section {
    padding: 3.5rem 0;
  }

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

  .blog-card {
    padding: 1.5rem;
  }

  .topbar-content {
    justify-content: center;
    text-align: center;
    gap: 0.45rem;
  }

  .topbar-items {
    justify-content: center;
    gap: 0.55rem 1rem;
  }

  .topbar-item {
    font-size: 0.78rem;
  }

  .header-container {
    height: 76px;
  }

  .site-header.header-scrolled .header-container {
    height: 64px;
  }

  .site-logo {
    gap: 0.55rem;
    min-width: 0;
  }

  .logo-sub {
    max-width: 170px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-actions .btn-accent {
    display: none;
    /* Save space for hamburger */
  }

  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .trust-metric-card:not(:last-child)::after {
    display: none;
  }

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


  .about-experience-stamp {
    position: static;
    margin-top: 1rem;
    display: inline-block;
  }

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

  .certificate-showcase {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem 0;
  }

  .certificate-showcase-copy {
    max-width: 560px;
    padding-left: 0;
    text-align: center;
    margin: 0 auto;
  }

  .cta-banner {
    padding: 3rem 2rem;
    text-align: center;
  }

  .cta-banner-content {
    margin: 0 auto;
  }

  .testimonial-card-wrapper {
    padding: 0.75rem 0 0;
  }

  .testimonial-quote {
    font-size: 0.78rem;
  }

  .testimonial-slide {
    width: 210px;
    min-height: 175px;
  }

  .section-header {
    margin-bottom: 2.25rem;
  }

  .section-header.text-center {
    padding: 0 0.5rem;
  }

  .certificate-scroll-sticky {
    padding-top: 4.75rem;
  }

  .certificate-carousel-heading {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .certificate-carousel-heading h2 {
    margin-top: 0.65rem;
  }

  .certificate-carousel-heading p {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .certificate-scroll-caption {
    flex-wrap: wrap;
    gap: 0.35rem 0.8rem;
    padding: 0 1rem;
    text-align: center;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .floating-widget {
    bottom: 4.8rem;
    /* Avoid overlap with mobile bottom bar */
    right: 1.25rem;
  }

  body:has(.mobile-bottom-bar) .floating-widget {
    display: none;
  }

  .floating-action-btn span {
    display: none !important;
    /* Show only icon on mobile for floating buttons */
  }

  .floating-action-btn .google-profile-icon {
    display: inline-flex !important;
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0;
  }

  .floating-action-btn {
    padding: 0;
    width: 56px !important;
    height: 42px !important;
    min-width: 56px;
    min-height: 42px;
    border-radius: 0 !important;
    border-width: 2px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .floating-action-btn.google-profile {
    background: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.95) !important;
  }

  .floating-action-btn.whatsapp {
    background-color: #25D366 !important;
  }

  .floating-action-btn.whatsapp svg {
    width: 22px !important;
    height: 22px !important;
    color: #ffffff !important;
    fill: currentColor !important;
  }

  .floating-action-btn[href*="tel:"] {
    width: 56px !important;
    height: 42px !important;
    border-radius: 0 !important;
    background-color: #0B1B5E !important;
  }

  .back-to-top {
    bottom: 4.8rem;
    left: 1.25rem;
  }

  /* Show Mobile Bottom Quick Bar */
  .mobile-bottom-bar {
    display: block;
    padding-bottom: calc(0.65rem + env(safe-area-inset-bottom));
  }

  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
    /* Space for sticky bar */
  }

  .mobile-bottom-btn {
    min-height: 44px;
    padding: 0.55rem 0.35rem;
    font-size: 0.78rem;
    border-radius: 12px;
  }

  .back-to-top {
    bottom: calc(4.8rem + env(safe-area-inset-bottom));
  }
}

/* Breakpoint: Small Mobile (<= 480px, 430px, 390px, 375px, 320px) */
@media (max-width: 480px) {
  :root {
    --header-height-top: 76px;
  }

  .container {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .topbar {
    padding: 0.4rem 0;
  }

  .topbar-items {
    flex-direction: column;
    gap: 0.15rem;
  }

  .logo-main {
    font-size: 1.22rem;
  }

  .logo-symbol {
    width: 38px;
    height: 38px;
  }

  .logo-sub {
    display: none;
  }

  .hero {
    padding: 3.5rem 0 4.5rem 0;
  }

  .section {
    padding: 3rem 0;
  }

  .section-badge {
    max-width: 100%;
    font-size: 0.72rem;
    line-height: 1.35;
    white-space: normal;
  }

  .hero-title {
    font-size: clamp(1.85rem, 9vw, 2.15rem);
  }

  .hero-badge {
    max-width: 100%;
    font-size: 0.76rem;
    padding: 0.4rem 0.7rem;
    text-align: left;
  }

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

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

  .hero-trust-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .trust-item-micro {
    font-size: 0.8rem;
  }

  .hero-image-box {
    height: 340px;
  }

  .hero-floating-badge {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    padding: 1rem;
    gap: 0.75rem;
  }

  .badge-shield-icon {
    width: 40px;
    height: 40px;
  }

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

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

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

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

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


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

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

  .footer-col-about {
    grid-column: span 1;
  }

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

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

  .footer-social-link {
    min-height: 44px;
    align-items: center;
  }

  .certificate-scroll-sticky {
    padding-top: 4.25rem;
  }

  .certificate-carousel-viewport {
    margin-top: 1.15rem;
  }

  .certificate-card {
    height: min(48vh, 330px);
  }

  .lightbox-prev {
    left: 0.75rem;
  }

  .lightbox-next {
    right: 0.75rem;
  }

  .lightbox-dialog {
    width: calc(100vw - 4.5rem);
    max-width: calc(100vw - 4.5rem);
    max-height: 82vh;
  }

  .lightbox-image {
    max-width: 100%;
    max-height: 68vh;
  }

  .lightbox-nav-btn {
    z-index: 3;
    width: 44px;
    height: 44px;
    background: rgba(5, 15, 11, 0.82);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  }

  .lightbox-caption-bar {
    gap: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.82rem;
  }

  .lightbox-caption-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lightbox-close-btn {
    z-index: 3;
    top: 0.75rem;
    right: 0.75rem;
  }

  .termite-spotlight {
    padding: 2rem 1.25rem;
  }

  .split-card {
    padding: 2rem 1.5rem;
    min-height: 360px;
  }

  .floating-widget {
    right: 0.9rem;
  }

  .floating-action-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .back-to-top {
    left: 0.9rem;
  }
}

@media (max-width: 360px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .mobile-bottom-grid {
    gap: 0.3rem;
  }

  .mobile-bottom-btn {
    font-size: 0.72rem;
  }
}