/**
 * Optimea Theme Enhancements
 * Style épuré et moderne inspiré d'Apple
 * @package optimea
 */

/* ===========================
   Variables CSS
   =========================== */
:root {
    --optimea-primary: #23324f;
    --optimea-secondary: #d47c1f;
    --optimea-text: #1d1d1f;
    --optimea-text-light: #6e6e73;
    --optimea-bg: #ffffff;
    --optimea-bg-light: #f5f5f7;
    --optimea-border: #d2d2d7;
    --optimea-radius: 18px;
    --optimea-radius-sm: 12px;
    --optimea-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    --optimea-shadow-lg: 0 4px 32px rgba(0, 0, 0, 0.12);
    --optimea-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   Typography Improvements
   =========================== */
body {
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--optimea-text);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

body.single-product .site {
    margin-top: 2rem;
}


/* ===========================
   Button Enhancements
   =========================== */
/* Correction: Les boutons avec border ne doivent PAS changer de border au hover */
/* Base transition for all buttons */
.o-button,
.wpcf7-submit,
.form-submit input[type=submit],
.nav-links a,
.o-button_white,
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button {
    transition: all 0.3s ease-in-out;
}

.o-button:hover,
.o-button:focus,
.wpcf7-submit:hover,
.wpcf7-submit:focus,
.form-submit input[type=submit]:hover,
.form-submit input[type=submit]:focus,
.nav-links a:hover,
.nav-links a:focus,
.o-button_white:hover,
.o-button_white:focus,
.woocommerce button.button:hover,
.woocommerce a.button:hover,
.woocommerce input.button:hover {
    /* Ne PAS changer le border pour éviter de pousser les éléments */
    border-color: #556E82 !important;
    background: #556E82 !important;
    /* Utiliser transform au lieu de changer les dimensions */
    transform: scale(1.02);
}

.o-button:active {
    transform: scale(0.98);
}

/* Bouton blanc (ex: téléphone dans footer) */
.o-button_white {
    background: #ffffff;
    color: var(--optimea-primary);
    border-color: #ffffff !important;
}

.o-button_white:hover,
.o-button_white:focus {
    background: #556E82 !important;
    color: #ffffff !important;
    border-color: #556E82 !important;
    transform: scale(1.02);
}

/* Espacement entre l'icône et le texte dans les boutons */
.o-button svg,
.footer__btn svg {
    margin-right: 8px;
}

/* Transition pour le SVG dans les boutons */
.o-button svg,
.footer__btn svg {
    transition: all 0.3s ease-in-out;
}

/* Couleur du SVG au hover du bouton blanc */
.o-button_white:hover svg,
.o-button_white:focus svg {
    fill: #ffffff;
}

/* ===========================
   Card & Section Improvements
   =========================== */
.section {
    padding: 80px 0;
}

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

.section__title {
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.section__text {
    font-size: 1.125rem;
    color: var(--optimea-text-light);
    line-height: 1.7;
}

/* Card styling - Effet hover UNIQUEMENT sur produits et articles */
.woocommerce .product,
.news__item {
    transition: var(--optimea-transition);
}

/* ===========================
   Image Improvements
   =========================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.image-br-30,
.swiper__image img,
.benefits__image img,
.approaches__image img {
    border-radius: var(--optimea-radius);
    background-color: white;
}

/* ===========================
   Header Improvements
   =========================== */
#header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    /* -webkit-backdrop-filter: blur(20px); */
    /* box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05); */
    transition: var(--optimea-transition);
}

/* ===========================
   Mobile Menu
   =========================== */

#header .logo img {
    transition: var(--optimea-transition);
}

#header.scrolled .logo img {
    transform: scale(0.9);
}

/* ===========================
   FiboSearch Integration
   =========================== */
/* Ensure FiboSearch elements don't inherit navbar link styles */
.navbar-search .dgwt-wcas-search-wrapp {
    margin: 0;
}

.navbar-search .dgwt-wcas-search-form {
    margin: 0;
}

/* Mobile: Compact icon-only design */
@media (max-width: 991px) {
    .navbar-search {
        width: 28px;
        height: 28px;
    }

    .navbar-search .dgwt-wcas-search-wrapp {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .navbar-search .dgwt-wcas-search-icon {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .navbar-search .dgwt-wcas-ico-magnifier-handler {
        height: 28px;
        display: flex;
        margin: 0;
        fill: #012970;
    }

    .navbar-search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input,
    .navbar-search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:hover,
    .navbar-search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input:focus {
        border: none !important;
        border-color: transparent !important;
    }

    input#dgwt-wcas-search-input-1 {
        border: none !important;
    }
}

/* Effet hover soulignement sur le menu desktop uniquement */
@media (min-width: 1280px) {
    .navbar > ul > li > a {
        position: relative;
    }

    .navbar > ul > li > a::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--optimea-primary);
        transition: all 0.3s ease-in-out;
    }

    .navbar > ul > li > a:hover::after,
    .navbar > ul > li > a.active::after {
        width: 100%;
    }
}

