/* ============================
   MY DENT PRO - Main Stylesheet
   Prothésiste Dentaire Franche-Comté
   ============================ */

:root {
    --primary: #1a6b8a;
    --primary-dark: #124d65;
    --primary-light: #e8f4f8;
    --accent: #2ecc71;
    --accent-dark: #27ae60;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --bg: #ffffff;
    --bg-light: #f8fafb;
    --bg-dark: #1a2332;
    --border: #e0e6ed;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --transition: 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    line-height: 1.7;
    background: var(--bg);
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- HEADER --- */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 10px rgba(0,0,0,0.05);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
}

.main-nav a {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition);
    font-size: 0.95rem;
}

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

.nav-cta {
    background: var(--primary) !important;
    color: #fff !important;
}
.nav-cta:hover {
    background: var(--primary-dark) !important;
}

/* Hamburger button */
.menu-toggle {
    display: none;
    background: var(--primary-light);
    border: 2px solid var(--primary);
    border-radius: 10px;
    cursor: pointer;
    padding: 8px;
    width: 48px;
    height: 48px;
    position: relative;
    z-index: 1002;
    font-size: 1.5rem;
    color: var(--primary);
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

/* Hide text when JS replaces with hamburger spans */
.menu-toggle:has(.hamburger) {
    font-size: 0;
}

.menu-toggle .hamburger {
    display: block;
    width: 22px;
    height: 3px;
    background: var(--primary);
    position: relative;
    transition: all 0.35s ease;
    margin: 0 auto;
    border-radius: 2px;
}

.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
    content: '';
    display: block;
    width: 22px;
    height: 3px;
    background: var(--primary);
    position: absolute;
    left: 0;
    transition: all 0.35s ease;
    border-radius: 2px;
}

.menu-toggle .hamburger::before { top: -7px; }
.menu-toggle .hamburger::after { top: 7px; width: 16px; }

.menu-toggle.active { background: #fff; border-color: var(--primary); }
.menu-toggle.active .hamburger { background: transparent; }
.menu-toggle.active .hamburger::before { top: 0; transform: rotate(45deg); }
.menu-toggle.active .hamburger::after { top: 0; transform: rotate(-45deg); width: 22px; }

.nav-close { display: none; }

/* Mobile nav header & footer (injected by JS) */
.mobile-nav-header,
.mobile-nav-footer { display: none; }

/* --- HERO --- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 650px;
    margin: 0 auto 30px;
}

.hero-small { padding: 50px 20px; }
.hero-small h1 { font-size: 2.2rem; }

.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(46,204,113,0.3);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.4);
}
.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: #fff;
}

.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* --- SECTIONS --- */
.section {
    padding: 80px 20px;
}

.section-light { background: var(--bg-light); }

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.section-title p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* --- CARDS --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text);
}

.card p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.card-link {
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.card-link:hover { gap: 10px; }

/* --- SERVICE DETAIL --- */
.service-detail {
    padding: 60px 20px;
}

.service-content {
    max-width: 900px;
    margin: 0 auto;
}

.service-content h2 {
    font-size: 1.6rem;
    margin: 40px 0 16px;
    color: var(--primary-dark);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
}

.service-content h3 {
    font-size: 1.2rem;
    margin: 24px 0 12px;
    color: var(--text);
}

.service-content p {
    margin-bottom: 16px;
    color: var(--text);
}

.service-content ul {
    margin: 12px 0 20px 24px;
    color: var(--text);
}

.service-content li {
    margin-bottom: 8px;
    padding-left: 8px;
}

.service-content li::marker {
    color: var(--primary);
}

.service-highlight {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    padding: 20px 24px;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 24px 0;
}

.service-highlight p { margin: 0; color: var(--primary-dark); }

/* --- FEATURES --- */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.feature {
    text-align: center;
    padding: 24px;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.feature p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* --- ZONE DESSERVIE --- */
.map-container {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    margin: 30px 0;
}

#map {
    width: 100%;
    height: 500px;
}

.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin: 30px 0;
}

.city-tag {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.city-tag .cp {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 400;
}

.city-tag:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

a.city-tag {
    color: var(--text);
    text-decoration: none;
}
a.city-tag:hover {
    color: var(--primary);
}

/* --- BREADCRUMB --- */
.breadcrumb {
    padding: 16px 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.breadcrumb-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--primary); }
.breadcrumb-sep { color: var(--border); }

/* --- CTA SECTION --- */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    text-align: center;
    padding: 60px 20px;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 16px;
}

