/* ===== FICHE PRODUIT ===== */

/* ---- Layout 2 colonnes ---- */
.single-product div.product {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 20px 48px;
    align-items: start;
}

/* FIX : galerie à 100% de sa colonne (neutralise le width:48% natif) */
.woocommerce #content div.product div.images,
.woocommerce div.product div.images,
.woocommerce-page #content div.product div.images,
.woocommerce-page div.product div.images {
    width: 100% !important;
    float: none !important;
}
.woocommerce #content div.product div.summary,
.woocommerce div.product div.summary,
.woocommerce-page #content div.product div.summary,
.woocommerce-page div.product div.summary {
    width: 100% !important;
    float: none !important;
}

.single-product .woocommerce-product-gallery { grid-column: 1; grid-row: 1; }
.single-product .entry-summary {
    grid-column: 2; grid-row: 1;
    /* sticky retiré à la demande */
}
.single-product .woocommerce-tabs,
.single-product .eco-related { grid-column: 1 / -1; }

/* ---- Fil d'ariane ---- */
.single-product .woocommerce-breadcrumb { font-size: 13px; color: #6b7177; margin: 16px 0 4px; }
.single-product .woocommerce-breadcrumb a { color: #6b7177; text-decoration: none; }
.single-product .woocommerce-breadcrumb a:hover { color: var(--eco-accent, #2b6cb0); }

/* ---- Galerie ---- */
.single-product .woocommerce-product-gallery { position: relative; }
.single-product .woocommerce-product-gallery__wrapper {
    border-radius: 14px; overflow: hidden; background: #f0f2f5;
}
.single-product .woocommerce-product-gallery__image img { width: 100%; display: block; }

/* FIX : loupe bien visible */
.woocommerce div.product div.images .woocommerce-product-gallery__trigger {
    position: absolute !important; top: 14px; right: 14px; z-index: 9;
    width: 44px; height: 44px; border-radius: 50%;
    background: #fff !important;
    border: 2px solid var(--eco-accent, #2b6cb0);
    box-shadow: 0 5px 16px rgba(0,0,0,.28);
    text-indent: -9999px; overflow: hidden; cursor: pointer;
}
.woocommerce div.product div.images .woocommerce-product-gallery__trigger::before {
    content: ''; position: absolute; inset: 0; margin: auto;
    width: 20px; height: 20px; background-color: var(--eco-accent, #2b6cb0);
    -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.3-4.3'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.3-4.3'/></svg>") center/contain no-repeat;
}

/* Miniatures */
.single-product .flex-control-thumbs {
    display: flex; gap: 10px; margin-top: 12px; padding: 0; list-style: none;
}
.single-product .flex-control-thumbs li { width: 72px; flex: 0 0 72px; }
.single-product .flex-control-thumbs img {
    border-radius: 8px; border: 2px solid transparent;
    opacity: .65; cursor: pointer;
    transition: opacity .2s ease, border-color .2s ease;
}
.single-product .flex-control-thumbs img:hover { opacity: 1; }
.single-product .flex-control-thumbs img.flex-active { border-color: var(--eco-accent, #2b6cb0); opacity: 1; }

/* Badge promo */
.single-product span.onsale.eco-onsale {
    position: absolute; top: 14px; left: 14px; z-index: 5;
    min-width: 0; min-height: 0; line-height: 1.4;
    background: #e53e3e; color: #fff;
    font-weight: 700; font-size: 13px;
    padding: 5px 11px; border-radius: 5px;
}

/* ---- Résumé ---- */
.single-product .entry-summary > * { margin-top: 0 !important; }
.single-product .product_title {
    font-size: 30px; font-weight: 800; line-height: 1.2;
    color: var(--eco-text, #1d2327); margin: 4px 0 10px !important;
}
.single-product .woocommerce-product-rating { margin-bottom: 12px !important; }
.single-product .star-rating span::before { color: #f5a623; }
.single-product .woocommerce-review-link { color: #6b7177; font-size: 13px; }

.single-product .entry-summary .price {
    font-size: 28px; font-weight: 800; color: var(--eco-text, #1d2327);
    margin: 0 0 14px !important;
}
.single-product .entry-summary .price del { font-size: 18px; color: #9ca3af; font-weight: 400; }
.single-product .entry-summary .price ins { text-decoration: none; color: #e53e3e; }

.single-product .woocommerce-product-details__short-description {
    color: #4b5563; font-size: 15px; line-height: 1.65;
    margin-bottom: 20px !important;
}

/* Stock */
.single-product .stock.in-stock { color: #38a169; font-weight: 600; font-size: 14px; }
.single-product .stock.out-of-stock { color: #e53e3e; font-weight: 600; font-size: 14px; }

/* ---- Formulaire d'achat ---- */
.single-product form.cart {
    display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap;
    margin: 0 0 6px !important;
}
.single-product form.cart .quantity { margin: 0; }
.single-product form.cart .quantity input {
    width: 64px; height: 50px; text-align: center;
    border: 1px solid var(--eco-border, #e6e6e6); border-radius: 8px;
    font-size: 16px; font-weight: 600;
}
.single-product .single_add_to_cart_button {
    flex: 1; min-width: 200px; height: 50px;
    background: var(--eco-accent, #2b6cb0) !important; color: #fff !important;
    border: 0; border-radius: 8px;
    font-size: 15px; font-weight: 700; cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.single-product .single_add_to_cart_button:hover { background: #1e4e8a !important; transform: translateY(-1px); }

/* FIX : boutons + / - (visibles aussi sur la fiche produit) */
.single-product .quantity { display: inline-flex !important; align-items: center; }
.single-product .eco-qty-btn {
    width: 38px; height: 50px; border: 1px solid var(--eco-border, #e6e6e6);
    background: #fff; cursor: pointer; font-size: 18px; font-weight: 700;
    color: var(--eco-text, #1d2327); transition: all .2s ease;
}
.single-product .eco-qty-minus { border-radius: 8px 0 0 8px; }
.single-product .eco-qty-plus { border-radius: 0 8px 8px 0; border-left: 0; }
.single-product .eco-qty-btn:hover { background: var(--eco-accent, #2b6cb0); color: #fff; border-color: var(--eco-accent, #2b6cb0); }

/* Produits variables */
.single-product form.cart .variations { width: 100%; margin-bottom: 12px; }
.single-product form.cart .variations select {
    width: 100%; max-width: 320px; height: 46px;
    border: 1px solid var(--eco-border, #e6e6e6); border-radius: 8px;
    padding: 0 12px; background: #fff;
}

/* ---- Wishlist YITH (insertion automatique du plugin, on style juste) ---- */
.single-product .yith-wcwl-add-to-wishlist { margin: 12px 0 0 !important; float: none !important; clear: both; }
.single-product .yith-wcwl-add-to-wishlist a,
.single-product .yith-wcwl-add-to-wishlist button {
    display: inline-flex; align-items: center; gap: 7px;
    color: var(--eco-text, #1d2327); text-decoration: none;
    font-size: 14px; font-weight: 600;
    background: none; border: 0; cursor: pointer;
    transition: color .2s ease;
}
.single-product .yith-wcwl-add-to-wishlist a:hover,
.single-product .yith-wcwl-add-to-wishlist button:hover { color: #e53e3e; }
.single-product .yith-wcwl-add-to-wishlist .feedback { display: inline-block; font-size: 13px; color: #38a169; }

/* ---- Réassurance mini ---- */
.eco-sp-trust {
    list-style: none; margin: 18px 0 0 !important; padding: 16px 0 0 !important;
    border-top: 1px dashed var(--eco-border, #e6e6e6);
    display: flex; flex-direction: column; gap: 9px;
}
.eco-sp-trust li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: #4b5563; }
.eco-sp-trust svg { width: 17px; height: 17px; color: var(--eco-accent, #2b6cb0); flex-shrink: 0; }

/* ---- Meta ---- */
.single-product .product_meta { padding-top: 14px; font-size: 13px; color: #6b7177; }
.single-product .product_meta a { color: #6b7177; text-decoration: none; }
.single-product .product_meta a:hover { color: var(--eco-accent, #2b6cb0); }
.single-product .product_meta > * { display: block; margin-top: 4px; }

/* ---- Onglets ---- */
.single-product .woocommerce-tabs { margin-top: 40px; }
.single-product .woocommerce-tabs ul.tabs {
    display: flex; gap: 6px; flex-wrap: wrap;
    padding: 0; margin: 0 0 22px !important; list-style: none;
    border-bottom: 1px solid var(--eco-border, #e6e6e6) !important;
}
.single-product .woocommerce-tabs ul.tabs::before { display: none; }
.single-product .woocommerce-tabs ul.tabs li {
    background: transparent !important;
    border: 1px solid transparent !important; border-radius: 999px !important;
    margin: 0 0 10px !important; padding: 0 !important;
}
.single-product .woocommerce-tabs ul.tabs li::before,
.single-product .woocommerce-tabs ul.tabs li::after { display: none; }
.single-product .woocommerce-tabs ul.tabs li a {
    display: block; padding: 9px 20px !important;
    font-size: 14px; font-weight: 600;
    color: #4b5563 !important;
    transition: all .2s ease;
}
.single-product .woocommerce-tabs ul.tabs li.active a {
    background: var(--eco-accent, #2b6cb0); color: #fff !important;
    border-radius: 999px;
}

/* ---- Carrousel produits similaires ---- */
.eco-related { margin-top: 46px; padding-top: 8px; }
.eco-related-title {
    font-size: 24px; font-weight: 800; color: var(--eco-text, #1d2327);
    padding-left: 16px; position: relative; margin: 0 0 20px;
}
.eco-related-title::before {
    content: ''; position: absolute; left: 0; top: 5px; bottom: 5px;
    width: 5px; border-radius: 3px; background: var(--eco-accent, #2b6cb0);
}
.eco-carousel--related .eco-product { flex: 0 0 calc((100% - 3 * 18px) / 4); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .eco-carousel--related .eco-product { flex: 0 0 calc((100% - 2 * 18px) / 3); }
}
@media (max-width: 782px) {
    .single-product div.product { grid-template-columns: 1fr; gap: 0; }
    .single-product .woocommerce-product-gallery,
    .single-product .entry-summary,
    .single-product .woocommerce-tabs,
    .single-product .eco-related { grid-column: 1; }
    .single-product .entry-summary { margin-top: 20px; }
    .single-product .product_title { font-size: 22px; }
    .single-product .entry-summary .price { font-size: 22px; }
    .single-product .single_add_to_cart_button { min-width: 100%; }
    .single-product .woocommerce-tabs { margin-top: 30px; }
    .eco-carousel--related .eco-product { flex: 0 0 calc((100% - 18px) / 2); }
}