/* ==================================================
   PRODUCT COMPONENTS STYLES
   Styles unifiés pour l'affichage cohérent des produits
   ================================================== */

/* Variables CSS pour cohérence */
:root {
    --product-border-color: #053d69;
    --product-accent-color: #ee3333;
    --product-shadow: 0 6px 24px rgba(0,0,0,0.10);
    --product-hover-shadow: 0 12px 36px rgba(238,51,51,0.18);
    --product-button-bg: #053d69;
    --product-button-hover: #ee3333;
    --product-padding: 1.25rem;
    --product-border-radius: 14px;
}

/* Base Product Box - Style principal unifié */
.product-box {
    background: #fff;
    border-radius: var(--product-border-radius);
    box-shadow: var(--product-shadow);
    border: 1.5px solid var(--product-border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
    position: relative;
}

.product-box:hover {
    box-shadow: var(--product-hover-shadow);
    transform: translateY(-4px) scale(1.01);
    border-color: var(--product-accent-color);
}

/* Product Thumbnail Area */
.product-thumb {
    background: #f8f9fa;
    padding: 18px 0 10px 0;
    text-align: center;
    position: relative;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Product Labels */
.product-label {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--product-accent-color);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    z-index: 2;
}

/* Product Content Area */
.product-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-details {
    flex-grow: 1;
}

/* Product Titles */
.product-title {
    margin-bottom: 0.75rem;
    min-height: 3rem;
}

.product-title a {
    color: var(--product-border-color) !important;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.3;
}

.product-title a:hover {
    text-decoration: underline;
    color: var(--product-accent-color) !important;
}

/* Product Descriptions */
.product-short-description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    min-height: 2.5rem;
    line-height: 1.5;
}

.product-short-description-full,
.product-long-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Product Pricing */
.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--product-accent-color) !important;
    text-align: center;
    margin-bottom: 1rem;
}

.product-price span {
    color: var(--product-accent-color) !important;
}

.product-price del {
    color: #bbb !important;
    font-size: 0.95rem;
    margin-left: 8px;
    text-decoration: line-through;
}

/* Add to Cart Button - Style unifié */
.add-to-cart-btn {
    background: var(--product-button-bg) !important;
    color: #fff !important;
    font-weight: 600;
    border-radius: 7px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    min-width: 160px;
    white-space: nowrap;
}

.add-to-cart-btn:hover {
    background: var(--product-button-hover) !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Product Footer Info */
.product-footer-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: auto;
}

/* Grid View Specific Styles */
.grid-view .product-box {
    margin-bottom: 1.5rem;
}

.grid-view .product-details {
    text-align: center;
    padding-top: 1rem;
}

.grid-view .product-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    min-height: 3rem;
}

.grid-view .product-short-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    min-height: 2.5rem;
}

/* List View Specific Styles */
.list-view .product-item {
    margin-bottom: 1.5rem;
}

.list-view .product-box {
    display: flex;
    flex-direction: row !important;
    align-items: stretch;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    background: white;
    transition: all 0.3s ease;
    min-height: 200px;
}

.list-view .product-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-color: var(--product-accent-color);
}

.list-view .product-thumb {
    flex: 0 0 180px;
    height: 180px;
    margin-right: 2rem;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-view .product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.list-view .product-details {
    flex: 1;
    text-align: left;
    padding-top: 0;
}

.list-view .product-title {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.list-view .product-short-description-full,
.list-view .product-long-description {
    display: block !important;
    margin-bottom: 1rem;
    color: #666;
    line-height: 1.6;
}

.list-view .product-footer-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.list-view .product-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--product-accent-color);
}

.list-view .add-to-cart-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
}

/* Quick Actions Overlay */
.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumb:hover .product-overlay {
    opacity: 1;
}

.quick-action-btn {
    background: var(--product-accent-color);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.quick-action-btn:hover {
    transform: scale(1.1);
    background: color-mix(in srgb, var(--product-accent-color), black 20%);
}

.quick-action-btn i {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-box {
        margin-bottom: 1rem;
    }
    
    .product-thumb {
        height: 200px;
        padding: 12px 0;
    }
    
    .product-content {
        padding: 0.75rem;
    }
    
    .add-to-cart-btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
        min-width: 140px;
    }
    
    /* List view mobile */
    .list-view .product-box {
        flex-direction: column !important;
    }
    
    .list-view .product-thumb {
        flex: 0 0 auto;
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: 1.5rem;
    }
    
    .list-view .product-footer-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .list-view .product-price {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .product-title a {
        font-size: 1rem;
    }
    
    .product-short-description {
        font-size: 0.9rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    .add-to-cart-btn {
        width: 100%;
        min-width: auto;
    }
}

/* Container Grid System */
.product-grid-container .row {
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.product-grid-container .col-md-6,
.product-grid-container .col-lg-4,
.product-grid-container .col-sm-12 {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

.product-grid-container .product-box {
    margin-bottom: 1.5rem;
}

/* Compatibility with existing IDs */
#category-product-list .row,
#products-container .row {
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

#category-product-list .col-md-6,
#category-product-list .col-lg-4,
#products-container .col-md-6,
#products-container .col-lg-4 {
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

#category-product-list .product-box,
#products-container .product-box {
    margin-bottom: 1.5rem;
}