/**
 * PAGE PRODUIT SINGLE
 * Version: 12.4.0 - Badge promo identique à la page boutique
 */

/* GRID 2 COLONNES */
.product-layout-grid {
    max-width: 1400px;
    margin: 0 auto var(--spacing-xl);
    padding: 0 var(--spacing-md);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
}

@media (min-width: 1024px) {
    .product-layout-grid {
        grid-template-columns: 1.2fr 1fr;
    }
}

/* ===== GALERIE ===== */
.product-images-wrapper .woocommerce-product-gallery {
    background: var(--color-charcoal);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

/* Bouton zoom plein écran */
.product-images-wrapper .woocommerce-product-gallery__trigger {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.25rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.product-images-wrapper .woocommerce-product-gallery__trigger:hover {
    background: var(--color-orange);
}

/* Wrapper FlexSlider - forcer layout vertical */
.product-images-wrapper .flex-viewport {
    height: auto !important;
    overflow: visible !important;
}

.product-images-wrapper .woocommerce-product-gallery__wrapper {
    width: 100% !important;
    display: block !important;
    transform: none !important;
    transition: none !important;
}

/* Images individuelles */
.product-images-wrapper .woocommerce-product-gallery__image {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    display: none !important;
    position: static !important;
}

/* Afficher seulement l'image active */
.product-images-wrapper .woocommerce-product-gallery__image.flex-active-slide {
    display: block !important;
}

.product-images-wrapper .woocommerce-product-gallery__image a {
    display: block;
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.product-images-wrapper .woocommerce-product-gallery__image img {
    border-radius: var(--radius-md);
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* Image zoom (cachée) */
.product-images-wrapper .zoomImg {
    display: none !important;
}

/* Thumbnails */
.product-images-wrapper .flex-control-thumbs {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: var(--spacing-md) !important;
    margin: var(--spacing-lg) 0 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.product-images-wrapper .flex-control-thumbs li {
    opacity: 0.6;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    aspect-ratio: 1 / 1;
}

.product-images-wrapper .flex-control-thumbs li:hover,
.product-images-wrapper .flex-control-thumbs li.flex-active {
    opacity: 1;
    border-color: var(--color-orange);
}

.product-images-wrapper .flex-control-thumbs li img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* ===== INFOS PRODUIT ===== */
.product-summary-wrapper .summary {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Titre */
.product-summary-wrapper .product_title {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    color: var(--color-cream) !important;
    margin: 0 !important;
}

/* Prix */
.product-summary-wrapper .price {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: var(--color-red) !important;
    margin: 0 !important;
}

/* Description */
.product-summary-wrapper .woocommerce-product-details__short-description {
    background: var(--color-charcoal);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--color-gray-200);
    line-height: 1.7;
}

/* Formulaire */
.product-summary-wrapper form.cart {
    background: var(--color-charcoal);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Variations */
.product-summary-wrapper table.variations {
    width: 100%;
    margin-bottom: var(--spacing-md);
    border: none !important;
}

.product-summary-wrapper table.variations td,
.product-summary-wrapper table.variations th {
    padding: var(--spacing-sm) 0;
    border: none !important;
    background: transparent !important;
}

.product-summary-wrapper table.variations label {
    color: var(--color-gray-200) !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.product-summary-wrapper table.variations select {
    width: 100% !important;
    padding: 0.875rem 1rem !important;
    background: var(--color-background) !important;
    color: var(--color-cream) !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-md) !important;
    font-size: 1rem !important;
}

.product-summary-wrapper table.variations select:focus {
    border-color: var(--color-orange) !important;
    outline: none !important;
}

/* Bouton Ajouter au panier */
.product-summary-wrapper .single_add_to_cart_button {
    padding: 1rem 2rem !important;
    background: var(--color-red) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: background 0.3s !important;
    font-size: 1rem !important;
    margin-top: 20px !important;
}

.product-summary-wrapper .single_add_to_cart_button:hover {
    background: var(--color-orange) !important;
}

/* Meta */
.product-summary-wrapper .product_meta {
    background: var(--color-charcoal);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.product-summary-wrapper .product_meta span {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-gray-400);
    font-size: 0.875rem;
}

.product-summary-wrapper .product_meta a {
    color: var(--color-orange) !important;
    text-decoration: none !important;
}

/* ===== BADGE PROMO PAGE PRODUIT ===== */
.woocommerce div.product .onsale,
.product-images-wrapper .onsale {
    position: absolute !important;
    top: var(--spacing-sm) !important;
    right: var(--spacing-sm) !important;
    left: auto !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    border-radius: var(--radius-sm) !important;
    text-transform: uppercase !important;
    background: var(--color-orange) !important;
    color: white !important;
    margin: 0 !important;
    z-index: 10 !important;
}

/* ===== TABS ===== */
.woocommerce #content div.product .woocommerce-tabs,
.woocommerce div.product .woocommerce-tabs,
.woocommerce-page #content div.product .woocommerce-tabs,
.woocommerce-page div.product .woocommerce-tabs {
    clear: both;
    display: block;
    background: none;
    border: none;
    width: 100% !important;
}

/* Reset WooCommerce defaults */
.woocommerce-tabs::before,
.woocommerce-tabs::after {
    display: none !important;
}

/* Liste des onglets - Design horizontal moderne */
.woocommerce-tabs .tabs {
    display: flex !important;
    justify-content: center !important;
    gap: 0 !important;
    list-style: none !important;
    margin: 0 0 0 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    width: 100% !important;
    float: none !important;
}

.woocommerce-tabs .tabs::before,
.woocommerce-tabs .tabs::after {
    display: none !important;
}

.woocommerce-tabs .tabs li {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    float: none !important;
    position: relative !important;
}

.woocommerce-tabs .tabs li::before,
.woocommerce-tabs .tabs li::after {
    display: none !important;
}

.woocommerce-tabs .tabs li a {
    display: block !important;
    padding: 1rem 2rem !important;
    color: #f5f5f5 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    letter-spacing: 0.05em !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    background: #1a1a1a !important;
    position: relative !important;
    border-radius: 0 !important;
}

.woocommerce-tabs .tabs li:first-child a {
    border-radius: var(--radius-md) 0 0 0 !important;
}

.woocommerce-tabs .tabs li:last-child a {
    border-radius: 0 var(--radius-md) 0 0 !important;
}

.woocommerce-tabs .tabs li a:hover {
    color: #ff6b35 !important;
    border-color: #ff6b35 !important;
    background: rgba(255, 107, 53, 0.1) !important;
}

.woocommerce-tabs .tabs li.active a {
    color: white !important;
    background: #ff6b35 !important;
    border-color: #ff6b35 !important;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4) !important;
}

/* Panneaux de contenu - Pleine largeur */
.woocommerce-tabs .woocommerce-Tabs-panel {
    background: #1a1a1a !important;
    padding: 2rem !important;
    border: 2px solid rgba(255, 255, 255, 0.1) !important;
    border-top: 3px solid #ff6b35 !important;
    border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
    color: #f5f5f5 !important;
    line-height: 1.8 !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
    box-sizing: border-box !important;
    min-height: 200px !important;
    display: none !important;
}

/* Afficher uniquement le panneau actif */
.woocommerce-tabs .woocommerce-Tabs-panel[style*="display: block"],
.woocommerce-tabs .woocommerce-Tabs-panel.active {
    display: block !important;
}

.woocommerce-tabs .woocommerce-Tabs-panel::before,
.woocommerce-tabs .woocommerce-Tabs-panel::after {
    display: none !important;
}

.woocommerce-tabs .woocommerce-Tabs-panel h2 {
    color: #ff6b35 !important;
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.woocommerce-tabs .woocommerce-Tabs-panel p {
    margin-bottom: 1rem !important;
    color: #f5f5f5 !important;
    font-size: 1rem !important;
    line-height: 1.8 !important;
}

/* Table des attributs */
.woocommerce-tabs .shop_attributes {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 0 !important;
}

.woocommerce-tabs .shop_attributes tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.woocommerce-tabs .shop_attributes tr:last-child {
    border-bottom: none !important;
}

.woocommerce-tabs .shop_attributes th,
.woocommerce-tabs .shop_attributes td {
    padding: 0.75rem 1rem !important;
    text-align: left !important;
    border: none !important;
    background: transparent !important;
}

.woocommerce-tabs .shop_attributes th {
    color: #ff6b35 !important;
    font-weight: 700 !important;
    width: 30% !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

.woocommerce-tabs .shop_attributes td {
    color: #f5f5f5 !important;
}

.woocommerce-tabs .shop_attributes td p {
    margin: 0 !important;
    color: #f5f5f5 !important;
}

/* Section avis */
.woocommerce-tabs #reviews {
    clear: both !important;
}

.woocommerce-tabs #reviews h2,
.woocommerce-tabs #reviews .comment-reply-title {
    color: #ff6b35 !important;
    font-size: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.woocommerce-tabs #reviews .commentlist {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 2rem 0 !important;
}

.woocommerce-tabs #reviews .comment {
    background: rgba(255, 255, 255, 0.05) !important;
    padding: 1.5rem !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 1rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.woocommerce-tabs #reviews .star-rating {
    color: #ff6b35 !important;
}

.woocommerce-tabs #reviews .woocommerce-noreviews {
    color: #f5f5f5 !important;
    font-size: 1rem !important;
    padding: 2rem !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border-radius: var(--radius-md) !important;
}

/* Formulaire d'avis */
.woocommerce-tabs #review_form label {
    color: #f5f5f5 !important;
    font-weight: 600 !important;
}

.woocommerce-tabs #review_form textarea,
.woocommerce-tabs #review_form input[type="text"],
.woocommerce-tabs #review_form input[type="email"] {
    background: #0a0a0a !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    color: #f5f5f5 !important;
    padding: 0.75rem !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
}

.woocommerce-tabs #review_form textarea:focus,
.woocommerce-tabs #review_form input:focus {
    border-color: #ff6b35 !important;
    outline: none !important;
}

.woocommerce-tabs #review_form .submit {
    background: #ff6b35 !important;
    color: white !important;
    border: none !important;
    padding: 1rem 2rem !important;
    border-radius: var(--radius-md) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
}

