/**
 * Kesli - Styles pour les pages produits
 * Un design moderne et épuré pour WooCommerce
 */

/* ==========================================================================
   Reset et styles généraux pour la page produit
   ========================================================================== */

.single-product .site-main {
    padding: 80px 0;
    background: #fff;
}

.single-product .type-product {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 100px;
}

@media (max-width: 1600px) {
    .single-product .type-product {
        padding: 0 60px;
    }
}

@media (max-width: 1200px) {
    .single-product .type-product {
        padding: 0 40px;
    }
}

/* Breadcrumbs - Garder mais styler */
.woocommerce-breadcrumb {
    font-size: 13px;
    color: #999;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.woocommerce-breadcrumb a {
    color: #999;
    text-decoration: none;
}

.woocommerce-breadcrumb a:hover {
    color: #333;
}

/* Layout en 2 colonnes avec gap - IMPORTANT pour override Storefront */
.single-product div.product {
    display: flex !important;
    gap: 100px;
    align-items: flex-start;
    flex-wrap: nowrap;
    margin-bottom: 100px;
}

/* ==========================================================================
   Galerie d'images produit
   ========================================================================== */

.single-product div.product .woocommerce-product-gallery {
    margin-bottom: 0 !important;
    float: none !important;
    width: 45% !important;
    max-width: 500px !important;
    flex-shrink: 0;
}

.woocommerce-product-gallery__wrapper {
    margin: 0;
    padding: 0;
}

.woocommerce-product-gallery__image {
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 15px;
}

