/**
 * ADIGO Theme - Global Responsive Fixes
 * Version: 3.2.0
 * Résout les problèmes de responsive sur toutes les pages
 */

/* =============================================
   BASE RESPONSIVE RESETS
   ============================================= */

*, *::before, *::after {
    box-sizing: border-box;
}

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

/* Container responsive */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
}

/* =============================================
   GRID RESPONSIVE FIXES
   ============================================= */

/* Fix pour les grilles 2 colonnes */
.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

@media (max-width: 768px) {
    .grid-2-cols {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Fix pour les grilles auto-fit avec minmax problématique */
@media (max-width: 480px) {
    [style*="grid-template-columns: repeat(auto-fit, minmax(400px"],
    [style*="grid-template-columns: repeat(auto-fit, minmax(340px"],
    [style*="grid-template-columns: repeat(auto-fit, minmax(320px"],
    [style*="grid-template-columns: repeat(auto-fit, minmax(300px"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    [style*="grid-template-columns: repeat(auto-fit, minmax(400px"] {
        grid-template-columns: 1fr !important;
    }
}

/* =============================================
   HERO SECTIONS RESPONSIVE
   ============================================= */

.hero-section {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}

.hero-content {
    text-align: center;
    padding: 0 20px;
}

.hero-title {
    font-size: clamp(28px, 6vw, 56px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: clamp(14px, 2.5vw, 20px);
    line-height: 1.6;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .hero-section {
        min-height: 350px !important;
        padding: 50px 0;
    }
    
    .hero-content {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        min-height: 300px !important;
        padding: 40px 0;
    }
}

/* =============================================
   SECTION PADDING RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    section[style*="padding: 100px 0"] {
        padding: 60px 0 !important;
    }
    
    section[style*="padding: 80px 0"] {
        padding: 50px 0 !important;
    }
}

@media (max-width: 480px) {
    section[style*="padding: 100px 0"] {
        padding: 40px 0 !important;
    }
    
    section[style*="padding: 80px 0"] {
        padding: 40px 0 !important;
    }
}

/* =============================================
   SECTION HEADERS RESPONSIVE
   ============================================= */

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

.section-subtitle {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #C3110D;
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(24px, 4vw, 42px);
    font-weight: 800;
    color: #0a0a0a;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .section-header {
        margin-bottom: 40px !important;
    }
}

/* =============================================
   CARDS RESPONSIVE
   ============================================= */

.card,
[class*="-card"] {
    border-radius: 16px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .card[style*="padding: 40px"],
    [class*="-card"][style*="padding: 40px"] {
        padding: 24px !important;
    }
    
    .card[style*="padding: 50px"],
    [class*="-card"][style*="padding: 50px"] {
        padding: 30px !important;
    }
}

@media (max-width: 480px) {
    .card[style*="padding: 40px"],
    [class*="-card"][style*="padding: 40px"],
    .card[style*="padding: 32px"],
    [class*="-card"][style*="padding: 32px"] {
        padding: 20px !important;
    }
}

/* =============================================
   BUTTONS RESPONSIVE
   ============================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #C3110D, #ff4444);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid #C3110D;
    color: #C3110D;
}

.btn-white {
    background: white;
    color: #C3110D;
}

@media (max-width: 480px) {
    .btn {
        padding: 12px 24px;
        font-size: 14px;
        width: 100%;
    }
    
    /* Boutons côte à côte en colonne sur mobile */
    div[style*="display: flex"][style*="gap"] {
        flex-direction: column !important;
    }
}

/* =============================================
   FORMS RESPONSIVE
   ============================================= */

input, textarea, select {
    font-family: inherit;
    font-size: 16px; /* Évite le zoom sur iOS */
}

@media (max-width: 768px) {
    input[style*="padding: 14px"],
    textarea[style*="padding: 14px"],
    select[style*="padding: 14px"] {
        padding: 12px 14px !important;
        font-size: 16px !important;
    }
}

/* =============================================
   TYPOGRAPHY RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    h1[style*="font-size: 48px"],
    h1[style*="font-size: 56px"],
    h2[style*="font-size: 48px"],
    h2[style*="font-size: 42px"] {
        font-size: 28px !important;
    }
    
    h2[style*="font-size: 36px"],
    h3[style*="font-size: 36px"] {
        font-size: 24px !important;
    }
    
    h3[style*="font-size: 28px"],
    h3[style*="font-size: 24px"] {
        font-size: 20px !important;
    }
    
    p[style*="font-size: 20px"],
    p[style*="font-size: 18px"] {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    h1[style*="font-size: 48px"],
    h1[style*="font-size: 56px"],
    h2[style*="font-size: 48px"],
    h2[style*="font-size: 42px"] {
        font-size: 24px !important;
    }
    
    h2[style*="font-size: 36px"],
    h3[style*="font-size: 36px"] {
        font-size: 20px !important;
    }
}

/* =============================================
   GAP RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    [style*="gap: 80px"] {
        gap: 40px !important;
    }
    
    [style*="gap: 60px"] {
        gap: 30px !important;
    }
    
    [style*="gap: 40px"] {
        gap: 24px !important;
    }
}

@media (max-width: 480px) {
    [style*="gap: 80px"] {
        gap: 30px !important;
    }
    
    [style*="gap: 60px"] {
        gap: 24px !important;
    }
    
    [style*="gap: 40px"] {
        gap: 20px !important;
    }
    
    [style*="gap: 30px"] {
        gap: 16px !important;
    }
}

/* =============================================
   SPECIFIC PAGE FIXES
   ============================================= */

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

@media (max-width: 600px) {
    .contact-cards {
        grid-template-columns: 1fr;
    }
}

/* Partner cards */
.partner-card {
    position: relative;
}

/* Intelligence cards */
.intel-card {
    height: 100%;
}

/* Product cards */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card > div:last-child {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card > div:last-child > a:last-child {
    margin-top: auto;
}

/* =============================================
   CODE BLOCKS RESPONSIVE
   ============================================= */

pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    pre {
        font-size: 12px !important;
    }
    
    pre code {
        font-size: 12px !important;
    }
}

/* =============================================
   ICONS & BADGES RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    [style*="width: 80px"][style*="height: 80px"] {
        width: 60px !important;
        height: 60px !important;
    }
    
    [style*="width: 70px"][style*="height: 70px"] {
        width: 56px !important;
        height: 56px !important;
    }
    
    [style*="font-size: 64px"],
    [style*="font-size: 70px"] {
        font-size: 48px !important;
    }
    
    [style*="font-size: 48px"] {
        font-size: 36px !important;
    }
}

/* =============================================
   FLEX LAYOUTS RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    div[style*="display: flex"][style*="justify-content: space-between"] {
        flex-direction: column;
        gap: 20px;
    }
    
    /* Flex wrap for mobile */
    div[style*="display: flex"]:not([style*="flex-direction"]):not([style*="align-items: center"]) {
        flex-wrap: wrap;
    }
}

/* Boutons CTA côte à côte */
@media (max-width: 480px) {
    div[style*="display: flex"][style*="gap"][style*="justify-content: center"] {
        flex-direction: column !important;
        align-items: center !important;
    }
    
    div[style*="display: flex"][style*="gap"][style*="justify-content: center"] > a,
    div[style*="display: flex"][style*="gap"][style*="justify-content: center"] > button {
        width: 100% !important;
        max-width: 300px !important;
    }
}

/* =============================================
   MARGIN/PADDING OVERRIDES
   ============================================= */

@media (max-width: 768px) {
    [style*="margin-bottom: 60px"] {
        margin-bottom: 40px !important;
    }
    
    [style*="margin-bottom: 80px"] {
        margin-bottom: 50px !important;
    }
    
    [style*="margin-top: 80px"] {
        margin-top: 50px !important;
    }
}

@media (max-width: 480px) {
    [style*="margin-bottom: 60px"],
    [style*="margin-bottom: 50px"] {
        margin-bottom: 30px !important;
    }
    
    [style*="margin-bottom: 40px"] {
        margin-bottom: 24px !important;
    }
}

/* =============================================
   HIDE/SHOW ON MOBILE
   ============================================= */

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .show-mobile-only {
        display: none !important;
    }
}

