/* WooCommerce Specific Styles */
body.woocommerce {
    background-color: #F4F4F4;
}

/* Breadcrumb */
.woocommerce-breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
    padding: 15px 0;
    text-align: left;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

.woocommerce-breadcrumb li {
    display: inline-flex;
    align-items: center;
    color: black;
}

.woocommerce-breadcrumb li:not(:last-child)::after {
    content: ">";
    color: #666;
    padding: 0 10px;
}

.woocommerce-breadcrumb a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Shop Categories Grid */
.woocommerce-shop-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 40px 0;
}

.category-item {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.category-item:hover {
    transform: translateY(-5px);
}

.category-image {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.category-item:hover .category-image img {
    transform: scale(1.05);
}

.category-title {
    position: absolute;
    inset: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    color: #000000;
    font-size: 1.2rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
    pointer-events: none;
    margin: 0;
}

.category-item:hover .category-title {
    opacity: 1;
}

/* Products Grid */
.woocommerce-products-grid {
    margin: 40px 0;
}

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

.product {
    text-align: center;
    border-radius: 8px;
    padding: 0;
}

/* Product Image Container with Overlay */
.product .woocommerce-LoopProduct-link {
    position: relative;
    display: block;
    overflow: hidden;
    margin-bottom: 15px;
}

.product img {
    border-radius: 4px;
    display: block;
    width: 100%;
    height: auto;
}

/* Overlay Effect on Product Images */
.product .woocommerce-LoopProduct-link::after {
    content: 'Découvrir';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    color: #000000;
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

.product .woocommerce-LoopProduct-link:hover::after {
    opacity: 1;
}

/* Product Info Section */
.product .woocommerce-loop-product__title {
    font-size: 18px;
    margin: 0;
    font-weight: 600;
    text-align: center;
    padding: 0 5px;
}

.product .price {
    font-size: 18px;
    font-weight: 200;
    color: black;
    margin: 0;
    text-align: left;
}

/* Product Name + Price Row */

.product > * {
    grid-column: 1 / -1;
}

ul.products .product {
    display: grid;
    position: relative;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: baseline;
}

ul.products .product .woocommerce-LoopProduct-link {
    grid-column: 1 / -1;
}

.price del {
    opacity: 0.5;
    margin-right: 8px;
}

.price ins {
    text-decoration: none;
    color: #e74c3c;
}

.product-meta {
    border-left: 1px solid black;
    padding-left: 20px;
}

/* Add to Cart Buttons */
.button,
.add_to_cart_button,
.single_add_to_cart_button,
.wc-block-cart__submit-button,
.wc-block-components-button {
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.button:hover,
.add_to_cart_button:hover,
.single_add_to_cart_button:hover,
.wc-block-cart__submit-button:hover,
.wc-block-components-button:hover {
    background: #000;
    opacity: 1;
}

.wc-block-components-button__text {
    color: #fff;
}

/* Single Product Page */
.single-product-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 66% 33%;
    grid-template-rows: auto auto auto;
    gap: 40px;
}

/* Breadcrumb - Full Width */
.single-product-wrapper .woocommerce-breadcrumb {
    grid-column: 1 / -1;
}

/* Product Main Section - 33/66 Split */
.product-gallery-section,
.woocommerce div.product div.images {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 0;
}

.woocommerce-product-gallery {
    max-width: 100%;
    margin: 0;
}

/* Hide zoom icon */
.woocommerce-product-gallery__trigger {
    display: none !important;
}

/* Product Gallery - Main Image and Thumbnails */
.woocommerce-product-gallery__wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Main Product Image */
.product-main-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f8f8;
    cursor: zoom-in;
}

.product-main-image .woocommerce-product-gallery__image {
    margin: 0;
    display: block;
}

.product-main-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.product-main-image:hover img {
    transform: scale(1.05);
}

/* Product Thumbnails */
.product-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.product-thumbnail {
    flex: 0 0 calc(20% - 8px);
    max-width: calc(20% - 8px);
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #f8f8f8;
}

.product-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

.product-thumbnail:hover {
    border-color: #666;
}

.product-thumbnail.active {
    border-color: #000;
}

.product-thumbnail:hover img {
    opacity: 0.8;
}

/* Make product image clickable for lightbox */
.woocommerce-product-gallery__image a {
    cursor: zoom-in;
    display: block;
}

/* Lightbox mode for main image */
.product-main-image.zoomed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.product-main-image.zoomed img {
    max-width: 90%;
    max-height: 90vh;
    width: auto;
    height: auto;
    transform: none;
}

.product-summary-section,
.woocommerce div.product div.summary {
    grid-column: 2;
    grid-row: 2;
    margin-bottom: 0;
    text-align: left;
}
.woocommerce div.product div.summary .stock {
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.woocommerce div.product div.summary .stock.in-stock::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}

.woocommerce div.product div.summary .stock.out-of-stock::before {
    content: "✕";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
}

.product_title {
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 20px;
}

/* Product Description within Summary */
.woocommerce div.product .woocommerce-product-details__short-description {
    margin: 20px 0;
    line-height: 1.6;
    font-size: 12px;
}

/* Move tabs/description under the summary if needed */
.product-details-section {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 0;
}

.woocommerce-tabs {
    border-top: 1px solid #e0e0e0;
    padding-top: 40px;
}

.wc-tabs {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    display: flex;
    gap: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.wc-tabs li {
    margin: 0;
}

.wc-tabs li a {
    display: block;
    padding: 10px 20px;
    border-bottom: 2px solid transparent;
}

.wc-tabs li.active a {
    border-bottom-color: #333;
    font-weight: 600;
}

/* Related Products */
.related-products-section,
.woocommerce .related.products {
    grid-column: 1 / -1;
    grid-row: 4;
    clear: both;
    width: 100%;
    margin: 0;
}

.related.products h2,
.woocommerce .related.products > h2 {
    font-size: 24px;
    margin-bottom: 30px;
}
.related.products>h2 {
    text-align: left;
}

/* Related Products - use same card layout as catalog */
.related.products ul.products {
    margin: 0;
}

/* Quantity Input with +/- buttons */
.quantity {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 10px;
}

.quantity input[type="number"] {
    width: 60px;
    height: 40px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    -moz-appearance: textfield;
}

.quantity input[type="number"]::-webkit-outer-spin-button,
.quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity .qty-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    background: black;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity .qty-btn:hover {
    background: #000;
}

/* Cart Actions */
.cart {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

/* Product Meta */
.product_meta {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
}

.product_meta > span {
    display: block;
    margin: 5px 0;
}

/* Pagination */
.woocommerce-pagination {
    margin: 40px 0;
    text-align: center;
}

.woocommerce-pagination ul {
    list-style: none;
    padding: 0;
    display: inline-flex;
    gap: 10px;
}

.woocommerce-pagination li {
    margin: 0;
}

.woocommerce-pagination a,
.woocommerce-pagination span {
    display: block;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.woocommerce-pagination .current {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Messages */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
    border-left: 4px solid;
}

.woocommerce-message {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.woocommerce-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.woocommerce-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Responsive */
@media (max-width: 768px) {
    ul.products {
        grid-template-columns: 1fr;
    }
    
    .woocommerce-shop-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    /* Stack product layout on mobile */
    .single-product-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .product-gallery-section,
    .woocommerce div.product div.images {
        grid-column: 1;
        grid-row: 2;
    }
    
    .product-summary-section,
    .woocommerce div.product div.summary {
        grid-column: 1;
        grid-row: 3;
    }
    
    .product-details-section {
        grid-row: 4;
    }
    
    .related-products-section {
        grid-row: 5;
    }

    /* Thumbnails on mobile - 4 per row */
    .product-thumbnail {
        flex: 0 0 calc(25% - 8px);
        max-width: calc(25% - 8px);
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .woocommerce-shop-categories {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Thumbnails on tablet - 5 per row */
    .product-thumbnail {
        flex: 0 0 calc(20% - 8px);
        max-width: calc(20% - 8px);
    }
}