.woocommerce-product-gallery__image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Miniatures - SOUS l'image principale */
.flex-control-nav {
    margin-top: 15px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.flex-control-nav li {
    width: calc(50% - 8px);
    margin: 0;
}

/* Forcer les miniatures dans le container de la galerie */
.single-product .woocommerce-product-gallery ol.flex-control-nav {
    position: relative !important;
    bottom: auto !important;
    width: 100% !important;
}

.flex-control-nav li img {
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.flex-control-nav li img:hover,
.flex-control-nav li img.flex-active {
    border-color: #333;
}

/* ==========================================================================
   Informations produit
   ========================================================================== */

.single-product div.product .summary {
    float: none !important;
    width: 50% !important;
    flex-grow: 0;
    flex-shrink: 0;
    padding: 0;
    margin: 0 !important;
}

/* Titre du produit */
.product_title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
    color: #1a1a1a;
    font-family: 'Inter', sans-serif;
}

/* Prix */
.single-product div.product p.price,
.single-product div.product span.price {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
}

.single-product div.product p.price del,
.single-product div.product span.price del {
    color: #999;
    font-size: 22px;
    margin-right: 10px;
}

.single-product div.product p.price ins,
.single-product div.product span.price ins {
    text-decoration: none;
    background: none;
}

/* Description courte */
.woocommerce-product-details__short-description {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 25px;
}

.woocommerce-product-details__short-description p {
    margin-bottom: 15px;
}

/* Stock */
.stock {
    display: inline-block;
    padding: 8px 15px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.stock.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

/* ==========================================================================
   Formulaire d'ajout au panier
   ========================================================================== */

.single-product form.cart {
    margin: 30px 0;
    padding: 0;
    border: none;
    display: flex !important;
    gap: 15px;
    align-items: center;
    justify-content: flex-start;
}

/* Container pour quantité avec boutons +/- */
.single-product form.cart .quantity {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.single-product form.cart .quantity .qty {
    width: 50px;
    height: 40px;
    border: none;
    border-top: 1px solid #dedace;
    border-bottom: 1px solid #dedace;
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    color: #000;
    background: transparent;
    -moz-appearance: textfield;
}

.single-product form.cart .quantity .qty::-webkit-outer-spin-button,
.single-product form.cart .quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.single-product form.cart .quantity .qty:focus {
    outline: none;
}

/* Boutons +/- */
.single-product form.cart .quantity .minus,
.single-product form.cart .quantity .plus {
    width: 40px;
    height: 40px;
    font-size: 18px;
    font-weight: 400;
    color: #000;
    background: transparent;
    border: 1px solid #dedace;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.single-product form.cart .quantity .minus {
    border-radius: 5px 0 0 5px;
    border-right: none;
}

.single-product form.cart .quantity .plus {
    border-radius: 0 5px 5px 0;
    border-left: none;
}

.single-product form.cart .quantity .minus:hover,
.single-product form.cart .quantity .plus:hover {
    background: #f5f5f5;
}

/* Variations */
.variations {
    margin-bottom: 20px;
}

.variations td {
    padding: 10px 10px 10px 0;
    vertical-align: middle;
}

.variations label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.variations select {
    width: 100%;
    max-width: 300px;
    height: 45px;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 0 15px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.variations select:focus {
    outline: none;
    border-color: #333;
}

/* ==========================================================================
   Méta-données produit (si réactivées)
   ========================================================================== */

.product_meta {
    padding: 30px 0;
    margin-top: 40px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
}

.product_meta > span {
    display: block;
    margin-bottom: 10px;
    color: #999;
}

.product_meta span span,
.product_meta a {
    color: #666;
    text-decoration: none;
}

.product_meta a:hover {
    color: #333;
    text-decoration: underline;
}

/* ==========================================================================
   Tableau Additional Information
   ========================================================================== */

.woocommerce-product-attributes {
    width: 100%;
    margin-top: 40px;
}

.woocommerce-product-attributes h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.woocommerce-product-attributes table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-product-attributes th,
.woocommerce-product-attributes td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.woocommerce-product-attributes th {
    font-weight: 600;
    color: #666;
    width: 40%;
}

.woocommerce-product-attributes td {
    color: #999;
}

/* ==========================================================================
   Onglets produit (description, avis, etc.)
   ========================================================================== */

.woocommerce-tabs {
    margin-top: 60px;
    clear: both;
}

.woocommerce-tabs ul.tabs {
    display: none; /* Cacher les onglets si pas nécessaire */
}

.woocommerce-tabs .panel {
    padding: 30px 0;
}

.woocommerce-tabs .panel h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

/* ==========================================================================
   Produits similaires / Related Products
   ========================================================================== */

.related.products {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 1px solid #eee;
}

.related.products > h2 {
    font-size: 28px;
    text-align: center;
    margin-bottom: 40px;
}

.related.products ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.related.products ul.products li.product {
    text-align: center;
    transition: transform 0.3s ease;
}

.related.products ul.products li.product:hover {
    transform: translateY(-5px);
}

.related.products ul.products li.product img {
    border-radius: 8px;
    margin-bottom: 15px;
}

.related.products ul.products li.product h2 {
    font-size: 18px;
    margin-bottom: 10px;
}

.related.products ul.products li.product .price {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .single-product div.product {
        flex-direction: column !important;
        gap: 30px;
    }

    .single-product div.product .woocommerce-product-gallery,
    .single-product div.product .summary {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .product_title {
        font-size: 28px;
    }

    .single-product div.product p.price,
    .single-product div.product span.price {
        font-size: 24px;
    }

    /* Formulaire ajout panier mobile */
    .single-product form.cart {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .single-product form.cart .quantity {
        justify-content: center;
    }

    .single-product form.cart .quantity .qty {
        width: 50px;
        height: 40px;
        font-size: 16px;
    }

    .single-product form.cart .quantity .minus,
    .single-product form.cart .quantity .plus {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .single-product form.cart .single_add_to_cart_button {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 13px !important;
    }

    .woocommerce-tabs ul.tabs {
        flex-direction: column;
    }

    .woocommerce-tabs ul.tabs li {
        margin: 0;
    }

    .related.products ul.products {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.single-product div.product {
    animation: fadeIn 0.6s ease-out;
}

/* Message ajouté au panier */
.woocommerce-message {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #4caf50;
}

.woocommerce-message a {
    float: right;
    background: #2e7d32;
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    text-decoration: none;
}

.woocommerce-message a:hover {
    background: #1b5e20;
}