.woocommerce-tabs #review_form .submit:hover {
    background: #c41e3a !important;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4) !important;
}

.woocommerce-tabs .clear {
    clear: both !important;
    display: block !important;
    height: 0 !important;
}

/* ===== PRODUITS SIMILAIRES ===== */
.up-sells,
.related {
    max-width: 1400px;
    margin: var(--spacing-xl) auto;
    padding: 0 var(--spacing-md);
}

.up-sells > h2,
.related > h2 {
    color: var(--color-cream) !important;
    border-bottom: 3px solid var(--color-orange);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-lg) !important;
}

/* Enlever le border des titres de produits individuels */
.up-sells li.product h2,
.related li.product h2,
.up-sells li.product .woocommerce-loop-product__title,
.related li.product .woocommerce-loop-product__title {
    border-bottom: none !important;
    border-top: none !important;
    padding-bottom: 0 !important;
}

/* Désactiver les pseudo-éléments ::before et ::after sur les listes de produits */
.woocommerce .products ul::after,
.woocommerce .products ul::before,
.woocommerce ul.products::after,
.woocommerce ul.products::before,
.woocommerce-page ul.products::after,
.woocommerce-page ul.products::before,
.up-sells ul.products::after,
.up-sells ul.products::before,
.related ul.products::after,
.related ul.products::before {
    display: none !important;
    content: none !important;
}

