/**
 * WATERRE - Responsive Design
 * Media queries pour tous les appareils
 * Version: 1.0
 */

/* ============================================
   LARGE DESKTOP (1400px+)
   ============================================ */
@media (min-width: 1400px) {
    :root {
        --container-max: 1320px;
    }
    
    .hero-title {
        font-size: var(--text-6xl);
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-2xl);
    }
}

/* ============================================
   DESKTOP (1200px - 1399px)
   ============================================ */
@media (max-width: 1399px) {
    :root {
        --container-max: 1140px;
    }
    
    .stats-grid {
        gap: var(--spacing-lg);
    }
}

/* ============================================
   SMALL DESKTOP / TABLET LANDSCAPE (992px - 1199px)
   ============================================ */
@media (max-width: 1199px) {
    :root {
        --container-max: 960px;
    }
    
    /* Hero */
    .hero-title {
        font-size: var(--text-5xl);
    }
    
    .hero-description {
        font-size: var(--text-base);
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-2xl);
    }
    
    /* Madagascar Map */
    .madagascar-map-container {
        grid-template-columns: 1fr 300px;
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
    
    .footer-col:last-child {
        grid-column: span 2;
    }
}

/* ============================================
   TABLET (768px - 991px)
   ============================================ */
@media (max-width: 991px) {
    :root {
        --container-max: 720px;
        --header-height: 70px;
    }
    
    /* Navigation */
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 400px;
        height: 100vh;
        background: var(--blue-deep);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--spacing-2xl);
        transition: right var(--transition-base);
        z-index: 1000;
        padding: var(--spacing-2xl);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-xl);
    }
    
    .nav-link {
        font-size: var(--text-xl);
    }
    
    .nav-actions {
        margin-top: var(--spacing-xl);
    }
    
    /* Hero */
    .hero-section {
        min-height: 100vh;
        height: auto;
        padding: 120px 0 80px;
    }
    
    .hero-title {
        font-size: var(--text-4xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-xl);
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-buttons .btn {
        justify-content: center;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* Realisations */
    .realisations-swiper .swiper-slide {
        width: 300px;
    }
    
    /* Madagascar Map */
    .madagascar-map-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .region-info-panel {
        order: -1;
    }
    
    /* Calculator */
    .calc-options {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Timeline */
    .timeline {
        padding-left: 2.5rem;
    }
    
    .timeline::before {
        left: 1.25rem;
    }
    
    .timeline-marker {
        left: -2.5rem;
    }
    
    .marker-circle {
        width: 40px;
        height: 40px;
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xl);
    }
    
    .footer-col-main {
        grid-column: span 2;
    }
    
    /* Section Headers */
    .section-title {
        font-size: var(--text-3xl);
    }
    
    .section-subtitle {
        font-size: var(--text-base);
    }
    
    /* Stats */
    .stat-number {
        font-size: var(--text-4xl);
    }
}

/* ============================================
   MOBILE LANDSCAPE (576px - 767px)
   ============================================ */
@media (max-width: 767px) {
    :root {
        --container-max: 540px;
        --container-padding: 1rem;
    }
    
    /* Hero */
    .hero-content {
        margin-top: 0;
    }
    
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-lg);
    }
    
    .hero-description {
        font-size: var(--text-sm);
    }
    
    .hero-badge {
        font-size: var(--text-xs);
        padding: 0.375rem 1rem;
    }
    
    /* Scroll Indicator */
    .scroll-indicator {
        bottom: 2rem;
    }
    
    /* Wave Separator */
    .wave-separator svg {
        height: 40px;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-lg);
    }
    
    .stat-item {
        padding: var(--spacing-md);
    }
    
    .stat-number {
        font-size: var(--text-3xl);
    }
    
    .stat-label {
        font-size: var(--text-base);
    }
    
    .icon-circle {
        width: 64px;
        height: 64px;
    }
    
    .icon-circle img {
        width: 40px;
        height: 40px;
    }
    
    /* Services */
    .card-image-wrapper {
        height: 180px;
    }
    
    .card-content {
        padding: var(--spacing-lg);
    }
    
    .card-title {
        font-size: var(--text-lg);
    }
    
    /* Realisations */
    .realisations-swiper .swiper-slide {
        width: 260px;
    }
    
    /* Calculator */
    .calc-options {
        grid-template-columns: 1fr;
    }
    
    .calculator-form {
        padding: var(--spacing-lg);
    }
    
    .calc-step-title {
        font-size: var(--text-lg);
    }
    
    .result-amount .amount-value {
        font-size: var(--text-4xl);
    }
    
    .form-row-double {
        grid-template-columns: 1fr;
    }
    
    /* Timeline */
    .timeline-card {
        padding: var(--spacing-lg);
    }
    
    .timeline-title {
        font-size: var(--text-lg);
    }
    
    /* Temoignages */
    .temoignage-card {
        padding: var(--spacing-xl);
    }
    
    .temoignage-text {
        font-size: var(--text-base);
    }
    
    /* Contact */
    .contact-form-wrapper {
        padding: var(--spacing-lg);
    }
    
    .contact-info-card {
        padding: var(--spacing-xl);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .footer-col-main {
        grid-column: span 1;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    /* Section spacing */
    .services-section,
    .realisations-section,
    .madagascar-section,
    .pourquoi-section,
    .temoignages-section,
    .contact-section,
    .calculator-section {
        padding: var(--spacing-3xl) 0;
    }
    
    /* Section Headers */
    .section-header {
        margin-bottom: var(--spacing-2xl);
    }
    
    .section-title {
        font-size: var(--text-2xl);
    }
    
    .section-tag {
        font-size: var(--text-xs);
    }
}

/* ============================================
   MOBILE (max-width: 575px)
   ============================================ */
@media (max-width: 575px) {
    :root {
        --container-padding: 0.875rem;
        --header-height: 60px;
    }
    
    /* Header */
    .header {
        padding: 0.5rem 0;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    
    .water-drop-small {
        width: 18px;
        height: 24px;
    }
    
    .logo-name {
        font-size: var(--text-base);
    }
    
    .logo-slogan {
        font-size: 0.625rem;
    }
    
    /* Navigation Mobile */
    .nav-menu {
        max-width: 100%;
    }
    
    .nav-link {
        font-size: var(--text-lg);
    }
    
    /* Hero */
    .hero-section {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: var(--text-2xl);
    }
    
    .hero-subtitle {
        font-size: var(--text-base);
    }
    
    .hero-description {
        font-size: var(--text-xs);
        max-width: 100%;
    }
    
    .hero-buttons .btn {
        padding: 0.75rem 1.5rem;
        font-size: var(--text-sm);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 0 auto;
        gap: var(--spacing-xl);
    }
    
    .stat-number {
        font-size: var(--text-2xl);
    }
    
    /* Services */
    .services-grid {
        max-width: 100%;
    }
    
    .card-image-wrapper {
        height: 160px;
    }
    
    /* Realisations */
    .realisations-swiper .swiper-slide {
        width: 240px;
    }
    
    .realisation-overlay {
        padding: 1.5rem 1rem;
    }
    
    .realisation-title {
        font-size: var(--text-base);
    }
    
    /* Calculator */
    .calculator-form {
        padding: var(--spacing-md);
        border-radius: var(--radius-lg);
    }
    
    .calc-options {
        grid-template-columns: 1fr;
    }
    
    .option-card {
        padding: var(--spacing-md);
    }
    
    .param-label {
        font-size: var(--text-xs);
    }
    
    .param-range {
        height: 6px;
    }
    
    .param-range::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    .range-value {
        font-size: var(--text-xs);
        padding: 0.2rem 0.5rem;
        top: -1.75rem;
    }
    
    .btn-calculate {
        padding: 1rem;
        font-size: var(--text-base);
    }
    
    .result-amount .amount-value {
        font-size: var(--text-3xl);
    }
    
    .result-actions .btn {
        padding: 0.75rem 1rem;
        font-size: var(--text-sm);
    }
    
    /* Timeline */
    .timeline {
        padding-left: 2rem;
    }
    
    .timeline::before {
        left: 1rem;
    }
    
    .timeline-marker {
        left: -2rem;
    }
    
    .marker-circle {
        width: 32px;
        height: 32px;
    }
    
    .marker-number {
        font-size: var(--text-sm);
    }
    
    .timeline-card {
        padding: var(--spacing-md);
    }
    
    .timeline-list {
        flex-direction: column;
    }
    
    /* Temoignages */
    .temoignage-card {
        padding: var(--spacing-lg);
    }
    
    .temoignage-text {
        font-size: var(--text-sm);
    }
    
    .author-image {
        width: 48px;
        height: 48px;
    }
    
    /* Contact */
    .contact-form {
        gap: var(--spacing-md);
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 0.75rem;
        font-size: var(--text-sm);
    }
    
    .btn-submit {
        padding: 0.875rem 1.5rem;
        font-size: var(--text-sm);
        justify-content: center;
        width: 100%;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }
    
    .btn-whatsapp-full {
        font-size: var(--text-sm);
        padding: 0.875rem;
    }
    
    /* Map */
    .contact-info-wrapper .map-wrapper iframe {
        height: 200px;
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-2xl) 0 var(--spacing-xl);
    }
    
    .footer-title {
        font-size: var(--text-base);
    }
    
    .footer-links a,
    .footer-contact li {
        font-size: var(--text-xs);
    }
    
    .social-link {
        width: 36px;
        height: 36px;
    }
    
    /* All sections */
    .section-title {
        font-size: var(--text-xl);
    }
    
    .section-subtitle {
        font-size: var(--text-sm);
    }
    
    /* Video close button */
    .video-close-btn {
        width: 36px;
        height: 36px;
        top: 1rem;
        right: 1rem;
    }
    
    .close-line {
        width: 16px;
    }
}

/* ============================================
   SMALL MOBILE (max-width: 375px)
   ============================================ */
@media (max-width: 375px) {
    .hero-title {
        font-size: var(--text-xl);
    }
    
    .hero-buttons {
        gap: var(--spacing-sm);
    }
    
    .hero-buttons .btn {
        padding: 0.625rem 1.25rem;
        font-size: var(--text-xs);
    }
    
    .realisations-swiper .swiper-slide {
        width: 200px;
    }
    
    .stat-icon {
        margin-bottom: var(--spacing-md);
    }
    
    .icon-circle {
        width: 56px;
        height: 56px;
    }
    
    .stat-number {
        font-size: var(--text-xl);
    }
    
    .card-content {
        padding: var(--spacing-md);
    }
}

/* ============================================
   HIGH DPI SCREENS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image-fallback {
        background-image: url('/assets/images/hero/hero-bg@2x.jpg');
    }
}

/* ============================================
   PREFERS 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;
    }
    
    .loading-screen {
        display: none;
    }
}

/* ============================================
   DARK MODE (Optional future)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Pour une future implémentation du dark mode */
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .header,
    .footer,
    .scroll-indicator,
    .video-close-btn,
    .nav-toggle,
    .particles-container,
    .loading-screen {
        display: none !important;
    }
    
    .hero-section {
        height: auto;
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-content {
        color: #000;
    }
    
    .hero-title,
    .hero-subtitle,
    .hero-description {
        color: #000;
    }
    
    .btn {
        border: 2px solid #000;
        color: #000;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a {
        text-decoration: underline;
    }
}