/* ========================================
   RESPONSIVE GLOBAL - Media Queries
   Gestion responsive pour tout le site
   ======================================== */

/* ========================================
   TABLE DES MATIÈRES
   ========================================
   1. PC PORTABLE (1024px - 1440px)
   2. TABLETTE (768px - 1023px)
   3. MOBILE (<768px)
   4. TRÈS PETITS ÉCRANS (<480px)
   ======================================== */

/* ========================================
   1. PC PORTABLE (1024px - 1440px)
   Optimisation pour écrans de portables standards
   ======================================== */

@media (max-width: 1440px) {
    :root {
        --marge-gauche-droite: 30px;
        --espace-sous-section: 15px;
    }

    /* Bandeau principal */
    .bandeau {
        padding: 0px 10px 0px 10px;
    }

    .ligne-top {
        gap: 15px;
    }

    .coordonnees {
        flex: 0 0 180px;
        font-size: 11px;
    }

    .titre-site {
        font-size: 20px;
    }

    .titre-site .titre-icon-1 img,
    .titre-site .titre-icon-2 img {
        height: 52px;
    }

    /* Avatar réduit */
    .avatar-bloc {
        flex: 0 0 180px;
        height: 160px;
    }

    .avatar-container {
        width: 85px;
        height: 85px;
    }

    .Avatar .pseudo {
        font-size: 14px;
        margin: 12px 0;
    }

    .Avatar .niveau {
        font-size: 13px;
    }

    /* Menu navigation */
    .menu-nav ul {
        gap: 10px;
    }

    .menu-nav a {
        padding: 6px 10px;
        font-size: 16px;
    }

    .Reseau_sociaux {
        gap: 12px;
        margin-right: 30px;
    }

    .Reseau_sociaux .Reseau-icon img {
        height: 42px;
        width: 42px;
    }

    /* Sections */
    section {
        margin: 0 var(--marge-gauche-droite);
        padding: 15px;
        font-size: 16px;
    }

    section .titre_P {
        font-size: 1.8em;
    }

    /* Grilles de produits - Boutique */
    .produits-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        padding: 0 10px;
        margin: 30px 0;
    }

    .produit-image {
        height: 220px;
    }

    .produit-content h3 {
        font-size: 1.2em;
    }

    .produit-description {
        font-size: 0.95em;
    }

    /* Carousel infos défis */
    .defis_infos_carousel {
        min-width: 450px;
        min-height: 280px;
    }

    .carousel_content {
        height: 280px;
    }

    .carousel_slide {
        padding: 15px;
    }

    .carousel_slide h4 {
        font-size: 1.1em;
    }

    .carousel_slide p {
        font-size: 0.95em;
        margin: 6px 0;
    }
}

@media (max-width: 1280px) {
    :root {
        --marge-gauche-droite: 25px;
    }

    .titre-site {
        font-size: 18px;
    }

    .titre-site .titre-icon-1 img,
    .titre-site .titre-icon-2 img {
        height: 48px;
    }

    .menu-nav a {
        font-size: 15px;
        padding: 5px 8px;
    }

    .Reseau_sociaux .Reseau-icon img {
        height: 40px;
        width: 40px;
    }
}

/* ========================================
   2. TABLETTE (768px - 1023px)
   Interface adaptée pour tablettes
   ======================================== */