.up-sells ul.products,
.related ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: var(--spacing-md) !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

@media (max-width: 768px) {
    .up-sells ul.products,
    .related ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Card produit */
.up-sells li.product,
.related li.product {
    background: var(--color-charcoal) !important;
    border-radius: var(--radius-lg) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    overflow: hidden !important;
    transition: all 0.3s !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.up-sells li.product::before,
.related li.product::before {
    display: none !important;
}

.up-sells li.product:hover,
.related li.product:hover {
    transform: translateY(-8px) !important;
    border-color: var(--color-orange) !important;
}

/* Wrapper lien image */
.up-sells li.product .woocommerce-loop-product__link,
.related li.product .woocommerce-loop-product__link {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
}

/* Badge promo */
.up-sells li.product .onsale,
.related li.product .onsale {
    position: absolute !important;
    top: var(--spacing-sm) !important;
    right: var(--spacing-sm) !important;
    left: auto !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    border-radius: var(--radius-sm) !important;
    text-transform: uppercase !important;
    background: var(--color-orange) !important;
    color: white !important;
    margin: 0 !important;
    z-index: 10 !important;
}

/* Image */
.up-sells li.product img,
.related li.product img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.3s !important;
}

.up-sells li.product:hover img,
.related li.product:hover img {
    transform: scale(1.08) !important;
}

/* Titre */
.up-sells li.product h2,
.related li.product h2,
.up-sells li.product .woocommerce-loop-product__title,
.related li.product .woocommerce-loop-product__title {
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-sm) !important;
    color: var(--color-cream) !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    line-height: 1.3 !important;
}

.up-sells li.product h2 a,
.related li.product h2 a,
.up-sells li.product .woocommerce-loop-product__title a,
.related li.product .woocommerce-loop-product__title a {
    color: var(--color-cream) !important;
    text-decoration: none !important;
}

/* Prix */
.up-sells li.product .price,
.related li.product .price {
    padding: 0 var(--spacing-md) var(--spacing-sm) !important;
    color: var(--color-red) !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    display: block !important;
    margin: 0 !important;
}

.up-sells li.product .price del,
.related li.product .price del {
    color: var(--color-gray-400) !important;
    font-size: 1rem !important;
    margin-right: 0.5rem !important;
}

.up-sells li.product .price ins,
.related li.product .price ins {
    text-decoration: none !important;
}

/* Bouton */
.up-sells li.product .button,
.related li.product .button,
.up-sells li.product .add_to_cart_button,
.related li.product .add_to_cart_button {
    margin: 0 var(--spacing-md) var(--spacing-md) !important;
    padding: 0.75rem !important;
    background: var(--color-red) !important;
    color: white !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.875rem !important;
    display: block !important;
    width: calc(100% - 2 * var(--spacing-md)) !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: all 0.3s !important;
    margin-top: auto !important;
}

.up-sells li.product .button:hover,
.related li.product .button:hover,
.up-sells li.product .add_to_cart_button:hover,
.related li.product .add_to_cart_button:hover {
    background: var(--color-orange) !important;
    transform: translateY(-2px) !important;
}

/* RESPONSIVE */
@media (max-width: 1023px) {
    .product-layout-grid {
        grid-template-columns: 1fr;
    }
}
