﻿/*
 Theme Name:   GeneratePress Child
 Description:  Thème enfant pour Valdeuck
 Template:     generatepress
 Author:       Bernard Salvan
 Version:      1.0.0
*/
/**********************************************************
 GLOBAL – SÉCURITÉ ANTI CLS & TYPO
**********************************************************/
html, body { overflow-x: hidden; }
#page.site { width: 100%; max-width: 100%; margin: 0; }
body, button, input, select, textarea {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}

/**********************************************************
 HOME – STABILITÉ DÉFINITIVE
**********************************************************/
.home .site-content, .home .grid-container { width: 100%; max-width: 100vw; overflow-x: hidden; padding: 0; }
.fbp-media-wrapper { aspect-ratio: 3 / 4; width: 100%; }

/**********************************************************
 PANIER & QUANTITÉ – STYLE GLOBAL (PC & MOBILE)
**********************************************************/
/* Champ de quantité marron & doré */
input[type=number] {
    background-color: #2D1A10 !important;
    color: #FFD700 !important;
    border: 1px solid #FFD700 !important;
    text-align: center;
}
/* Flèches dorées */
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button {
    filter: invert(84%) sepia(35%) saturate(1469%) hue-rotate(352deg) brightness(108%) contrast(106%) !important;
    opacity: 1 !important;
}

