/*
Theme Name: LO2lair Energy
Author: LO2lair Ingénierie
Description: Thème LO2lair compatible WooCommerce et Elementor.
Version: 1.0
Text Domain: lo2lair-energy
*/

/* =========================================
   1. COULEURS ET BASE DU SITE
   ========================================= */

:root {
    --navy: #0c2d59;
    --cyan: #20b7c9;
    --green: #6aa82d;
    --ink: #172638;
    --light: #f3f7fa;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font: 16px Arial, sans-serif;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--navy);
}

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

.topline {
    background: var(--navy);
    color: #ffffff;
    text-align: center;
    padding: 7px;
    font-size: 12px;
}

.header-inner,
.wrap,
.footer-inner {
    max-width: 1200px;
    margin: auto;
    padding: 18px 24px;
}

/* =========================================
   2. EN-TÊTE ET MENU PRINCIPAL
   ========================================= */

.site-header {
    position: relative;
    top: auto;
    z-index: 100;
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    background: #ffffff;
    box-shadow: 0 2px 12px rgba(12, 45, 89, 0.08);
}

.header-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1200px;
    min-height: 112px;
    height: auto;
    margin: 0 auto;
    padding: 12px 24px;
    overflow: visible;
}

.brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.brand img,
.brand .custom-logo {
    display: block;
    width: auto;
    max-width: 245px;
    max-height: 100px;
    object-fit: contain;
}

/* Menu ordinateur */

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
}

.main-nav,
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav ul {
    display: flex;
    align-items: center;
    gap: 22px;
}

.main-nav li {
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-nav li::marker {
    content: "";
}

.main-nav a {
    display: block;
    padding: 12px 4px;
    color: var(--navy);
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
}

.main-nav a:hover,
.main-nav a:focus {
    color: var(--cyan);
}

/* Sous-menus ordinateur */

.main-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10001;
    min-width: 220px;
    padding: 8px 0;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu {
    display: block;
}

.main-nav .sub-menu li {
    width: 100%;
}

.main-nav .sub-menu a {
    padding: 10px 16px;
    white-space: normal;
}

/* Panier */

.header-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--navy);
    font-weight: 700;
    text-decoration: none;
}

.header-cart:hover {
    color: var(--cyan);
}

/* Bouton hamburger */

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 0;
    border-radius: 6px;
    background: var(--navy);
    cursor: pointer;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    margin: 4px auto;
    border-radius: 3px;
    background: #ffffff;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Animation du hamburger */

.mobile-menu-toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================
   3. BANNIÈRE D'ACCUEIL
   ========================================= */

.hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 440px;
    padding: 88px 0;
    color: var(--navy);
    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(255, 255, 255, 0.92) 34%,
            rgba(255, 255, 255, 0.12) 66%
        ),
        linear-gradient(
            120deg,
            #d8f1fb 0%,
            #eaf8fc 35%,
            #0d5278 100%
        );
}

.hero-inner {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 0 24px;
}

.hero h1 {
    max-width: 700px;
    margin: 0 0 18px;
    color: var(--navy);
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.1;
}

.hero p {
    max-width: 620px;
    color: #173b60;
    font-size: 18px;
}

/* =========================================
   4. BOUTONS
   ========================================= */

.button {
    display: inline-block;
    margin: 8px 8px 0 0;
    padding: 14px 24px;
    border-radius: 6px;
    background: var(--cyan);
    color: #062d46;
    font-weight: bold;
    transition: transform 0.2s, background 0.2s;
}

.button:hover {
    transform: translateY(-2px);
    background: #52d0db;
}

.button.secondary {
    border: 1px solid #ffffff;
    background: transparent;
    color: #ffffff;
}

/* =========================================
   5. SECTIONS ET CARTES DE L'ACCUEIL
   ========================================= */

.section-title {
    color: var(--navy);
    font-size: 32px;
    text-align: center;
}