/* ===========================
   Footer Improvements
   =========================== */
/* Footer conserve son style original (background bleu marine #233250) */

/* Titres footer (Solutions, A PROPOS) avec espacement */
.footer-box__title {
    display: block;
    margin-bottom: 1.25rem;
}

/* Liens du footer - Blanc pour être visible sur fond bleu marine */
.footer-menu a {
    color: #ffffff;
    transition: var(--optimea-transition);
    text-decoration: none;
}

.footer-menu a:hover {
    color: var(--optimea-secondary); /* Orange #d47c1f pour contraste */
    transform: translateX(4px);
}

.social-links__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--optimea-primary);
    color: #ffffff;
    transition: var(--optimea-transition);
    margin: 0 4px;
}

.social-links__item:hover {
    background: var(--optimea-secondary);
    transform: translateY(-4px);
    box-shadow: var(--optimea-shadow);
}

/* ===========================
   Breadcrumb (fil d'ariane) - Style épuré
   =========================== */
.breadcrumbs {
    background: transparent;
    padding: 1.5rem 0;
    font-size: 0.875rem;
}

.breadcrumbs__list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumbs__list a {
    color: var(--optimea-text-light);
    text-decoration: none;
    transition: var(--optimea-transition);
}

.breadcrumbs__list a:hover {
    color: var(--optimea-primary);
}

.breadcrumb__separator {
    color: var(--optimea-text-light);
    margin: 0 0.25rem;
}

.breadcrumb_last {
    color: var(--optimea-text);
    font-weight: 500;
}

/* ===========================
   WooCommerce Improvements
   =========================== */

/* Single Product Title */
.single-product .product_title {
    font-weight: 500 !important;
    margin-bottom: 0 !important;
}


/* Price styling - remove underline from ins tag */
ins {
    text-decoration: none;
}

/* Add to cart button - prevent content overflow */
.single_add_to_cart_button {
    overflow: hidden !important;
    position: relative;
    width: 100%;
    font-size: 1.4rem;
    padding: 1.5rem;
    transition: all 0.3s ease-in-out;
}

button.single_add_to_cart_button.button.alt {
    padding: 1.5rem;
    font-size: 1.4rem;
    transition: all 0.3s ease-in-out;
}

/* Add to cart button loading state */
.single_add_to_cart_button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.single_add_to_cart_button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: optimea-spin 0.6s linear infinite;
}

/* Product price spacing */
.single-product .price {
    margin-bottom: 3rem !important;
}

/* Cart form layout */
.single-product form.cart {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Quantity selector improvements */
.optimea-quantity-wrapper {
    padding: 0.2rem;
}

.optimea-qty-btn {
    width: 60px;
    height: 60px;
}

.optimea-quantity-wrapper input.qty {
    outline: none;
    border: none;
}

/* Quantity spacing */
.woocommerce div.product form.cart div.quantity {
    margin-right: 1rem !important;
}

/* Product Benefits Section */
.product-benefits {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1.5rem;
}

.product-benefits__column {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    gap: 1.5rem;
}

.product-benefits__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    font-weight: 600;
}

.product-benefits__item img {
    height: 50px;
    aspect-ratio: 1;
}

/* Product Gallery Thumbnails */
.woocommerce div.product div.images .flex-control-thumbs li img,
.flex-control-nav.flex-control-thumbs li img {
    border-radius: 0 !important;
    border: 1px solid #f5f5f7;
    transition: border-color 0.3s ease, opacity 0.3s ease;
    opacity: 0.7;
}

.woocommerce div.product div.images .flex-control-thumbs li img.flex-active,
.flex-control-nav.flex-control-thumbs li img.flex-active {
    border: 1px solid #556E82;
    opacity: 1;
}

.woocommerce div.product div.images .flex-control-thumbs li img:hover,
.flex-control-nav.flex-control-thumbs li img:hover {
    opacity: 1;
    border-color: #556E82;
}

/* Carousel for thumbnails when more than 4 images */
.flex-control-thumbs-wrapper {
    position: relative;
    /* overflow: hidden; */
}

.flex-control-nav.flex-control-thumbs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: hidden;
    scroll-behavior: smooth;
    gap: 0.875rem;
    margin: 0 !important;
}

/* Force thumbnails to maintain fixed size */
.flex-control-nav.flex-control-thumbs li {
    flex: 0 0 auto !important;
    width: calc(25% - 0.656rem) !important; /* 4 items visible with gap */
    margin: 0 !important;
    padding: 0 !important;
}