@media (max-width: 1023px) {
    :root {
        --marge-gauche-droite: 20px;
        --espace-sous-section: 15px;
    }

    body {
        font-size: 16px;
    }

    /* Bandeau - réorganisation */
    .bandeau {
        padding: 10px;
    }

    .ligne-top {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .coordonnees {
        flex: none;
        text-align: center;
        order: 2;
    }

    .titre-site {
        order: 1;
        font-size: 20px;
    }

    .avatar-bloc {
        flex: none;
        order: 3;
        height: 140px;
    }

    .avatar-container {
        width: 75px;
        height: 75px;
    }

    /* Menu navigation - wrap */
    .ligne-bottom {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .menu-nav {
        order: 1;
    }

    .menu-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .Reseau_sociaux {
        order: 2;
        margin-right: 0;
        justify-content: center;
    }

    .Espace_prive {
        order: 3;
        align-items: center;
    }

    /* Sections */
    section {
        margin: 0 var(--marge-gauche-droite);
        padding: 15px;
    }

    section .titre_P {
        font-size: 1.6em;
    }

    .img-pacman {
        height: 52px;
    }

    /* Grilles de produits */
    .produits-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }

    .produit-image {
        height: 200px;
    }

    /* Carousel infos */
    .defis_infos_carousel {
        min-width: 350px;
        min-height: 260px;
    }

    .carousel_content {
        height: 260px;
    }

    /* Liste des défis - cartes */
    .carte_defis {
        padding: 15px;
    }

    .defis_contenu {
        flex-direction: column;
    }

    .defis_zone_image {
        width: 100%;
        margin-bottom: 20px;
    }
}

/* ========================================
   3. MOBILE (<768px)
   Interface tactile optimisée
   ======================================== */

@media (max-width: 767px) {
    :root {
        --marge-gauche-droite: 15px;
        --espace-sous-section: 12px;
        --adouss-border: 20px;
    }

    body {
        font-size: 14px;
    }

    /* Bandeau simplifié */
    .bandeau {
        padding: 8px;
        gap: 8px;
    }

    .ligne-top {
        flex-direction: column;
        gap: 10px;
    }

    .coordonnees {
        font-size: 10px;
        flex: none;
    }

    .titre-site {
        font-size: 18px;
    }

    .titre-site .titre-icon-1 img,
    .titre-site .titre-icon-2 img {
        height: 42px;
    }

    .avatar-bloc {
        height: 120px;
    }

    .avatar-container {
        width: 65px;
        height: 65px;
    }

    .Avatar .pseudo {
        font-size: 13px;
        margin: 8px 0;
    }

    .Avatar .niveau {
        font-size: 12px;
        margin: 8px 0 0 0;
    }

    /* Menu navigation mobile */
    .ligne-bottom {
        font-size: 14px;
        padding-top: 8px;
    }

    .menu-nav ul {
        gap: 6px;
    }

    .menu-nav a {
        padding: 5px 8px;
        font-size: 13px;
    }

    .nav-lock {
        font-size: 14px;
        margin-right: 4px;
    }

    .Reseau_sociaux {
        gap: 10px;
    }

    .Reseau_sociaux .Reseau-icon img {
        height: 35px;
        width: 35px;
    }

    .Espace_prive {
        font-size: 13px;
    }

    /* Sections */
    section {
        margin: 0 var(--marge-gauche-droite);
        padding: 12px;
        font-size: 14px;
    }

    section .titre_P {
        font-size: 1.4em;
    }

    .img-pacman {
        height: 42px;
    }

    .section-description,
    .subtitle {
        font-size: 0.95em;
    }

    /* Grilles de produits - une colonne */
    .produits-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0;
    }

    .produit-card {
        max-width: 100%;
    }

    .produit-image {
        height: 180px;
    }

    .produit-content {
        padding: 15px;
    }

    .produit-content h3 {
        font-size: 1.1em;
    }

    .produit-description {
        font-size: 0.9em;
    }

    .produit-features {
        flex-direction: column;
        gap: 5px;
        font-size: 0.85em;
    }

    /* Carousel infos - adapté mobile */
    .defis_infos_carousel {
        min-width: 100%;
        min-height: 240px;
        padding: 8px;
    }

    .carousel_content {
        height: 240px;
    }

    .carousel_slide {
        padding: 10px;
    }

    .carousel_slide h4 {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .carousel_slide p {
        font-size: 0.85em;
        margin: 5px 0;
    }

    .carousel_btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .indicator {
        width: 10px;
        height: 10px;
    }

    /* Cartes défis */
    .carte_defis {
        padding: 12px;
    }

    .defis_description h3 {
        font-size: 1.2em;
    }

    .defis_description p {
        font-size: 0.9em;
    }

    .defis_zone_image {
        width: 100%;
        height: auto;
    }

    /* Boutons */
    button,
    .btn,
    .btn-primary,
    .btn-secondary {
        min-height: 44px;
        min-width: 44px;
        padding: 10px 16px;
        font-size: 14px;
    }

    /* Formulaires */
    input,
    textarea,
    select {
        min-height: 44px;
        font-size: 14px;
        padding: 10px;
    }

    /* Bandeau promo */
    .bandeau-promo {
        font-size: 0.9em;
        padding: 10px 15px;
    }

    /* Badges */
    .badge-possede,
    .badge-progression,
    .badge-defi-termine {
        font-size: 0.75em;
        padding: 4px 8px;
    }
}

/* ========================================
   4. TRÈS PETITS ÉCRANS (<480px)
   Optimisation pour smartphones compacts
   ======================================== */

@media (max-width: 480px) {
    :root {
        --marge-gauche-droite: 10px;
        --espace-sous-section: 10px;
        --adouss-border: 15px;
    }

    .titre-site {
        font-size: 16px;
    }

    .titre-site .titre-icon-1 img,
    .titre-site .titre-icon-2 img {
        height: 36px;
    }

    .menu-nav a {
        padding: 4px 6px;
        font-size: 12px;
    }

    section .titre_P {
        font-size: 1.2em;
    }

    .carousel_slide h4 {
        font-size: 0.9em;
    }

    .carousel_slide p {
        font-size: 0.8em;
    }

    .defis_infos_carousel {
        min-height: 220px;
    }

    .carousel_content {
        height: 220px;
    }
}

/* ========================================
   UTILITAIRES GÉNÉRAUX
   ======================================== */

/* Éviter le zoom sur les inputs iOS */
@media (max-width: 767px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Scroll personnalisé responsive */
@media (max-width: 767px) {
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }

    ::-webkit-scrollbar-thumb {
        background: rgba(255, 201, 71, 0.4);
        border-radius: 3px;
    }

    ::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
    }
}

/* Images responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Tables responsive */
@media (max-width: 767px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Masquer éléments non essentiels sur petits écrans */
@media (max-width: 480px) {
    .coordonnees {
        display: none;
    }
}