.cta-section p {
    opacity: 0.9;
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.cta-phones {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cta-phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.15);
    padding: 12px 24px;
    border-radius: 8px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all var(--transition);
}
.cta-phone:hover {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* --- FOOTER --- */
.site-footer {
    background: var(--bg-dark);
    color: #ccc;
    padding: 60px 20px 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto 40px;
}

.footer-col h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.footer-col p,
.footer-col li {
    font-size: 0.9rem;
    margin-bottom: 10px;
    line-height: 1.6;
}

.footer-col ul { list-style: none; }

.footer-col a { color: #aaa; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- RESPONSIVE --- */

/* Tablet */
@media (max-width: 992px) {
    .hero h1 { font-size: 2.4rem; }
    .hero-small h1 { font-size: 1.9rem; }
    .cards-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
    .features { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
    .cities-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* Mobile landscape / small tablet */
@media (max-width: 768px) {
    body { padding-top: 60px; }

    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .menu-toggle { display: flex; align-items: center; justify-content: center; }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: #fff;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        padding: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        pointer-events: none;
    }

    .main-nav.open {
        transform: translateX(0);
        pointer-events: auto;
    }

    /* Hide default close button */
    .nav-close { display: none !important; }

    /* Mobile nav header */
    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border);
        flex-shrink: 0;
    }

    .mobile-nav-header .mobile-logo {
        font-size: 1.4rem;
        font-weight: 800;
        color: var(--primary);
    }

    .mobile-nav-header .mobile-logo span { color: var(--accent); }

    .mobile-nav-close {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: none;
        background: var(--bg-light);
        color: var(--text);
        font-size: 1.4rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all var(--transition);
    }

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

    /* Nav links */
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 12px 0;
        flex: 1;
    }

    .main-nav li {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .main-nav.open li {
        opacity: 1;
    }

    .main-nav.open li:nth-child(1) { transition-delay: 0.08s; }
    .main-nav.open li:nth-child(2) { transition-delay: 0.14s; }
    .main-nav.open li:nth-child(3) { transition-delay: 0.20s; }
    .main-nav.open li:nth-child(4) { transition-delay: 0.26s; }

    .main-nav a {
        padding: 18px 24px;
        font-size: 1.15rem;
        font-weight: 600;
        min-height: 60px;
        display: flex;
        align-items: center;
        gap: 14px;
        border-radius: 0;
        color: var(--text);
        position: relative;
        border-bottom: none;
    }

    .main-nav a::before {
        content: '';
        width: 4px;
        height: 0;
        background: var(--primary);
        border-radius: 2px;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        transition: height 0.3s ease;
    }

    .main-nav a.active::before { height: 28px; }

    .main-nav a:hover,
    .main-nav a.active {
        background: var(--primary-light);
        color: var(--primary);
        border-radius: 0;
    }

    .main-nav a::after { display: none; }

    /* Nav icon (injected by JS) */
    .nav-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: var(--primary-light);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        flex-shrink: 0;
        transition: all var(--transition);
    }

    .main-nav a.active .nav-icon,
    .main-nav a:hover .nav-icon {
        background: var(--primary);
        color: #fff;
    }

    .main-nav .nav-cta {
        margin: 8px 20px 0;
        border-radius: 12px;
        justify-content: center;
        font-size: 1.1rem;
        min-height: 56px;
        gap: 10px;
    }

    .main-nav .nav-cta .nav-icon {
        background: rgba(255,255,255,0.2);
        color: #fff;
    }

    /* Mobile nav footer */
    .mobile-nav-footer {
        display: block;
        padding: 20px 24px;
        border-top: 1px solid var(--border);
        flex-shrink: 0;
    }

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

    .mobile-nav-phone {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: 12px;
        color: var(--text);
        font-weight: 600;
        font-size: 1rem;
        transition: all var(--transition);
        text-decoration: none;
    }

    .mobile-nav-phone:active {
        background: var(--primary-light);
        border-color: var(--primary);
        color: var(--primary);
    }

    .mobile-nav-phone .phone-icon {
        width: 40px;
        height: 40px;
        background: var(--accent);
        color: #fff;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .mobile-nav-address {
        font-size: 0.82rem;
        color: var(--text-light);
        line-height: 1.5;
        text-align: center;
    }

    .hero { padding: 50px 16px; }
    .hero h1 { font-size: 1.8rem; }
    .hero p { font-size: 1rem; margin-bottom: 20px; }
    .hero-small { padding: 35px 16px; }
    .hero-small h1 { font-size: 1.5rem; }
    .hero-buttons { flex-direction: column; align-items: center; gap: 12px; }
    .hero-buttons .btn { width: 100%; max-width: 300px; text-align: center; }

    .section { padding: 40px 16px; }
    .section-title h2 { font-size: 1.5rem; }
    .section-title p { font-size: 1rem; }

    .cards-grid { grid-template-columns: 1fr; gap: 16px; }
    .card { padding: 24px 20px; }

    .features { grid-template-columns: 1fr 1fr; gap: 16px; }
    .feature { padding: 16px 12px; }
    .feature-icon { font-size: 2rem; }
    .feature h3 { font-size: 1rem; }

    .service-detail { padding: 40px 16px; }
    .service-content h2 { font-size: 1.35rem; margin-top: 32px; }
    .service-content h3 { font-size: 1.1rem; }
    .service-highlight { padding: 16px 18px; margin: 20px 0; }

    .seo-links { gap: 8px; margin: 20px 0; }
    .seo-links a { padding: 10px 16px; font-size: 0.82rem; min-height: 44px; display: inline-flex; align-items: center; }

    .cta-section { padding: 40px 16px; }
    .cta-section h2 { font-size: 1.5rem; }
    .cta-phones { flex-direction: column; align-items: center; gap: 12px; }
    .cta-phone { width: 100%; max-width: 300px; justify-content: center; min-height: 52px; font-size: 1.05rem; }

    #map { height: 300px; }
    .cities-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
    .city-tag { padding: 10px 12px; font-size: 0.85rem; min-height: 44px; }

    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
    .site-footer { padding: 40px 16px 24px; }
    .footer-col h4 { margin-bottom: 14px; }

    .breadcrumb { padding: 12px 16px; }
    .breadcrumb-inner { font-size: 0.8rem; gap: 5px; }

    .price-table { font-size: 0.85rem; }
    .price-table th, .price-table td { padding: 10px 12px; }

    .container { padding: 0 16px; }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .header-inner { padding: 10px 12px; }
    .logo { font-size: 1.4rem; }
    .menu-toggle { font-size: 1.6rem; padding: 10px; min-width: 48px; min-height: 48px; }

    .hero { padding: 35px 12px; }
    .hero h1 { font-size: 1.5rem; line-height: 1.25; }
    .hero p { font-size: 0.92rem; }
    .hero-small { padding: 28px 12px; }
    .hero-small h1 { font-size: 1.3rem; }

    .section { padding: 32px 12px; }
    .section-title h2 { font-size: 1.3rem; }
    .section-title { margin-bottom: 30px; }

    .card { padding: 20px 16px; }
    .card h3 { font-size: 1.1rem; }
    .card p { font-size: 0.9rem; }
    .card-icon { width: 48px; height: 48px; font-size: 1.3rem; margin-bottom: 14px; }

    .features { grid-template-columns: 1fr; gap: 12px; }
    .feature { padding: 16px; text-align: left; display: flex; gap: 16px; align-items: flex-start; }
    .feature-icon { margin-bottom: 0; flex-shrink: 0; font-size: 1.8rem; }

    .service-detail { padding: 28px 12px; }
    .service-content h2 { font-size: 1.2rem; margin-top: 28px; }
    .service-content ul { margin-left: 16px; }
    .service-highlight { padding: 14px 16px; font-size: 0.92rem; }

    .seo-links { justify-content: flex-start; }
    .seo-links a { font-size: 0.8rem; padding: 8px 14px; }

    .cta-section { padding: 32px 12px; }
    .cta-section h2 { font-size: 1.3rem; }
    .cta-section p { font-size: 0.92rem; }

    #map { height: 250px; }
    .map-container { margin: 20px 0; border-radius: 8px; }
    .cities-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .city-tag { font-size: 0.8rem; padding: 8px 10px; }
    .city-tag .cp { font-size: 0.7rem; }

    .breadcrumb { padding: 10px 12px; }
    .breadcrumb-inner { font-size: 0.75rem; gap: 4px; line-height: 1.6; }

    .site-footer { padding: 32px 12px 20px; }
    .footer-bottom { font-size: 0.78rem; }

    .price-table { font-size: 0.8rem; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .price-table th, .price-table td { padding: 8px 10px; white-space: nowrap; }

    .container { padding: 0 12px; }
    .btn { padding: 12px 24px; font-size: 0.95rem; }
}

/* Fix iOS tap highlight & input zoom */
@media (max-width: 768px) {
    * { -webkit-tap-highlight-color: transparent; }
    input, select, textarea { font-size: 16px !important; }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }

/* --- SEO internal link list --- */
.seo-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 30px 0;
}