.flex-control-nav.flex-control-thumbs li img {
    width: 100% !important;
    height: auto !important;
}

.flex-control-thumbs-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #f5f5f7;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.flex-control-thumbs-nav.flex-control-thumbs-next {
    right: -10px;
}

.flex-control-thumbs-nav.flex-control-thumbs-prev {
    left: -10px;
}

.flex-control-thumbs-nav:hover {
    background: #ffffff;
    border-color: #556E82;
}

.flex-control-thumbs-nav svg {
    width: 20px;
    height: 20px;
    fill: #556E82;
}

.flex-control-thumbs-nav.hidden {
    display: none !important;
}

.woocommerce-page .product,
.woocommerce .product {
    border-radius: var(--optimea-radius);
    background: #ffffff;
    transition: var(--optimea-transition);
}



/* Wrapper pour prix + éco-part */
.product-price-wrapper {
    position: relative;
}

.woocommerce .product .price {
    color: var(--optimea-primary) !important;
    font-weight: 600 !important;
    font-size: 3rem !important;
    position: relative !important;
}

/* Position relative pour le span du prix */
.woocommerce-Price-amount.amount {
    position: relative;
}

/* Éco-participation */
.product-environmental-fee {
    position: absolute;
    top: 94%;
    left: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #718798;
    white-space: nowrap;
}

.woocommerce .star-rating span:before {
    color: var(--optimea-secondary);
}

.woocommerce div.product p.price del, .woocommerce div.product span.price del {
    font-size: 1.5rem;
    position: absolute;
    bottom: 75%;
    text-decoration: line-through;
    color: #718798;
    font-weight: 400;
}

/* Product Gallery */
.woocommerce div.product div.images {
    /* overflow: hidden; */
}

/* Checkout improvements */
.woocommerce-checkout .woocommerce {
    background: #ffffff;
    padding: 40px;
    border-radius: var(--optimea-radius);
    box-shadow: var(--optimea-shadow);
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select {
    border: 1px solid var(--optimea-border);
    border-radius: var(--optimea-radius-sm);
    padding: 12px 16px;
    transition: var(--optimea-transition);
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
    border-color: var(--optimea-primary);
    box-shadow: 0 0 0 3px rgba(35, 50, 79, 0.1);
    outline: none;
}

/* ===========================
   Loading States
   =========================== */
.optimea-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.optimea-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--optimea-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: optimea-spin 0.8s linear infinite;
}

@keyframes optimea-spin {
    to { transform: rotate(360deg); }
}

/* ===========================
   Accessibility Improvements
   =========================== */
:focus-visible {
    outline: 2px solid var(--optimea-primary);
    outline-offset: 4px;
}

.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--optimea-primary);
    color: #ffffff;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 var(--optimea-radius-sm) 0;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* ===========================
   Smooth Scrolling
   =========================== */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================
   Back to Top Button
   =========================== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--optimea-primary);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--optimea-transition);
    box-shadow: var(--optimea-shadow);
    z-index: 99;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--optimea-secondary);
    transform: translateY(-4px);
    box-shadow: var(--optimea-shadow-lg);
}

/* ===========================
   Responsive Improvements
   =========================== */
@media (max-width: 992px) {
    .section {
        padding: 60px 0;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }
}

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

    .o-button {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    .navbar,
    .footer,
    .back-to-top,
    .fixed-side-menu {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }

    a {
        text-decoration: underline;
    }

    img {
        max-width: 100% !important;
    }
}

.section.section_product-top {
    padding-top: 4rem !important;
}

.woocommerce .onsale {
    top: 0 !important;
    right: auto ! important;
    left: 0 !important;
    background: #d37e22 !important;
    border-radius: 6px !important;
    padding: 0px 15px !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    min-height: auto !important;
    min-width: auto !important;
    border-radius: 0px 0px 24px 0px !important;
    height: auto !important;
    width: auto !important;
}

/*  Fil d'Ariane */

    .breadcrumb-list .item{
        padding: 0.8rem 1.2rem;
        background: #f5f5f7;
        border-radius: 38px;
        margin: 1.5rem 0rem;
    }

    .breadcrumb-list {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
        flex-wrap: wrap;
        font-size: 1rem;
        font-weight: 500;
    }
    .breadcrumb-list li {
        display: flex;
        align-items: center;
    }
    .breadcrumb-list li:not(:last-child)::after {
        content: '›';
        margin: 0 0.5rem;
        color: #6c757d;
    }
    .breadcrumb-list a {
        color: #556E82;
        text-decoration: none;
    }
    .breadcrumb-list a:hover {
        color: #233250;
    }
    .breadcrumb-list .current {
        color: #233250;
    }

