/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #ffffff;
    color: #333333;
    line-height: 1.4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    height: 48px;
    background: linear-gradient(to bottom, #e59328, #e58028);
    border-bottom: 1px solid #eb9932;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    height: 34px;
    width: auto;
    margin-top: 8px;
}

/* Navigation */
.navbar {
    height: 48px;
    background: linear-gradient(to bottom, #000000, #363636);
    border-bottom: 1px solid #000000;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Recherche */
.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input {
    height: 30px;
    padding: 0 12px;
    border: none;
    border-radius: 15px;
    background: #ffffff;
    color: #333333;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    width: 250px;
}

.search-input::placeholder {
    color: #8a8a8a;
}

.search-btn {
    height: 30px;
    width: 30px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(to bottom, #e59328, #e58028);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn img {
    width: 21px;
    height: 21px;
}

/* Menu catégories */
.categories-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
}

.categories-label {
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 400;
}

.categories-icon {
    width: 22px;
    height: 22px;
}

.categories-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #ffffff;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    display: none;
    z-index: 1001;
    max-height: 300px;
    overflow-y: auto;
}

.categories-dropdown.show {
    display: block;
}

.categories-dropdown a {
    display: block;
    padding: 12px 16px;
    color: #333333;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
}

.categories-dropdown a:hover {
    background-color: #ffdeba;
}

.categories-dropdown a:last-child {
    border-bottom: none;
}

/* Contenu principal */
.main-content {
    padding: 15px 0;
}

.page-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #333333;
    text-align: center;
    margin-bottom: 30px;
}

.page-title .highlight {
    color: #e58028;
}

/* Message aucun produit trouvé */
.no-products-message {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #e58028;
}

.no-products-message p {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    color: #555;
    margin-bottom: 10px;
}

.no-products-message p:last-child {
    margin-bottom: 0;
    font-weight: 500;
    color: #e58028;
}

/* Grille produits */
.products-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    margin-bottom: 40px;
}

.product-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.product-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.13);
}

.product-image-container {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.product-image-container a {
    display: block;
    width: 100%;
    height: 100%;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
    transition: opacity 0.3s ease;
}

.product-price {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #1b8b00;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 50px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 14px;
}

.product-title-link {
    text-decoration: none;
    color: inherit;
}

.product-title-link:hover .product-title {
    color: #e58028;
}

.product-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #333333;
    padding: 10px 10px 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.product-description {
    padding: 0 10px 10px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #757575;
    line-height: 1.4;
    position: relative;
}

.description-text {
    display: block;
}

.description-more {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    margin-left: 3px;
    transition: transform 0.2s ease;
    vertical-align: baseline;
    display: inline;
}

.description-more img {
    width: 15px;
    height: 15px;
    vertical-align: middle;
}

.description-full {
    margin-top: 0;
}

.product-actions {
    padding: 0 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Boutons */
.btn-primary {
    display: block;
    text-align: center;
    height: 31px;
    line-height: 31px;
    background: linear-gradient(to bottom, #e59328, #e58028);
    border-top: 1px solid #e58028;
    color: #ffffff;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-weight: 900;
    font-size: 18px;
    border-radius: 6px;
    text-shadow: 1px 1px 2px #e58028;
    transition: transform 0.1s ease;
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 31px;
    background: linear-gradient(to bottom, #515151, #000000);
    border: none;
    border-top: 1px solid #000000;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    text-shadow: 1px 1px 2px #000000;
    transition: transform 0.1s ease;
}

.btn-secondary img {
    width: 13px;
    height: 13px;
}

/* Message promotionnel */
.promo-message {
    grid-column: 1 / -1;
    background: #ffffff;
    border: 2px solid #e3e3e3;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
}

.promo-line1 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 21px;
    color: #e58028;
    margin-bottom: 10px;
}

.promo-line2 a {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 18px;
    color: #258e00;
    text-decoration: none;
}

.promo-line2 a:hover {
    text-decoration: underline;
}

/* Popup vidéo */
.video-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2001;
}

.popup-close img {
    width: 14px;
    height: 14px;
}

.popup-body {
    padding: 20px;
}

.popup-video {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    margin-bottom: 15px;
}

.popup-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #333333;
    margin-bottom: 15px;
}

.popup-price-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.popup-price {
    background: #1b8b00;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 50px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 16px;
}

.popup-btn {
    margin: 0 !important;
    width: auto !important;
    padding: 0 20px !important;
    flex-shrink: 0;
}

.popup-description {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #757575;
    line-height: 1.5;
}

/* Loading */
.loading {
    text-align: center;
    padding: 20px;
    font-family: 'Roboto', sans-serif;
    color: #8a8a8a;
}

/* Lazy loading - CORRECTION IMPORTANTE */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy.loaded {
    opacity: 1;
}

/* Force l'affichage des images déjà chargées */
.product-image:not(.lazy) {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .product-card {
        border-radius: 8px;
    }
    
    .product-image {
        border-radius: 8px 8px 0 0;
    }
    
    .search-input {
        width: 180px;
        font-size: 14px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .promo-message {
        padding: 20px;
    }
    
    .promo-line1 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .promo-line2 a {
        font-size: 16px;
    }
    
    .popup-content {
        width: 95%;
        max-width: none;
    }

    .popup-price-action {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .popup-btn {
        width: 100% !important;
        text-align: center;
    }

    .no-products-message {
        padding: 15px;
        margin-bottom: 20px;
    }

    .no-products-message p {
        font-size: 14px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 25px;
    }
}

@media (min-width: 1025px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
    
    .categories-dropdown {
        column-count: 3;
        column-gap: 0;
        min-width: 400px;
    }
    
    .categories-dropdown a {
        break-inside: avoid;
    }
}