/* =============================================
   OVERFLOW PREVENTION
   ============================================= */

body {
    overflow-x: hidden;
}

section {
    overflow-x: hidden;
}

/* Sections avec overflow caché pour éléments décoratifs */
section[style*="overflow: hidden"],
section[style*="position: relative"] {
    overflow: hidden;
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .container,
    section > div {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Masquer les éléments décoratifs qui débordent */
    [style*="position: absolute"][style*="filter: blur"] {
        display: none;
    }
}

/* =============================================
   ANIMATION ADJUSTMENTS FOR MOBILE
   ============================================= */

@media (max-width: 768px) {
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   PARALLAX: GPU-accelerated background layers
   Works on all devices including iOS Safari
   ======================================== */

.parallax-bg {
    position: absolute;
    inset: -20%; /* extra height for translate room */
    width: 140%;
    left: -20%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    pointer-events: none;
}

.parallax-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Ensure hero content sits above both layers */
.hero-section > .container,
.hero-section > div:not(.parallax-bg):not(.parallax-overlay),
.contact-hero > .container,
.contact-hero > div:not(.parallax-bg):not(.parallax-overlay) {
    position: relative;
    z-index: 2;
}

/* Reduce parallax intensity on mobile for performance */
@media (max-width: 768px) {
    .parallax-bg {
        inset: -10%;
        width: 120%;
        left: -10%;
    }
}

/* Disable parallax entirely on very low-power devices */
@media (prefers-reduced-motion: reduce) {
    .parallax-bg {
        transform: none !important;
        inset: 0;
        width: 100%;
        left: 0;
    }
}