.section-intro {
    max-width: 720px;
    margin: 0 auto 30px;
    color: #64748b;
    text-align: center;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tile {
    padding: 24px;
    border: 1px solid #e2eaf0;
    border-radius: 10px;
    background: var(--light);
}

.tile h3 {
    color: var(--navy);
}

.products {
    background: var(--light);
}

.audience,
.cta {
    background: var(--navy);
    color: #ffffff;
    text-align: center;
}

.audience .section-title,
.cta h2 {
    color: #ffffff;
}

/* =========================================
   6. CONTENU DES PAGES
   ========================================= */

.content-area {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* =========================================
   7. BOUTIQUE WOOCOMMERCE
   ========================================= */

/* Titre de la boutique */

.woocommerce-shop .woocommerce-products-header {
    position: relative;
    z-index: 1;
    display: block;
    float: none;
    clear: both;
    width: 100%;
    height: auto;
    margin: 20px 0 25px;
    padding: 12px;
    background: #f4f8fb;
}

.woocommerce-shop .woocommerce-products-header__title {
    position: static;
    margin: 0;
    padding: 0;
    border-left: 5px solid var(--cyan);
    color: var(--navy);
    background: transparent;
    font-size: 30px;
    font-weight: 700;
}

/* Nombre de résultats */

.woocommerce .woocommerce-result-count {
    color: #526579;
    font-size: 14px;
}

/* Tri des produits */

.woocommerce .woocommerce-ordering select {
    padding: 9px 12px;
    border: 1px solid #d5e0e9;
    border-radius: 6px;
    background: #ffffff;
    color: var(--navy);
}

/* Grille des produits */

.woocommerce ul.products {
    position: relative;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px 22px;
    clear: both;
    margin: 25px 0 !important;
    padding: 0 !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none !important;
}

/* Cartes produits */

.woocommerce ul.products li.product {
    display: flex;
    flex-direction: column;
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 14px;
    overflow: hidden;
    border: 1px solid #e5edf3;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 3px 12px rgba(12, 45, 89, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(12, 45, 89, 0.12);
}

/* Images produits */

.woocommerce ul.products li.product a img {
    display: block;
    width: 100%;
    height: 260px;
    margin: 0 0 16px !important;
    object-fit: contain;
    object-position: center;
    background: #ffffff;
}

/* Noms des produits */

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    min-height: 48px;
    padding: 0 !important;
    color: var(--navy);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
}

/* Prix */

.woocommerce ul.products li.product .price {
    margin: 8px 0 16px !important;
    color: #138b9e !important;
    font-size: 19px;
    font-weight: 700;
}

/* Boutons d'ajout au panier */

.woocommerce ul.products li.product .button {
    display: block;
    width: 100%;
    margin-top: auto !important;
    padding: 12px 10px;
    border: 0;
    border-radius: 6px;
    background: var(--navy);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.woocommerce ul.products li.product .button:hover {
    transform: translateY(-1px);
    background: var(--cyan);
    color: #062d46;
}

/* Masquer la barre latérale WooCommerce */

body.woocommerce-shop #secondary,
body.woocommerce-shop .widget-area,
body.woocommerce-shop aside.sidebar,
body.post-type-archive-product #secondary,
body.post-type-archive-product .widget-area {
    display: none !important;
}

/* Donner toute la largeur au contenu */

body.woocommerce-shop #primary,
body.woocommerce-shop .content-area,
body.post-type-archive-product #primary,
body.post-type-archive-product .content-area {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
}

/* Conteneur de la boutique */

body.woocommerce-shop .woocommerce {
    position: relative;
    clear: both;
    margin-top: 0;
}

/* =========================================
   8. FOOTER
   ========================================= */

.site-footer {
    width: 100%;
    margin-top: 60px;
    background: #071d36;
    color: #dce8f2;
    font-size: 14px;
}

.site-footer,
.site-footer * {
    box-sizing: border-box;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.2fr 1.2fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 55px 24px 45px;
}

.footer-column {
    min-width: 0;
}

/* Titres du footer */

.footer-column h3 {
    margin: 16px 0 12px;
    color: #ffffff;
    font-size: 23px;
    font-weight: 700;
}

.footer-column h4 {
    position: relative;
    margin: 0 0 24px;
    padding-bottom: 12px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
}

.footer-column h4::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 42px;
    height: 3px;
    border-radius: 2px;
    background: var(--cyan);
}

/* Texte et logo */

.footer-column p {
    margin: 0 0 14px;
    color: #c4d3e1;
    font-size: 14px;
    line-height: 1.8;
}

.footer-logo {
    display: inline-block;
}

.footer-logo img,
.footer-logo .custom-logo {
    display: block;
    width: auto;
    max-width: 190px;
    max-height: 75px;
    object-fit: contain;
}

/* Liens du footer */

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links a,
.footer-contact a {
    color: #c4d3e1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-contact a:hover {
    color: var(--cyan);
}

/* Contact */

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-wrap: anywhere;
}