.seo-links a {
    display: inline-block;
    padding: 8px 18px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}

.seo-links a:hover {
    background: var(--primary);
    color: #fff;
}

/* Table styles */
.price-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.price-table th {
    background: var(--primary);
    color: #fff;
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
}

.price-table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}

.price-table tr:nth-child(even) { background: var(--bg-light); }
.price-table tr:hover { background: var(--primary-light); }

/* ============================
   ANIMATIONS
   ============================ */

/* --- Keyframes --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Hero animations --- */
.hero h1 {
    animation: fadeInUp 0.8s ease both;
}

.hero p {
    animation: fadeInUp 0.8s 0.2s ease both;
}

.hero-buttons {
    animation: fadeInUp 0.8s 0.4s ease both;
}

/* --- Header slide-in (desktop only) --- */
@media (min-width: 769px) {
    .site-header {
        animation: slideDown 0.5s ease both;
    }
}

/* --- Scroll reveal base --- */
.anim {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.anim.anim-left {
    transform: translateX(-40px);
}

.anim.anim-right {
    transform: translateX(40px);
}

.anim.anim-scale {
    transform: scale(0.9);
}

.anim.visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* --- Staggered children --- */
.anim-stagger > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.anim-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.anim-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.anim-stagger.visible > *:nth-child(3) { transition-delay: 0.2s; }
.anim-stagger.visible > *:nth-child(4) { transition-delay: 0.3s; }
.anim-stagger.visible > *:nth-child(5) { transition-delay: 0.4s; }
.anim-stagger.visible > *:nth-child(6) { transition-delay: 0.5s; }
.anim-stagger.visible > *:nth-child(7) { transition-delay: 0.6s; }

.anim-stagger.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* --- Card hover enhancements --- */
.card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(26,107,138,0.15);
}

