/* ============================================================
   LEMARCHAND.CI — PRODUCT.CSS v6 (définitive)
   ============================================================ */

/* ── RESET STOREFRONT ── */
.woocommerce div.product .woocommerce-product-gallery { float: none !important; width: 100% !important; }
.woocommerce div.product .summary { float: none !important; width: 100% !important; }

/* ══════════════════════════════════════════════════════════
   SUPPRIMER LE SIDEBAR SUR FICHE PRODUIT
══════════════════════════════════════════════════════════ */
.single-product #secondary { display: none !important; }
.single-product #primary { width: 100% !important; float: none !important; }
.single-product .site-content,
.single-product #content { width: 100% !important; }

/* ══════════════════════════════════════════════════════════
   GRILLE 2 COLONNES
══════════════════════════════════════════════════════════ */
.lm-product-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 48px !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 24px 50px !important;
    align-items: start !important;
}

.lm-product-container .lm-product-images,
.lm-product-container .summary.entry-summary {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    clear: none !important;
}

.lm-product-images,
.lm-product-summary {
    min-width: 0 !important;
    width: 100% !important;
}

/* Cacher le badge WooCommerce par défaut */
.onsale {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════
   COLONNE GAUCHE — GALERIE
══════════════════════════════════════════════════════════ */
.lm-product-images {
    position: sticky;
    top: 90px;
}

.woocommerce-product-gallery {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

.woocommerce-product-gallery__wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.woocommerce-product-gallery__image img {
    width: 100% !important;
    height: 420px !important;
    object-fit: contain !important;
    padding: 20px !important;
    background: #fff;
    display: block !important;
}

.flex-control-thumbs {
    display: flex !important;
    gap: 8px !important;
    margin-top: 10px !important;
    padding: 0 !important;
    list-style: none !important;
    flex-wrap: wrap;
}

.flex-control-thumbs li { width: calc(25% - 6px) !important; }

.flex-control-thumbs li img {
    height: 72px !important;
    object-fit: contain !important;
    border-radius: 8px !important;
    border: 2px solid #e5e7eb !important;
    padding: 4px !important;
    background: #fff !important;
    cursor: pointer;
    transition: border-color .2s;
}

.flex-control-thumbs li img.flex-active,
.flex-control-thumbs li img:hover { border-color: #f97316 !important; }

.lm-product-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 12px;
}

.lm-product-nav a {
    color: #6b7280;
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    transition: all .15s;
}

.lm-product-nav a:hover { border-color: #f97316; color: #f97316; }

.lm-product-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-top: 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.lm-product-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ══════════════════════════════════════════════════════════
   COLONNE DROITE — RÉSUMÉ
══════════════════════════════════════════════════════════ */
.lm-product-summary {
    display: flex;
    flex-direction: column;
}

.lm-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.lm-ptag {
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.lm-pt-new { background: #DBEAFE; color: #1D4ED8; }
.lm-pt-sale { background: #FEF3C7; color: #B45309; }
.lm-pt-limited { background: #FEF9C3; color: #854D0E; }
.lm-pt-outstock { background: #FEE2E2; color: #991B1B; }
.lm-pt-instock { background: #D1FAE5; color: #065F46; }
.lm-pt-shipping { background: #F3F4F6; color: #374151; }

.lm-product-summary .product_title {
    font-size: 24px !important;
    font-weight: 900 !important;
    line-height: 1.3 !important;
    color: #111827 !important;
    margin: 0 0 10px !important;
    padding: 0 !important;
}

.lm-product-summary .woocommerce-product-rating {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
}

.lm-product-summary .star-rating { font-size: 14px; }
.lm-product-summary .woocommerce-review-link { font-size: 12px; color: #6b7280; }

.lm-product-summary .price {
    display: flex !important;
    align-items: baseline !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
    padding: 14px 16px !important;
    margin: 0 0 20px !important;
    background: #EFF6FF !important;
    border: 1px solid #BFDBFE !important;
    border-radius: 10px !important;
}

.lm-product-summary .price ins,
.lm-product-summary .price > .woocommerce-Price-amount {
    font-size: 30px !important;
    font-weight: 900 !important;
    color: #0EA5E9 !important;
    text-decoration: none !important;
}

.lm-product-summary .price del {
    font-size: 16px !important;
    color: #94A3B8 !important;
    font-weight: 500 !important;
}

.lm-product-summary form.cart { margin: 0 0 12px !important; }

.lm-cart-row {
    display: flex !important;
    gap: 10px !important;
    align-items: stretch !important;
}

.lm-product-summary .quantity {
    display: flex !important;
    align-items: center !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #fff !important;
    flex-shrink: 0 !important;
    height: 52px !important;
    min-width: 60px !important;
}

.lm-product-summary .quantity input[type="number"] {
    width: 60px !important;
    height: 52px !important;
    border: none !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    background: transparent !important;
    outline: none !important;
    padding: 0 !important;
    -moz-appearance: textfield !important;
}

.lm-product-summary .quantity input::-webkit-outer-spin-button,
.lm-product-summary .quantity input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
}

.lm-product-summary .single_add_to_cart_button {
    flex: 1 !important;
    height: 52px !important;
    background: #111827 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
    cursor: pointer !important;
    transition: background .2s !important;
    white-space: nowrap !important;
    padding: 0 20px !important;
}

.lm-product-summary .single_add_to_cart_button:hover {
    background: #f97316 !important;
    color: #111827 !important;
}

.lm-whatsapp-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    height: 52px !important;
    background: #25D366 !important;
    color: #fff !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    margin-bottom: 20px !important;
    transition: background .2s !important;
    white-space: nowrap !important;
}

.lm-whatsapp-btn:hover { background: #128C7E !important; color: #fff !important; }

.lm-product-summary .woocommerce-product-details__short-description {
    font-size: 14px !important;
    line-height: 1.7 !important;
    color: #4b5563 !important;
    margin: 0 0 20px !important;
    padding: 16px !important;
    background: #F8FAFC !important;
    border-radius: 10px !important;
    border: 1px solid #e5e7eb !important;
}

.lm-product-trust {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
    margin-bottom: 16px;
}

.lm-pt-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #F8FAFC;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.lm-pt-ico { font-size: 20px; flex-shrink: 0; }
.lm-pt-item strong { display: block; font-size: 12px; font-weight: 700; color: #111827; }
.lm-pt-item small { display: block; font-size: 10px; color: #6b7280; margin-top: 1px; }

.lm-product-summary .product_meta {
    font-size: 12px;
    color: #6b7280;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
}

/* ══════════════════════════════════════════════════════════
   ONGLETS
══════════════════════════════════════════════════════════ */
.lm-product-tabs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

.woocommerce-tabs ul.tabs {
    display: flex !important;
    gap: 4px !important;
    padding: 0 !important;
    margin: 0 0 0 !important;
    border-bottom: 2px solid #e5e7eb !important;
    list-style: none !important;
    background: transparent !important;
}

.woocommerce-tabs ul.tabs::before { display: none !important; }

.woocommerce-tabs ul.tabs li {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.woocommerce-tabs ul.tabs li a {
    display: block !important;
    padding: 12px 22px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #6b7280 !important;
    text-decoration: none !important;
    border-bottom: 2px solid transparent !important;
    margin-bottom: -2px !important;
    transition: all .15s !important;
}

.woocommerce-tabs ul.tabs li.active a,
.woocommerce-tabs ul.tabs li a:hover {
    color: #f97316 !important;
    border-bottom-color: #f97316 !important;
}

.woocommerce-tabs .panel {
    padding: 24px 0 !important;
    border: none !important;
    background: transparent !important;
}

/* ══════════════════════════════════════════════════════════
   PRODUITS SIMILAIRES
══════════════════════════════════════════════════════════ */
.lm-related-products {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 50px;
}

.lm-related-products > h2 {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #111827 !important;
    margin: 0 0 20px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid #e5e7eb !important;
}

.lm-related-products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.lm-related-products ul.products li.product {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    float: none !important;
    margin: 0 !important;
}

.lm-related-products .woocommerce-loop-product__title {
    font-size: 13px !important;
    line-height: 1.4 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.lm-related-products .price {
    font-size: 15px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    background: transparent !important;
    border: none !important;
    padding: 0 14px 12px !important;
}

.lm-related-products .button,
.lm-related-products .add_to_cart_button {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 11px !important;
    padding: 10px 8px !important;
    height: auto !important;
    min-height: 40px !important;
    display: block !important;
    text-align: center !important;
}

.lm-related-products ul.products li.product a img {
    width: 100% !important;
    height: 180px !important;
    object-fit: contain !important;
    padding: 10px !important;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
    .lm-product-container {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
        padding: 0 20px 40px !important;
    }
    .lm-product-images { position: static !important; }
    .woocommerce-product-gallery__image img { height: 340px !important; }
    .lm-related-products ul.products { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 640px) {
    .lm-product-container { padding: 0 14px 30px !important; }
    .woocommerce-product-gallery__image img { height: 260px !important; }
    .lm-product-summary .product_title { font-size: 20px !important; }
    .lm-product-trust { grid-template-columns: 1fr !important; }
    .lm-cart-row { flex-direction: column !important; }
    .lm-product-summary .quantity { width: 100% !important; justify-content: center !important; }
    .lm-related-products ul.products { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .lm-related-products ul.products li.product a img { height: 140px !important; }
}
/* FIX FINAL STRUCTURE PRODUIT */
.lm-product-container {
    margin-bottom: 60px !important;
}

/* Empêche chevauchement */
.lm-related-products {
    clear: both;
    width: 100%;
    display: block;
}

/* Corrige wrapper WooCommerce */
.lm-related-products .related.products {
    margin-top: 20px;
}

/* Sécurité layout */
body.single-product #primary {
    overflow: hidden;
}
/* FIX PRODUITS SIMILAIRES (CRITIQUE) */
.lm-related-products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
}

/* 🚨 RESET STOREFRONT */
.lm-related-products ul.products li.product {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Empêche compression verticale */
.lm-related-products ul.products li.product a {
    display: block !important;
}

/* Image propre */
.lm-related-products ul.products li.product img {
    width: 100% !important;
    height: 180px !important;
    object-fit: contain !important;
}
/* RESET STRUCTURE WOOCOMMERCE */
.lm-related-products .related.products {
    width: 100%;
    margin-top: 20px;
}

/* SUPPRIME LE FLOAT DE STOREFRONT */
.lm-related-products ul.products li.product {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
}

/* GRID PROPRE */
.lm-related-products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .lm-related-products ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .lm-related-products ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
/* Sécurité : si les related atterrissent dans la grille 2 colonnes */
.lm-product-container .lm-related-products {
    grid-column: 1 / -1;
}
/* ══════════════════════════════════════════════════════════
   NAVIGATION PRODUIT — ANIMATIONS
══════════════════════════════════════════════════════════ */
.lm-product-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 12px;
}

.lm-product-nav a {
    color: #6b7280;
    padding: 6px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    transition: all .25s ease;
    position: relative;
    overflow: hidden;
}

.lm-product-nav a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #f97316;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .3s ease;
    z-index: 0;
    border-radius: 5px;
}

.lm-product-nav a:first-child::before {
    transform-origin: right;
}

.lm-product-nav a:last-child::before {
    transform-origin: left;
}

.lm-product-nav a:hover::before {
    transform: scaleX(1);
}

.lm-product-nav a span {
    position: relative;
    z-index: 1;
}

.lm-product-nav a:hover {
    border-color: #f97316;
    color: #fff;
}