.footer-icon {
    flex-shrink: 0;
    color: var(--cyan);
    font-size: 17px;
}

.footer-contact-button {
    display: inline-block;
    margin-top: 12px;
    padding: 11px 18px;
    border: 1px solid var(--cyan);
    border-radius: 5px;
    color: #ffffff !important;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.footer-contact-button:hover {
    background: var(--cyan);
    color: #071d36 !important;
}

/* Barre inférieure du footer */

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: #051529;
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px;
}

.footer-bottom p {
    margin: 0;
    color: #aebfd0;
    font-size: 12px;
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.footer-legal a {
    color: #aebfd0;
    font-size: 12px;
    text-decoration: none;
}

.footer-legal a:hover {
    color: var(--cyan);
}

/* =========================================
   9. RESPONSIVE : TABLETTES
   ========================================= */

@media (max-width: 1000px) {
    .woocommerce ul.products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    .woocommerce ul.products li.product a img {
        height: 230px;
    }
}

@media (max-width: 900px) {
    .footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 35px;
        padding: 45px 24px;
    }
}

/* =========================================
   10. RESPONSIVE : MENU MOBILE
   ========================================= */

@media (max-width: 800px) {
    .site-header {
        position: relative !important;
        top: auto !important;
    }

    .header-inner {
        flex-wrap: nowrap;
        gap: 10px;
        min-height: unset;
        padding: 10px 16px;
    }

    .brand img,
    .brand .custom-logo {
        max-width: 160px;
        max-height: 65px;
    }

    /* Afficher le bouton hamburger */

    .mobile-menu-toggle {
        display: block;
        margin-left: auto;
        flex-shrink: 0;
    }

    /* Menu fermé par défaut */

    .site-header .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 10001;
        width: 100%;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        padding: 10px 16px 20px;
        background: #ffffff;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    }

    /* Menu ouvert */

    .site-header .main-nav.is-open {
        display: block;
    }

    .main-nav ul {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }

    .main-nav li {
        width: 100%;
        border-bottom: 1px solid #e5edf3;
    }

    .main-nav a {
        display: block;
        padding: 14px 10px;
        color: var(--navy);
        font-size: 16px;
        white-space: normal;
    }

    /* Sous-menus mobiles */

    .main-nav .sub-menu {
        display: block;
        position: static;
        min-width: 0;
        padding: 0 0 0 16px;
        background: #f3f7fa;
        box-shadow: none;
    }

    .main-nav .sub-menu a {
        padding: 11px 10px;
        font-size: 14px;
    }

    .header-cart {
        flex-shrink: 0;
        font-size: 14px;
    }

    /* Grille accueil */

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Grille boutique */

    .woocommerce ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }

    .woocommerce ul.products li.product {
        padding: 10px;
    }

    .woocommerce ul.products li.product a img {
        height: 200px;
    }

    .woocommerce ul.products li.product .woocommerce-loop-product__title {
        font-size: 14px;
    }

    .woocommerce ul.products li.product .price {
        font-size: 17px;
    }
}

/* =========================================
   11. RESPONSIVE : SMARTPHONES
   ========================================= */

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

    .hero {
        padding: 55px 0;
    }

    .brand img,
    .brand .custom-logo {
        width: 150px;
    }

    /* Footer mobile */

    .site-footer {
        margin-top: 40px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 40px 22px;
    }

    .footer-column h4 {
        margin-bottom: 18px;
    }

    .footer-about {
        text-align: center;
    }

    .footer-about .footer-logo {
        display: inline-block;
    }

    .footer-about .footer-logo img,
    .footer-about .footer-logo .custom-logo {
        margin: 0 auto;
    }

    .footer-about p {
        max-width: 360px;
        margin: 0 auto;
    }

    .footer-bottom-inner {
        flex-direction: column;
        gap: 12px;
        padding: 20px 16px;
        text-align: center;
    }

    .footer-legal {
        justify-content: center;
    }
}

/* =========================================
   12. PETITS SMARTPHONES
   ========================================= */