.card:hover .card-icon {
    animation: float 2s ease-in-out infinite;
}

.card:hover .card-link {
    gap: 12px;
}

/* --- Feature icon hover --- */
.feature-icon {
    transition: all 0.4s ease;
}

.feature:hover .feature-icon {
    transform: scale(1.1) rotate(-5deg);
}

/* --- CTA section pulse --- */
.cta-section .btn,
.cta-phone {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cta-phone:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* --- City tag hover --- */
.city-tag {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.city-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26,107,138,0.12);
}

/* --- SEO links hover --- */
.seo-links a {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.seo-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26,107,138,0.2);
}

/* --- Button animations --- */
.btn {
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

/* --- Service highlight animated border --- */
.service-highlight {
    transition: all 0.4s ease;
}

.service-highlight:hover {
    border-left-width: 6px;
    background: #dceef5;
    transform: translateX(4px);
}

/* --- Map container --- */
.map-container {
    transition: all 0.4s ease;
}

.map-container:hover {
    box-shadow: 0 15px 50px rgba(26,107,138,0.18);
}

/* --- Breadcrumb --- */
.breadcrumb {
    animation: slideDown 0.4s 0.2s ease both;
}

/* --- Footer columns stagger --- */
.footer-col {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.footer-grid.visible .footer-col:nth-child(1) { transition-delay: 0s; }
.footer-grid.visible .footer-col:nth-child(2) { transition-delay: 0.15s; }
.footer-grid.visible .footer-col:nth-child(3) { transition-delay: 0.3s; }
.footer-grid.visible .footer-col:nth-child(4) { transition-delay: 0.45s; }

.footer-grid.visible .footer-col {
    opacity: 1;
    transform: translateY(0);
}

/* --- Logo hover --- */
.logo {
    transition: all 0.3s ease;
}
.logo:hover {
    transform: scale(1.05);
}

/* --- Nav link underline animation --- */
.main-nav a {
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 1px;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 60%;
}

.main-nav .nav-cta::after { display: none; }

/* --- Disable hover transforms on touch/mobile --- */
@media (max-width: 768px) {
    .card:hover { transform: none; }
    .city-tag:hover { transform: none; }
    .seo-links a:hover { transform: none; }
    .cta-phone:hover { transform: none; }
    .service-highlight:hover { transform: none; }
    .logo:hover { transform: none; }
    .feature:hover .feature-icon { transform: none; }
}

/* --- Reduce motion for accessibility --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .anim { opacity: 1; transform: none; }
    .anim-stagger > * { opacity: 1; transform: none; }
    .footer-col { opacity: 1; transform: none; }
}
