/* ============================================================
   Shining Smiles Periodontics — responsive overrides
   Mobile-first: assume small screen by default in style.css,
   then progressively enhance up. (Some shared base rules are
   in style.css; this file only contains breakpoint overrides.)
   ============================================================ */

/* ===== Large desktops (>= 1280px) — generous spacing ===== */
@media (min-width: 1280px) {
    :root {
        --section-y: 6rem;
    }
}

/* ===== Tablet landscape & small desktops (<= 1024px) ===== */
@media (max-width: 1024px) {
    :root {
        --fs-4xl: 3rem;
        --fs-3xl: 2.5rem;
        --fs-2xl: 2rem;
        --section-y: 4rem;
    }
    .hero-grid,
    .about-grid,
    .implants-grid,
    .doctor-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .hero-media,
    .about-media,
    .doctor-media,
    .implants-media {
        max-width: 560px;
        margin-inline: auto;
    }
    .features-grid,
    .services-grid,
    .testimonials-grid,
    .insurance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
    .cta-inner {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .cta-actions { justify-content: center; }
}

/* ===== Tablet portrait & mobile (<= 768px) ===== */
@media (max-width: 768px) {
    :root {
        --fs-4xl: 2.5rem;
        --fs-3xl: 2.15rem;
        --fs-2xl: 1.75rem;
        --fs-xl: 1.4rem;
        --section-y: 3.25rem;
        --header-h: 68px;
        --gutter: 1rem;
    }

    /* Topbar collapses to phone+social on mobile */
    .topbar-contact { gap: 0.85rem; }
    .topbar-contact .topbar-address,
    .topbar-contact a:nth-child(2) span { display: none; }
    .topbar-inner { justify-content: space-between; }

    /* Mobile nav */
    .nav-toggle { display: inline-flex; }
    .primary-nav {
        position: absolute;
        top: var(--header-h);
        left: 0; right: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1rem var(--gutter) 1.5rem;
        box-shadow: var(--shadow-md);
        border-top: 1px solid var(--color-border);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 300ms ease, opacity 200ms ease;
    }
    .primary-nav.open {
        max-height: 540px;
        opacity: 1;
    }
    .primary-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    .primary-nav a {
        display: block;
        padding: 0.85rem 0.5rem;
        border-bottom: 1px solid var(--color-border);
    }
    .primary-nav a::after { display: none; }
    .primary-nav a.active { color: var(--color-primary-dark); }
    .nav-cta { margin-top: 1rem; width: 100%; }

    .hero { padding-block: 3rem; }
    .hero-title { font-size: var(--fs-3xl); }
    .hero-cta .btn { flex: 1 1 auto; }
    .hero-badge { left: 0.5rem; bottom: 0.75rem; }

    .features-grid,
    .services-grid,
    .testimonials-grid,
    .insurance-grid {
        grid-template-columns: 1fr;
    }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

    .form-row { grid-template-columns: 1fr; }
    .card { padding: 1.5rem; }

    .about-stat,
    .doctor-credential,
    .hero-badge { right: 0.5rem; }

    .footer-grid { grid-template-columns: 1fr; gap: 2rem; padding-bottom: 2rem; }
    .footer-bottom-inner { justify-content: center; text-align: center; }
    .footer-bottom-inner p { width: 100%; }

    .section-head { margin-bottom: 2rem; }
    .page-hero { padding-block: 3rem; }
}

/* ===== Small mobile (<= 480px) ===== */
@media (max-width: 480px) {
    :root {
        --fs-4xl: 2.15rem;
        --fs-3xl: 1.9rem;
        --fs-2xl: 1.55rem;
    }
    .topbar { font-size: 0.75rem; }
    .topbar-contact a:nth-child(2) { display: none; } /* hide email on tiny screens */
    .brand-text strong { font-size: 1rem; }
    .brand-text small { font-size: 0.65rem; }
    .brand img { width: 40px; height: 40px; }

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

    .hero-cta { flex-direction: column; }
    .hero-cta .btn { width: 100%; }
    .hero-trust { gap: 0.85rem; }
    .hero-trust li { font-size: var(--fs-xs); }

    .btn-lg { padding: 0.85rem 1.25rem; font-size: var(--fs-sm); }

    .feature-card,
    .testimonial-card,
    .insurance-card { padding: 1.5rem; }

    .back-to-top {
        width: 42px; height: 42px;
        right: 0.85rem;
        bottom: 0.85rem;
    }
}
