* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff8c00;
    --secondary-color: #000000;
    --text-color: #333;
    --bg-color: #f5f5f5;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header / Navigation */
header {
    background-color: var(--secondary-color);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
    transition: transform 0.3s;
}

.logo img:hover {
    transform: scale(1.05);
}

.logo-text {
    color: var(--white);
}

.logo-highlight {
    color: var(--primary-color);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

nav a:hover {
    color: var(--primary-color);
}

.btn-login {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.6rem 1.5rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-login:hover {
    background-color: #ff9d1a;
    transform: translateY(-2px);
}

/* Container principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* Section Meilleures Ventes */
.featured-section {
    background-color: var(--white);
    padding: 3rem;
    margin: 2rem 0;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.section-title {
    text-align: center;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 700;
}

.carousel {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
}

.carousel-container {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
    padding: 2rem;
    text-align: center;
}

.carousel-item img {
    max-width: 100%;
    height: 300px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.carousel-item p {
    color: var(--text-color);
    font-style: italic;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
}

.carousel-btn {
    background-color: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    transition: background-color 0.3s;
    font-size: 1.2rem;
}

.carousel-btn:hover {
    background-color: var(--primary-color);
}

/* Section Produits */
.products-section {
    margin: 3rem 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    background-color: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    margin-bottom: 1rem;
    border-radius: 5px;
}

.product-name {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    min-height: 2.5rem;
}

.product-stock {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.stock-available {
    color: #28a745;
}

.stock-low {
    color: #ffc107;
}

.stock-unavailable {
    color: #dc3545;
}

/* Filtres */
.filters {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-color);
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.btn-filter {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    align-self: flex-end;
}

.btn-filter:hover {
    background-color: #ff9d1a;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: var(--white);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .filters {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .btn-filter {
        width: 100%;
    }
}

/* Page de connexion */
.login-container {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.login-container h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.btn-submit {
    width: 100%;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-submit:hover {
    background-color: #ff9d1a;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

/* Modale produit */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
    position: relative;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #aaa;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: color 0.3s;
    background-color: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--primary-color);
    background-color: var(--white);
}

.modal-body {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 2rem;
}

.modal-body img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 10px;
    background-color: #f5f5f5;
}

.modal-product-info {
    text-align: center;
}

.modal-product-info h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.modal-product-info p {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: left;
    white-space: pre-wrap;
}

/* Responsive pour la modale */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-body img {
        max-height: 300px;
    }

    .modal-product-info h2 {
        font-size: 1.5rem;
    }

    .modal-product-info p {
        font-size: 1rem;
    }

    .modal-close {
        right: 10px;
        top: 10px;
        font-size: 2rem;
        width: 35px;
        height: 35px;
    }
}

