/**
 * ED Products Tabs - Styles
 * Structure: Gauche (sections) + Droite (grille produits natif PrestaShop)
 * 
 * @author    Energiedin
 * @copyright 2024 Energiedin
 */

/* ============================================
   SECTION PRINCIPALE
   ============================================ */
.ed-popular-section {
    margin: 40px 0 60px;
}

/* Header : Titre + Lien */
.ed-popular-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.ed-popular-title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.ed-popular-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #f39c12;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ed-popular-link:hover {
    color: #e67e22;
}

.ed-popular-link svg {
    transition: transform 0.2s ease;
}

.ed-popular-link:hover svg {
    transform: translateX(4px);
}

/* ============================================
   CONTAINER PRINCIPAL (FLEXBOX)
   ============================================ */
.ed-popular-container {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

/* ============================================
   SIDEBAR GAUCHE (SECTIONS)
   ============================================ */
.ed-sidebar {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.ed-section {
    border-bottom: 1px solid #e5e5e5;
}

.ed-section:last-child {
    border-bottom: none;
}

/* Header section */
.ed-section-header {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    padding: 10px 15px;
}

.ed-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Liste produits sidebar */
.ed-products-list {
    list-style: none;
    margin: 0;
    padding: 8px 12px;
}

.ed-product-item {
    border-bottom: 1px solid #f5f5f5;
}

.ed-product-item:last-child {
    border-bottom: none;
}

.ed-product-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    text-decoration: none;
    transition: background 0.2s ease;
    border-bottom: 1px solid #E7E7E7;
}

.ed-product-item:last-child .ed-product-link {
    border-bottom: 0;
}

.ed-product-image {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 4px;
    overflow: hidden;
    background: #f9f9f9;
}

.ed-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ed-product-info {
    flex: 1;
    min-width: 0;
}

.ed-product-name {
    font-size: 13px;
    font-weight: 400;
    color: #4B4B4B;
    margin: 0 0 4px 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ed-product-link:hover .ed-product-name {
    color: #f39c12;
}

.ed-product-price {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ed-price-current {
    font-size: 14px;
    font-weight: 500;
    color: #0462C7;
}

.ed-price-regular {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
}

/* Lien voir tous */
.ed-section-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    background: #fafafa;
    color: #f39c12;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    border-top: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.ed-section-link:hover {
    background: #f39c12;
    color: #fff;
}

/* ============================================
   GRILLE DROITE (PRODUITS POPULAIRES - TEMPLATE NATIF)
   ============================================ */
.ed-popular-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Ajustements pour le template natif PrestaShop */
.ed-popular-grid .product-miniature {
    margin: 0;
}

.ed-popular-grid .thumbnail-container {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.ed-popular-grid .thumbnail-container:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1399px) {
    .ed-popular-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1199px) {
    .ed-sidebar {
        width: 250px;
        min-width: 250px;
    }
    
    .ed-popular-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 991px) {
    .ed-popular-container {
        flex-direction: column;
    }
    
    .ed-sidebar {
        width: 100%;
        min-width: 100%;
        display: flex;
        flex-wrap: wrap;
    }
    
    .ed-section {
        flex: 1 1 48%;
        min-width: 280px;
        border-right: 1px solid #e5e5e5;
    }
    
    .ed-section:nth-child(2n) {
        border-right: none;
    }
    
    .ed-popular-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 767px) {
    .ed-popular-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ed-section {
        flex: 1 1 100%;
        border-right: none;
    }
    
    .ed-popular-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 575px) {
    .ed-popular-section {
        margin: 20px 0;
    }
    
    .ed-popular-title {
        font-size: 18px;
    }
    
    .ed-popular-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}