@media (max-width: 420px) {
    .woocommerce ul.products {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .woocommerce ul.products li.product {
        width: 100% !important;
        max-width: 360px;
        margin: 0 auto !important;
        padding: 14px;
    }

    .woocommerce ul.products li.product a img {
        height: 260px;
    }

    .woocommerce-shop .woocommerce-products-header__title {
        font-size: 24px;
    }
}

@media (max-width: 380px) {
    .header-inner {
        padding: 8px 10px;
        gap: 7px;
    }

    .brand img,
    .brand .custom-logo {
        max-width: 120px;
    }

    .mobile-menu-toggle {
        width: 40px;
        height: 40px;
    }

    .header-cart {
        font-size: 12px;
    }
}

/* =========================================================
   LO2LAIR — HEADER FIXE PROPRE
   Logo + menu restent visibles pendant le défilement.
   Le titre Boutique et les produits défilent normalement.
   ========================================================= */

:root {
    --lo2-header-height: 124px;
    --lo2-adminbar-height: 0px;
}

/* WordPress admin bar : elle reste au-dessus du header lorsque connecté */
.admin-bar {
    --lo2-adminbar-height: 32px;
}

/* Le header est sorti du flux et reste visible */
.site-header {
    position: fixed !important;
    top: var(--lo2-adminbar-height) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: var(--lo2-header-height) !important;
    min-height: var(--lo2-header-height) !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    overflow: visible !important;
    background: #ffffff !important;
    z-index: 1000 !important;
    transform: none !important;
    box-shadow: 0 2px 12px rgba(12, 45, 89, 0.08) !important;
}

/* Le conteneur interne occupe exactement la hauteur du header */
.site-header .header-inner {
    width: 100% !important;
    max-width: 1200px !important;
    height: var(--lo2-header-height) !important;
    min-height: var(--lo2-header-height) !important;
    margin: 0 auto !important;
    padding: 10px 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

/* Logo : jamais coupé verticalement */
.site-header .brand {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex: 0 0 auto !important;
    height: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.site-header .brand img,
.site-header .brand .custom-logo {
    display: block !important;
    width: auto !important;
    max-width: 245px !important;
    max-height: 96px !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Menu */
.site-header .main-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.site-header .main-nav > ul {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 28px !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.site-header .main-nav > ul > li {
    position: relative !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.site-header .main-nav > ul > li > a {
    display: block !important;
    padding: 8px 0 !important;
    white-space: nowrap !important;
}

/* Panier */
.site-header .header-cart {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Le body réserve l'espace occupé par le header fixe. */
body {
    padding-top: var(--lo2-header-height) !important;
}

/* Lorsque la barre d'administration WordPress est présente,
   le header commence sous celle-ci. */
body.admin-bar {
    padding-top: calc(var(--lo2-header-height) + var(--lo2-adminbar-height)) !important;
}

/* Le contenu WooCommerce reste dans le flux normal. */
.site-main,
.woocommerce-products-header,
.woocommerce-products-header__title {
    position: relative !important;
    top: auto !important;
    transform: none !important;
}

.site-main {
    z-index: 1 !important;
}

.woocommerce-products-header {
    float: none !important;
    clear: both !important;
    width: 100% !important;
}

/* Le titre Boutique ne devient jamais fixe. */
.woocommerce-products-header__title {
    z-index: auto !important;
}

/* =========================================================
   VERSION MOBILE
   ========================================================= */

@media (max-width: 800px) {
    :root {
        --lo2-header-height: 100px;
    }

    .admin-bar {
        --lo2-adminbar-height: 46px;
    }

    .site-header {
        height: var(--lo2-header-height) !important;
        min-height: var(--lo2-header-height) !important;
    }

    .site-header .header-inner {
        height: var(--lo2-header-height) !important;
        min-height: var(--lo2-header-height) !important;
        padding: 8px 16px !important;
        gap: 10px !important;
    }

    .site-header .brand img,
    .site-header .brand .custom-logo {
        max-width: 160px !important;
        max-height: 72px !important;
    }

    body,
    body.admin-bar {
        padding-top: calc(var(--lo2-header-height) + var(--lo2-adminbar-height)) !important;
    }
}

@media (max-width: 600px) {
    .site-header .brand img,
    .site-header .brand .custom-logo {
        max-width: 150px !important;
        max-height: 68px !important;
    }
}

@media (max-width: 380px) {
    .site-header .header-inner {
        padding: 8px 10px !important;
        gap: 7px !important;
    }

    .site-header .brand img,
    .site-header .brand .custom-logo {
        max-width: 120px !important;
        max-height: 60px !important;
    }
}
