/* ===========================
   Responsive Styles
   =========================== */

/* Tablet: 768px–1024px */
@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

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

    .hero-content p {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

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

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

    .hero-tooth-svg {
        max-width: 320px;
    }

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

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

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

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

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

    .testimonials-grid .testimonial-card:last-child {
        grid-column: 1 / -1;
        max-width: 500px;
        margin: 0 auto;
    }

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

    .footer-grid .footer-col:first-child {
        grid-column: 1 / -1;
    }

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

    .service-sidebar {
        position: static;
    }

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

    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
    }

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

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

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

/* Mobile: < 768px */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.75rem;
    }

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

    .services-page-grid {
        grid-template-columns: 1fr;
        padding: 2rem 0 3rem;
    }

    .hero-trust {
        gap: 1.25rem 1.75rem;
    }

    .hero-trust-number {
        font-size: 1.4rem;
    }

    .trust-strip-inner {
        justify-content: flex-start;
    }

    /* Navbar mobile */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1rem 1.5rem 1.5rem;
        gap: 0;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
        border-radius: 0 0 12px 12px;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        color: var(--text-gray) !important;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-light);
        display: block;
    }

    .nav-links a:hover,
    .nav-links a.active {
        color: var(--primary-teal) !important;
    }

    .nav-links a.active::after {
        display: none;
    }

    .nav-cta {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* Keep both contact controls on one row instead of stacking them over
       mobile page content. The voice widget occupies the bottom-right. */
    .whatsapp-float {
        bottom: 32px;
        right: auto;
        left: 16px;
    }

    .voice-call-facade {
        right: 16px;
        bottom: 32px;
    }

    /* Solid navbar while mobile menu is open — page content otherwise
       bleeds through the transparent navbar above the white dropdown */
    .navbar.menu-open {
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: saturate(180%) blur(12px);
        -webkit-backdrop-filter: saturate(180%) blur(12px);
        box-shadow: var(--shadow-navbar);
    }

    .navbar.menu-open .hamburger span {
        background: var(--dark-navy);
    }

    .teal-hero .navbar.menu-open .logo-img,
    .navy-hero .navbar.menu-open .logo-img {
        filter: none;
    }

    /* 16px inputs prevent iOS Safari auto-zoom on focus */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Hero mobile */
    .hero {
        min-height: auto;
        padding: 7rem 0 3rem;
    }

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

    .hero-content p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 2rem;
    }

    .hero-buttons .btn-primary,
    .hero-buttons .btn-outline,
    .hero-buttons .btn-whatsapp {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        text-align: center;
    }

    .hero-tooth-svg {
        max-width: 280px;
    }

    /* Page hero */
    .page-hero {
        padding: 7rem 0 3rem;
    }

    .page-hero h1 {
        font-size: 2rem;
    }

    /* Service images */
    .service-page-img {
        height: 180px;
    }

    .service-image-banner .service-banner-img {
        max-height: 250px;
    }

    /* Grid layouts */
    .why-us-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .testimonials-grid .testimonial-card:last-child {
        max-width: 100%;
    }

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

    .hours-grid {
        grid-template-columns: 1fr;
        max-width: 350px;
        margin: 0 auto 1.5rem;
    }

    /* CTA */
    .cta-banner h2 {
        font-size: 1.5rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    /* Steps */
    .steps-grid {
        grid-template-columns: 1fr;
    }

    /* Values */
    .values-grid {
        grid-template-columns: 1fr;
    }

    /* Team */
    .team-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    /* Digital section */
    .digital-section {
        padding: 2rem 1.5rem;
    }

    /* Service page card */
    .service-page-card {
        flex-direction: column;
        padding: 1.5rem;
    }

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

    .blog-post-hero h1 {
        font-size: 1.75rem;
    }

    .blog-card-image {
        height: 180px;
    }

    /* Time slots */
    .time-slots {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* A seven-column calendar cannot retain 44px targets plus 8px spacing on
   narrow phones, so use the platform's accessible date control instead. */
@media (max-width: 420px) {
    .calendar-picker {
        display: none;
    }

    .mobile-date-picker {
        display: block;
    }

    .mobile-date-input {
        min-height: 48px;
        appearance: auto !important;
        -webkit-appearance: auto !important;
    }

    .calendar-keyboard-help {
        display: none;
    }

    .mobile-date-help {
        display: inline;
    }
}

/* Small mobile: < 480px */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

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

    .why-card,
    .service-card {
        padding: 1.5rem 1rem;
    }

    .doctor-card {
        padding: 1.5rem;
    }

    .team-card {
        padding: 2rem 1.5rem;
    }

    .team-avatar {
        width: 110px;
        height: 110px;
        font-size: 2.5rem;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
    }

    .whatsapp-tooltip {
        display: none;
    }

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

    .calendar-picker {
        padding: 1rem;
    }

    .calendar-day {
        font-size: 0.8rem;
    }

    .hero-tooth-svg {
        max-width: 220px;
    }

    .service-page-img {
        height: 150px;
    }

    .blog-card-image {
        height: 160px;
    }

    .doctor-avatar {
        width: 80px;
        height: 80px;
    }

    .team-avatar {
        width: 110px;
        height: 110px;
    }
}

/* Tighten the widget gutters so both contact controls still fit at 320px. */
@media (max-width: 360px) {
    elevenlabs-convai {
        right: 8px !important;
        left: auto !important;
    }

    .voice-call-facade {
        right: 8px;
    }

    .whatsapp-float {
        bottom: 32px;
        right: auto;
        left: 8px;
    }
}
