/* ==========================================================================
   Responsive CSS - abris-box-chevaux.fr
   Approche progressive : le desktop reste identique, seules les media queries
   adaptent le layout pour tablette et mobile.
   ========================================================================== */

/* --- Base globale (tous ecrans) --- */
*, *::before, *::after {
    box-sizing: border-box;
}
img {
    max-width: 100%;
    height: auto;
}

/* Bouton fermeture communique */
.communique-close {
    float: right;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    padding: 0 5px;
    color: #fff;
    opacity: 0.8;
}
.communique-close:hover {
    opacity: 1;
}

/* Hamburger et overlay masques sur desktop */
.menu-toggle-btn {
    display: none;
}
.menu-overlay {
    display: none;
}

/* --- Tablette (max 1024px) --- */
@media screen and (max-width: 1024px) {
    #conteneur {
        width: 100% !important;
        max-width: 1000px;
        border-left: none;
        border-right: none;
    }
}

/* --- Mobile (max 768px) --- */
@media screen and (max-width: 768px) {

    /* Conteneur principal : pleine largeur */
    #conteneur {
        width: 100% !important;
        padding: 0 10px;
        border: none;
    }

    /* Banner : hauteur auto, image adaptee */
    #haut {
        height: auto !important;
        min-height: 80px;
        background-size: contain;
        background-position: center top;
    }

    /* Communique dans le header : pleine largeur sous le banner */
    #communique {
        float: none;
        width: 100%;
        height: auto;
        margin-bottom: 10px;
    }

    /* Menu : liens empiles verticalement */
    #menu {
        padding: 5px 0;
    }
    #menu a {
        display: block;
        padding: 10px 15px;
        border-left: none;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        text-align: left;
    }

    /* Drapeaux langues */
    #drapeaux {
        text-align: center;
    }
    #drapeaux img {
        padding: 3px;
    }

    /* Titre principal */
    .entete {
        font-size: 16px;
        padding: 5px;
    }

    /* Espace pour le bouton hamburger fixe en haut */
    body {
        padding-top: 48px;
    }

    /* Bouton hamburger : barre fixe en haut de l'ecran */
    .menu-toggle-btn {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1001;
        background: #770444;
        color: #fff;
        border: none;
        padding: 12px 15px;
        font-size: 18px;
        font-weight: bold;
        text-align: left;
        cursor: pointer;
    }

    /* Sidebar : panneau lateral masque hors ecran a gauche */
    #outil_1 {
        position: fixed;
        top: 48px;
        left: -85%;
        width: 85%;
        max-width: 320px;
        height: calc(100% - 48px);
        z-index: 1002;
        overflow-y: auto;
        background: #fff;
        border-right: 1px solid #ccc;
        margin-right: 0;
        padding: 10px;
        transition: left 0.3s ease;
    }

    /* Quand le menu est ouvert : sidebar visible */
    body.menu-open #outil_1 {
        left: 0;
    }

    /* Overlay semi-transparent pour fermer le menu */
    body.menu-open .menu-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    #outil_2 {
        float: none;
        width: 100%;
        margin-left: 0;
        margin-bottom: 15px;
    }

    /* Contenu principal : pleine largeur, padding reduit */
    #principal {
        width: 100% !important;
        padding: 10px;
        min-height: auto !important;
        overflow-x: auto;
    }

    /* Fil d'Ariane : masque sur mobile (redondant avec BreadcrumbList JSON-LD) */
    #pistenav {
        display: none;
    }

    /* Tableaux : scroll horizontal si trop large */
    #principal table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Liste produits catalogue : empiler les colonnes */
    .element_liste_simple td {
        display: block;
        width: 100% !important;
        text-align: left;
    }
    .element_liste_simple td img {
        margin: 0 auto 10px;
        display: block;
    }

    /* Photos produit (fiche detail) : pleine largeur */
    #photos_produit {
        width: 100% !important;
    }
    #photos_produit td {
        display: block;
        width: 100% !important;
        text-align: center;
        margin-bottom: 10px;
    }

    /* Prix produit : taille reduite */
    .prix_choix_simple span {
        font-size: 30px !important;
    }
    .prix_choix {
        width: 100%;
    }

    /* Bouton caddie */
    .bouton_caddie {
        width: 100%;
    }

    /* Formulaires */
    #formulaire {
        width: 100%;
    }
    #formulaire select,
    #formulaire input[type="text"],
    #formulaire input[type="email"] {
        max-width: 100%;
    }

    /* Contact encadre */
    #contact_encadre {
        width: 100%;
        text-align: center;
    }

    /* Scroller defilant : adapte a la largeur ecran */
    #scroller {
        font-size: 16px;
    }
    .simply-scroll {
        width: 100% !important;
        height: 30px;
    }
    .simply-scroll .simply-scroll-clip {
        width: 100% !important;
        height: 30px;
    }
    .simply-scroll .simply-scroll-list li {
        height: 30px;
        line-height: 30px;
    }

    /* Slide-in pubs : masquees sur mobile */
    #slidepub,
    #slidepubdroite {
        display: none !important;
    }

    /* Footer */
    #bas {
        text-align: center;
        padding: 15px 10px;
    }
    #bas a {
        display: inline-block;
        margin: 3px;
    }

    /* Liens clefs */
    #liens_clefs {
        text-align: center;
    }
    #liens_clefs h4 {
        display: inline;
    }

    /* Galerie */
    .galerie {
        width: 100% !important;
    }

    /* Caddie / panier */
    .voirmoncaddie {
        width: 100%;
        text-align: center;
    }

    /* Description technique */
    #desc {
        width: 100%;
    }

    /* Specifications techniques */
    .titre_spe {
        width: 100%;
    }
}

/* --- Petit mobile (max 480px) --- */
@media screen and (max-width: 480px) {

    #menu a {
        font-size: 13px;
        padding: 8px 10px;
    }

    .entete {
        font-size: 14px;
    }

    /* Prix encore plus compact */
    .prix_choix_simple span {
        font-size: 24px !important;
    }

    /* Sidebar menu categories */
    #menu_accueil li {
        padding: 5px 0;
    }

    /* Photos produit */
    #photos_produit td img {
        max-width: 90%;
    }
}
