/* ========================================
   RAMONEUR BAS-RHIN - RESPONSIVE
   ======================================== */

/* ===== DESKTOP LARGE (> 1200px) ===== */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }

    h1 {
        font-size: 3rem;
    }

    .hero-text h1 {
        font-size: 3.5rem;
    }

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

/* ===== TABLET (768px - 1199px) ===== */
@media (max-width: 1199px) {
    :root {
        --spacing-lg: 2.5rem;
        --spacing-xl: 3.5rem;
    }

    .container {
        max-width: 960px;
    }

    /* Header */
    .nav-menu {
        gap: 1.5rem;
    }

    /* Hero */
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

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

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

    /* About */
    .about-content {
        gap: 2rem;
    }

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

    /* Footer */
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 2rem;
    }
}

/* ===== TABLET SMALL (768px - 991px) ===== */
@media (max-width: 991px) {
    /* Typography */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

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

    /* Hero */
    .hero {
        padding: 3rem 0;
    }

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

    .hero-text p {
        font-size: 1.1rem;
    }

    .hero-features {
        gap: 1rem;
    }

    .hero-stat-number {
        font-size: 2rem;
    }

    .hero-cta {
        flex-direction: column;
    }

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

    /* Processus */
    .processus-steps {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Avantages */
    .avantages-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* About */
    .about-content {
        grid-template-columns: 1fr;
    }

    .about-image {
        order: -1;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

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

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

    /* Communes */
    .communes-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ===== MOBILE (< 768px) ===== */
@media (max-width: 767px) {
    :root {
        --spacing-sm: 0.75rem;
        --spacing-md: 1.5rem;
        --spacing-lg: 2rem;
        --spacing-xl: 2.5rem;
    }

    /* Typography */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

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

    /* Container */
    .container {
        padding: 0 1rem;
    }

    /* Header */
    .header-top .container {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .header-urgence {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-urgence-phone {
        font-size: 1rem;
        padding: 0.625rem 1.25rem;
    }

    .nav-container {
        padding: 0.75rem 0;
    }

    .logo {
        font-size: 1.25rem;
    }

    .logo-img {
        width: 40px;
        height: 40px;
    }

    .logo-title {
        font-size: 1.1rem;
    }

    .logo-subtitle {
        font-size: 0.65rem;
    }

    /* Navigation Mobile */
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 130px;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        box-shadow: var(--shadow-lg);
        transform: translateX(-100%);
        transition: var(--transition-base);
        max-height: calc(100vh - 130px);
        overflow-y: auto;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        display: block;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--light);
    }

    .nav-menu li a::after {
        display: none;
    }

    .nav-menu li a:hover,
    .nav-menu li a.active {
        background: var(--light);
    }

    /* Hero */
    .hero {
        padding: 2rem 0;
    }

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

    .hero-text h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .hero-text p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .hero-features {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-feature {
        gap: 0.5rem;
    }

    .hero-feature-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .hero-stat-number {
        font-size: 2rem;
    }

    .hero-stat-label {
        font-size: 0.85rem;
    }

    .hero-cta {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }

    .hero::before,
    .hero::after {
        display: none;
    }

    /* Services */
    .services {
        padding: var(--spacing-lg) 0;
    }

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

    .service-card {
        padding: 1.5rem;
    }

    .service-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .service-title {
        font-size: 1.25rem;
    }

    /* About */
    .about {
        padding: var(--spacing-lg) 0;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .about-highlight {
        gap: 0.75rem;
    }

    .about-highlight-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Processus */
    .processus {
        padding: var(--spacing-lg) 0;
    }

    .processus-steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .processus-step {
        padding: 1.5rem;
    }

    .processus-number {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    /* Avantages */
    .avantages {
        padding: var(--spacing-lg) 0;
    }

    .avantages-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .avantage-card {
        padding: 1.5rem;
    }

    .avantage-card::before {
        font-size: 2rem;
        top: 1rem;
        right: 1rem;
    }

    .avantage-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    /* Formulaires */
    .form-section {
        padding: var(--spacing-lg) 0;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .form-textarea {
        min-height: 120px;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-lg) 0 0;
    }

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

    .footer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .footer-logo {
        justify-content: center;
        margin-bottom: 1rem;
    }

    .footer-description {
        text-align: center;
        margin-bottom: 1rem;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-links {
        text-align: center;
    }

    .footer-contact {
        text-align: left;
    }

    .footer-copyright {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-legal-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-bottom {
        padding: 1rem 0;
    }

    /* Boutons */
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .btn-lg {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* Communes */
    .communes-section {
        padding: var(--spacing-lg) 0;
    }

    .communes-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .communes-list a {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Back to top */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }

    /* Cards */
    .card-header,
    .card-body,
    .card-footer {
        padding: 1rem;
    }
}

/* ===== MOBILE SMALL (< 480px) ===== */
@media (max-width: 479px) {
    :root {
        --spacing-xs: 0.375rem;
        --spacing-sm: 0.625rem;
        --spacing-md: 1.25rem;
        --spacing-lg: 1.75rem;
        --spacing-xl: 2rem;
    }

    /* Typography */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
    }

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

    /* Container */
    .container {
        padding: 0 0.75rem;
    }

    /* Header */
    .header-urgence-phone {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .logo-img {
        width: 35px;
        height: 35px;
    }

    .logo-title {
        font-size: 1rem;
    }

    .logo-subtitle {
        font-size: 0.6rem;
    }

    /* Hero */
    .hero {
        padding: 1.5rem 0;
    }

    .hero-text h1 {
        font-size: 1.5rem;
    }

    .hero-text p {
        font-size: 0.95rem;
    }

    .hero-stats {
        padding: 1rem;
        gap: 1rem;
    }

    .hero-stat-number {
        font-size: 1.75rem;
    }

    /* Services */
    .service-card {
        padding: 1.25rem;
    }

    .service-icon {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .service-title {
        font-size: 1.15rem;
    }

    .service-description {
        font-size: 0.95rem;
    }

    /* Processus */
    .processus-step {
        padding: 1.25rem;
    }

    .processus-number {
        width: 45px;
        height: 45px;
        font-size: 1.35rem;
    }

    /* Avantages */
    .avantage-card {
        padding: 1.25rem;
    }

    .avantage-card::before {
        font-size: 1.75rem;
    }

    /* Formulaires */
    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.625rem;
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }

    /* Footer */
    .footer-social a {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    /* Communes */
    .communes-list {
        grid-template-columns: 1fr;
    }

    .communes-list a {
        padding: 0.625rem;
        font-size: 0.85rem;
    }

    /* Back to top */
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* ===== LANDSCAPE ORIENTATION (Mobile) ===== */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding: 1.5rem 0;
    }

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

    .nav-menu {
        top: 100px;
        max-height: calc(100vh - 100px);
    }

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

/* ===== PRINT STYLES ===== */
@media print {
    .header-top,
    .nav-toggle,
    .hero-cta,
    .form-section,
    .footer-social,
    .back-to-top {
        display: none !important;
    }

    .header {
        position: static;
        box-shadow: none;
    }

    .nav-menu {
        position: static;
        transform: none;
        box-shadow: none;
        flex-direction: row;
        padding: 0;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }

    h1 {
        font-size: 24pt;
    }

    h2 {
        font-size: 20pt;
    }

    h3 {
        font-size: 16pt;
    }

    .service-card,
    .avantage-card,
    .processus-step {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}

/* ===== ACCESSIBILITY - REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --primary: #D35400;
        --primary-dark: #A04000;
        --secondary: #000000;
        --text: #000000;
        --text-light: #333333;
    }

    .btn,
    .service-card,
    .avantage-card {
        border: 2px solid currentColor;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1a1a1a;
        --light: #2d2d2d;
        --text: #e0e0e0;
        --text-light: #b0b0b0;
        --secondary: #e0e0e0;
    }

    body {
        background-color: #1a1a1a;
    }

    .service-card,
    .avantage-card,
    .processus-step,
    .card {
        background: #2d2d2d;
        border-color: #404040;
    }

    .header {
        background: #1a1a1a;
        border-bottom: 1px solid #404040;
    }

    .nav-menu {
        background: #1a1a1a;
    }

    .footer {
        background: #0d0d0d;
    }
}

/* ===== HOVER SUPPORT DETECTION ===== */
@media (hover: none) {
    .service-card:hover,
    .avantage-card:hover,
    .btn:hover {
        transform: none;
    }

    .nav-menu li a::after {
        display: none;
    }
}

/* ===== RESPONSIVE IMAGES ===== */
img {
    max-width: 100%;
    height: auto;
}

/* ===== RESPONSIVE TABLES ===== */
@media (max-width: 767px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ===== RESPONSIVE TYPOGRAPHY (Fluid) ===== */
@media (min-width: 320px) and (max-width: 1200px) {
    html {
        font-size: calc(14px + (16 - 14) * ((100vw - 320px) / (1200 - 320)));
    }
}