/* Couleurs Panier */
.woocommerce-cart .amount, .woocommerce-cart table.cart td.product-name a, .cart_totals h2, .cart_totals th, .cart_totals td {
    color: #f2d77d !important;
    font-weight: 700;
}
.cart_totals .order-total .amount { color: #ffd700 !important; font-size: 22px !important; font-weight: 900; }

/**********************************************************
 PANIER – REGLAGES DESKTOP (PC UNIQUEMENT)
**********************************************************/
@media screen and (min-width: 769px) {
    .woocommerce-cart table.cart {
        border: 2px solid #f2d77d !important;
        border-collapse: separate !important;
        border-radius: 10px;
        overflow: hidden;
    }
    .woocommerce-cart table.cart td, .woocommerce-cart table.cart th { border-bottom: 1px solid #f2d77d !important; }
    .woocommerce-cart-form__contents .product-thumbnail img { width: 120px !important; }
    .woocommerce-cart .checkout-button { background-color: #f2d77d !important; color: #000 !important; font-weight: 800; padding: 15px 30px; border-radius: 10px; float: right; }
}

/**********************************************************
 PANIER – REGLAGES MOBILE (L'URGENCE : IMAGE & BARRES)
**********************************************************/
/**********************************************************
 PANIER MOBILE – ENCADREMENT TOTAL (VALDEUCK FIX)
**********************************************************/
@media screen and (max-width: 768px) {
    
    /* 1. On crée le grand cadre arrondi autour de CHAQUE produit */
    .woocommerce-cart-form__contents tr.cart_item {
        display: flex !important;
        flex-direction: column !important;
        padding: 20px 15px !important;
        margin-bottom: 30px !important;
        /* Bordure dorée qui fait tout le tour */
        border: 2px solid rgba(242, 215, 125, 0.5) !important; 
        border-radius: 25px !important; 
        background: rgba(255, 255, 255, 0.03) !important;
        overflow: hidden !important;
    }

    /* 2. On nettoie les cellules internes (plus de bordures qui dépassent) */
    .woocommerce-cart-form__contents td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border: none !important; 
        padding: 12px 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Ajout d'une ligne fine SEULEMENT entre les infos pour séparer proprement */
    .woocommerce-cart-form__contents td:not(:last-child):not(.product-thumbnail):not(.product-remove) {
        border-bottom: 1px solid rgba(242, 215, 125, 0.15) !important;
    }

    /* 3. Ajustement de l'image (petite et centrée) */
    .woocommerce-cart-form table.cart img, 
    .woocommerce-cart-form .product-thumbnail img {
        width: 100px !important;
        height: auto !important;
        margin: 0 auto !important;
        display: block !important;
        border-radius: 12px !important;
    }

    /* 4. Couleurs et Libellés */
    .shop_table_responsive tr td::before {
        color: #f2d77d !important;
        font-weight: bold !important;
        content: attr(data-title) ": ";
    }

    /* On cache les textes parasites sur la croix et l'image */
    .shop_table_responsive tr td.product-thumbnail::before,
    .shop_table_responsive tr td.product-remove::before {
        display: none !important;
    }

    /* Centrage de la croix de suppression */
    .woocommerce-cart-form__contents td.product-remove {
        justify-content: center !important;
        padding-top: 0 !important;
    }

    /* 5. FIX FINAL : On supprime les lignes vides de WooCommerce qui cassent le design */
    .woocommerce-cart-form__contents tr:not(.cart_item) {
        display: none !important;
    }
}

/**********************************************************
 BOUTONS PANIER & PRODUITS SIMILAIRES (LOOK VALDEUCK)
**********************************************************/

/* 1. Ciblage global des boutons de panier (Ajouter au panier et Checkout) */
.woocommerce .cart .button, 
.woocommerce .upcells .button, 
.woocommerce .cross-sells .button, 
.woocommerce #respond input#submit, 
.woocommerce a.button.checkout-button,
.woocommerce .cart-collaterals .checkout-button {
    background-color: #ff6b35 !important;
    color: #ffffff !important;
    border-radius: 999px !important;
    padding: 12px 25px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    border: none !important;
    display: inline-block !important;
    text-align: center !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2) !important;
}

/* 2. Spécifique aux "Produits Similaires" (Cross-sells/Up-sells) sur Mobile */
@media screen and (max-width: 768px) {
    /* On force le bouton à prendre une forme propre sous l'image */
    .woocommerce .cross-sells ul.products li.product a.button,
    .woocommerce .upcells ul.products li.product a.button {
        margin-top: 15px !important;
        font-size: 14px !important;
        width: auto !important;
    }

    /* Bouton "Valider la commande" en bas du panier */
    .woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
        display: block !important;
        width: 100% !important;
        margin-top: 20px !important;
        padding: 18px !important;
        font-size: 1.1em !important;
    }
    
    /* Harmonisation du prix des produits similaires */
    .woocommerce ul.products li.product .price {
        color: #ffd700 !important;
        font-weight: 900 !important;
    }
}

/* 3. Effet au survol pour garder de l'interactivité */
.woocommerce .button:hover, 
.woocommerce a.button.checkout-button:hover {
    background-color: #e85a28 !important; /* Orange un peu plus sombre */
    color: #fff !important;
}

/**********************************************************
 CHECKOUT (PC & MOBILE)
**********************************************************/
body.woocommerce-checkout { background-color: #2b2419; }
.woocommerce-checkout label { color: #f2d77d; font-weight: bold; }
.woocommerce-checkout input.input-text, .woocommerce-checkout textarea, .woocommerce-checkout select {
    background-color: #1f1f1f !important; color: #ffffff !important; border: 1px solid #f2d77d !important;
}

/* Bouton Commander Valdeuck */
.woocommerce-checkout #payment #place_order {
    background-color: #ff6b35 !important; color: #ffffff !important;
    border-radius: 999px !important; padding: 15px 30px !important;
    font-weight: 800 !important; text-transform: uppercase !important; border: none !important;
}

@media (max-width: 767px) {
    #ship-to-different-address span { font-size: 14px !important; font-weight: 400 !important; color: #f2d77d !important; }
}

/* Fix adresse de livraison (CLS) */
.shipping_address { display: none; max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.woocommerce-shipping-fields .shipping_address { display: block; max-height: 1000px; }

/* ==========================================================
   SINGLE PRODUCT – CENTRAGE TOTAL (GP + WooCommerce)
   ========================================================== */

/* 1. RESET STRUCTURE - FORCE LE CENTRAGE SUR LA PAGE ENTIÈRE */
.single-product .site-content,
.single-product .content-area,
.single-product .site-main {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important; /* Centre tout le contenu de la page */
}

/* 2. CONTAINER PRODUIT - SUPPRESSION DES LIMITES LATÉRALES */
.single-product div.product {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* 3. IMAGE PRODUIT – CENTRAGE RÉEL (320PX) */
.single-product .woocommerce-product-gallery {
    float: none !important;
    margin: 0 auto 30px auto !important;
    width: 320px !important; /* Taille bridée */
    display: block !important;
}

.single-product .woocommerce-product-gallery img {
    width: 100% !important;
    height: auto;
    border-radius: 15px;
    border: 2px solid #f2d77d;
}

/* 4. RÉSUMÉ PRODUIT - CENTRAGE DU BLOC TEXTE */
.single-product .summary.entry-summary {
    float: none !important;
    width: 100% !important;
    max-width: 760px !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
}

/* 5. TITRE / PRIX / DESCRIPTION - ALIGNEMENT CENTRAL */
.single-product h1.product_title,
.single-product .price,
.single-product .price .amount,
.single-product .woocommerce-product-details__short-description {
    color: #f2d77d;
    text-align: center !important;
    width: 100% !important;
}

.single-product .woocommerce-product-details__short-description {
    max-width: 600px; /* Plus étroit pour la lisibilité une fois centré */
    margin: 20px auto;
}

/* 6. STOCK / QUANTITÉ / BOUTON PANIER */
.single-product .stock {
    color: #9cc000;
}

.single-product form.cart {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px;
}

.single-product button.single_add_to_cart_button {
    background: #ff6b35 !important;
    color: #ffffff;
    border-radius: 999px;
    padding: 14px 34px;
    border: none;
}

/* 7. ONGLET WC (CENTRE LA DESCRIPTION BASSE) */
.single-product .woocommerce-tabs {
    width: 100% !important;
    max-width: 820px;
    margin: 40px auto !important;
    text-align: center !important;
}

.single-product .woocommerce-tabs .panel {
    text-align: center !important;
    color: #f2d77d;
}

/* 8. PRODUITS SIMILAIRES - FIX TAILLE 120PX ET LIGNE UNIQUE */
.related.products {
    width: 100% !important;
    max-width: 1000px;
    margin: 50px auto !important;
}

.related.products ul.products {
    display: flex !important;
    justify-content: center !important;
    flex-wrap: nowrap !important; /* Force la ligne unique pour éviter le saut de Zappa */
    padding: 0 !important;
}

.related.products ul.products li.product {
    width: 150px !important; /* Largeur de cellule fixe */
    flex: 0 0 150px !important;
    margin: 10px !important;
}

.related.products ul.products li.product img {
    width: 120px !important; /* Taille d'image demandée */
    max-width: 120px !important;
    height: auto !important;
    border: 1px solid #f2d77d;
}

/* 9. BOUTONS PRODUITS SIMILAIRES */
.related.products .button {
    background: #ff6b35 !important;
    color: #ffffff;
    border-radius: 999px;
    font-size: 13px;
    padding: 8px 18px;
}

/* -------------------------------
   13. COULEURS PRODUITS SIMILAIRES (TITRE + ÉLÉMENTS)
-------------------------------- */

/* Le titre principal de la section */
.related.products h2 {
    color: #f2d77d !important;
}

/* Les noms des bières, les prix et les symboles monétaires */
.related.products ul.products li.product .woocommerce-loop-product__title,
.related.products ul.products li.product .price,
.related.products ul.products li.product .price .amount {
    color: #f2d77d !important;
}

/***********************************************************************************************/

/* ==========================================================
   FIX ULTIME MOBILE - VALDEUCK SINGLE PRODUCT
   ========================================================== */
/* ==========================================================
   PAGE PRODUIT – FIX PRODUITS SIMILAIRES DÉCALÉS (MOBILE)
   Compatible WooCommerce + GeneratePress + Elementor
   ========================================================== */

/* 1. SUPPRESSION TOTALE DU ZOOM ET HOVER (PC & Mobile) */
.woocommerce-product-gallery, 
.woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery__image,
.woocommerce-product-gallery__image img {
    pointer-events: none !important;
    transform: none !important;
    transition: none !important;
    filter: none !important;
}

/* 2. SUPPRESSION DU 2EME FIL D'ARIANE (CATEGORIES) */
.product_meta {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ==========================================================
   3. FIX MOBILE – PRODUITS SIMILAIRES BIEN CENTRÉS
   ========================================================== */
@media (max-width: 768px) {

    /* 🔧 NEUTRALISE LES DÉCALAGES PARENTS (CAUSE DU PROBLÈME) */
    .single-product .site-content,
    .single-product .inside-article,
    .single-product .entry-content,
    .single-product .related.products {
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 🧱 GRILLE 2 COLONNES PARFAITEMENT CENTRÉE */
    .related.products ul.products {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
        padding: 10px !important;
        margin: 0 auto !important; /* 🔑 CENTRAGE RÉEL */
        box-sizing: border-box !important;
    }

    /* 🔒 NEUTRALISE LES FLOATS WC */
    .related.products ul.products li.product {
        width: 100% !important;
        float: none !important;
        margin: 0 !important;
        clear: none !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }

    /* 🖼️ IMAGES BIEN DANS LEUR COLONNE */
    .related.products ul.products li.product img {
        max-width: 100% !important;
        height: auto !important;
        margin: 0 auto !important;
        display: block !important;
    }

    /* 🧭 ONGLET DESCRIPTION / AVIS BIEN ALIGNÉS */
    .woocommerce-tabs ul.tabs {
        display: flex !important;
        justify-content: space-around !important;
        padding: 0 !important;
        margin: 0 auto !important;
    }
}
/* ==========================================================
   FIX FIL D’ARIANE MOBILE – CENTRAGE RÉEL
   ========================================================== */
@media (max-width: 768px) {

    .woocommerce-breadcrumb {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;

        width: auto !important;
        max-width: 100% !important;

        padding: 10px 15px !important;
        margin: 0 auto 15px auto !important;

        box-sizing: border-box !important;
        white-space: normal !important;
    }

    .woocommerce-breadcrumb a,
    .woocommerce-breadcrumb span {
        display: inline !important;
        float: none !important;
    }
}

/* ==========================================================
   SUPPRESSION DESCRIPTION COURTE SOUS LE PRIX (PC + MOBILE)
   ========================================================== */
.single-product .woocommerce-product-details__short-description {
    display: none !important;
}

/* ==========================================================
   FIX DÉCALAGE PRODUITS SIMILAIRES – MOBILE UNIQUEMENT
   ========================================================== */
/* 1. SUPPRESSION DU 2ÈME FIL D'ARIANE & HOVER (PC/Mobile) */
.product_meta, .woocommerce-product-details__short-description {
    display: none !important;
}

.woocommerce-product-gallery__image img {
    pointer-events: none !important;
    transform: none !important;
}

/* 2. RÉPARATION PRODUITS SIMILAIRES MOBILE */
@media (max-width: 768px) {

    /* On force le titre à être SEUL sur sa ligne (évite que le produit 1 monte à côté) */
    .single-product .related.products h2 {
        display: block !important;
        width: 100% !important;
        float: none !important;
        clear: both !important;
        text-align: center !important;
        margin: 20px 0 !important;
    }

    /* Reset du conteneur de liste */
    .single-product .related.products ul.products {
        display: flex !important;
        flex-wrap: wrap !important; /* Autorise le passage à la ligne */
        justify-content: flex-start !important; /* Aligne STRICTEMENT à gauche */
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* On neutralise TOUS les produits (y compris le premier .first) */
    .single-product .related.products ul.products li.product {
        /* On force 50% de largeur moins un peu d'espace */
        width: calc(50% - 10px) !important; 
        margin: 5px !important;
        
        /* On supprime les décalages GeneratePress */
        float: none !important;
        clear: none !important; 
        left: 0 !important;
        position: relative !important;
        
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Suppression spécifique du décalage sur le premier produit */
    .single-product .related.products ul.products li.product.first {
        margin-left: 5px !important; /* On remet la même marge que les autres */
        clear: none !important;
    }

    /* Masquer les pseudo-éléments qui créent des trous blancs */
    .single-product .related.products ul.products::before,
    .single-product .related.products ul.products::after {
        content: none !important;
        display: none !important;
    }
}

/**************************** Changement pour le PC & Mobile *******************/
    /* 1. FIL D'ARIANE DU HAUT - JAUNE VALDEUCK */
    /* Cible le fil d'ariane principal pour le mettre en jaune */
    .woocommerce-breadcrumb, 
    .woocommerce-breadcrumb a {
        color: #f2d77d !important; /* Jaune Valdeuck */
        text-align: center !important; 
/*        display: block !important;
        margin-bottom: 15px !important; */
        font-size: 14px !important;
    }

    /* 2. HARMONISATION DE LA DESCRIPTION EN PARAGRAPHE */
    /* On force un affichage de texte standard au lieu de lignes décalées */
    .woocommerce-Tabs-panel--description p,
    .woocommerce-Tabs-panel--description {
        text-align: justify !important; /* Aligné des deux côtés pour faire bloc */
        line-height: 1.6 !important;
        padding: 0 15px !important;
        font-size: 15px !important;
        white-space: normal !important;
    }
    
/* ==========================================================
   FOOTER VALDEUCK : FOND ANTHRACITE & CENTRAGE TOTAL
   ========================================================== */

/* 1. FOND NOIR SUR TOUTE LA LARGEUR */
.site-footer, 
#footer-widgets, 
.footer-widgets-container {
    background-color: #000000 !important;
    background: #000000 !important;
    color: #f2c94c !important;
}

/* 2. CENTRAGE DU CONTENU ET SUPPRESSION DES LIMITES */
.site-footer .inside-footer-widgets {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    max-width: 100% !important;
    padding: 40px 20px !important;
}

/* 3. LOGO CENTRÉ */
.footer-logo {
    display: block !important;
    margin: 0 auto 15px auto !important;
    max-width: 105px !important;
}

/* 4. TEXTES ET LIENS JAUNES */
.site-footer p, 
.site-footer a, 
.custom-footer-container p {
    color: #f2c94c !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    text-decoration: none !important;
}

/* 5. ALIGNEMENT DES LIENS DU BAS */
.footer-links {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 10px !important;
    margin-top: 15px !important;
}

/* 6. CACHER LE COPYRIGHT PAR DÉFAUT DE GP */
.site-info {
    display: none !important;
}

/* ==========================================================
   FOOTER GLOBAL : COMPRESSION SUR TOUTES LES PAGES
   ========================================================== */

/* 1. SUPPRIMER TOUS LES ESPACEMENTS PAR DÉFAUT DU THÈME */
.site-footer,
.footer-widgets,
.inside-footer-widgets,
.footer-widgets-container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* 2. RÉGLER L'ESPACE RÉEL (On contrôle manuellement ici) */
.site-footer .inside-footer-widgets {
    padding: 15px 20px !important; /* Définit un petit espace propre de 15px haut/bas */
}

/* 3. SUPPRIMER LA MARGE DU WIDGET LUI-MÊME */
.footer-widgets .widget {
    margin-bottom: 0 !important;
}

/* 4. RESSERRER LE LOGO ET LES TEXTES */
.footer-logo {
    margin-top: 0 !important;
    margin-bottom: 5px !important;
}

.custom-footer-container p {
    margin: 0 !important;      /* Supprime l'espace entre Copyright et Mentions */
    padding: 0 !important;
    line-height: 1.2 !important;
}

/* 5. RESSERRER LA BARRE DE LIENS (Contact, Facebook) */
.footer-links {
    margin-top: 5px !important;
    padding-top: 0 !important;
}