/* Reset universel */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    font-size: 1rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #fff;
    border-bottom: 2px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

header img {
    height: 3.125rem;
}

.search-form input[type="search"] {
    padding: 0.4375rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    font-size: 1rem;
}

.search-form input[type="search"]:focus {
    border-color: #e85d04;
    outline: 3px solid #e85d04;
    outline-offset: 2px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.25rem;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav a.active {
    color: #e85d04;
    outline: 3px solid #e85d04;
    outline-offset: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.9375rem;
}

.account-link {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

.account-link:hover,
.account-link:focus {
    color: #e85d04;
    outline: 3px solid #e85d04;
    outline-offset: 2px;
}

.cart-link {
    font-size: 1.5rem;
    color: #333;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.cart-link:hover,
.cart-link:focus {
    color: #e85d04;
    outline: 3px solid #e85d04;
    outline-offset: 2px;
}

.hamburger {
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    display: none;
    color: #333;
}

.product-description {
    display: flex;
    gap: 2rem;
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 1.25rem;
    align-items: flex-start;
}

.product-gallery {
    display: flex;
    flex: 1 1 55%;
    gap: 1rem;
    align-items: flex-start;
}

.thumbnails {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 0 0 100px;
}

.thumbnails img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 0.375rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s ease, border 0.2s ease;
}

.thumbnails img:hover,
.thumbnails img:focus {
    transform: scale(1.05);
    border: 2px solid #e85d04;
}

.thumbnails img.active {
    border: 2px solid #e85d04;
    transform: scale(1.05);
}

.main-img {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-img img {
    width: 100%;
    height: auto;
    max-height: 500px;
    border-radius: 0.5rem;
    object-fit: contain;
    box-shadow: 0 0.25rem 0.625rem rgba(0, 0, 0, 0.1);
    opacity: 1;
    transition: opacity 0.4s ease-in-out;
}

.main-img img.fade {
    opacity: 0;
}

.product-details {
    flex: 1 1 45%;
}

.product-details h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #222;
}

.product-details p {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: #444;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e85d04;
    margin: 1rem 0;
}

.quantity-container {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-container select {
    padding: 0.4rem;
    font-size: 1rem;
    border-radius: 0.375rem;
    border: 1px solid #ccc;
}

.add-to-cart {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #e85d04;
    color: #fff;
    font-weight: bold;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.add-to-cart:hover,
.add-to-cart:focus {
    background-color: #d9480f;
    transform: translateY(-0.125rem);
    outline: 3px solid #e85d04;
    outline-offset: 2px;
}

footer {
    background: #222;
    color: #ddd;
    padding: 2.5rem 1.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5625rem;
    text-align: left;
}

footer h4 {
    margin-bottom: 0.625rem;
    color: #fff;
}

footer ul {
    list-style: none;
}

footer ul li {
    margin: 0.3125rem 0;
}

footer a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover,
footer a:focus {
    color: #e85d04;
    outline: 3px solid #e85d04;
    outline-offset: 2px;
}

footer p {
    font-size: 0.9375rem;
    margin-top: 0.3125rem;
}

.social-icons {
    list-style: none;
    display: flex;
    gap: 1rem;
    padding: 0;
    margin-top: 0.5rem;
}

.social-icons li a {
    font-size: 1.5rem;
    color: #ddd;
    transition: color 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-icons li a:hover,
.social-icons li a:focus {
    color: #e85d04;
    transform: scale(1.1);
    outline: none;
}

.back-button {
    display: inline-block;
    margin: 1rem 2rem;
    padding: 0.6rem 1.2rem;
    border: 2px solid #e85d04;
    color: #e85d04;
    font-weight: bold;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease, color 0.3s ease;
}

.back-button i {
    margin-right: 0.5rem;
}

.back-button:hover,
.back-button:focus {
    background-color: #e85d04;
    color: #fff;
    transform: translateY(-0.125rem);
    outline: 3px solid #e85d04;
    outline-offset: 2px;
}

/* ============================= */
/* RESPONSIVE ================== */
/* ============================= */

@media (max-width: 768px) {
    .main-nav {
        display: none;
        flex-direction: column;
        background: #fff;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        padding: 1.25rem;
        border-top: 2px solid #eee;
    }

    .main-nav.open {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .product-description {
        flex-direction: column;
    }

    /* ✅ Correction pour garder les miniatures à gauche */
    .product-gallery {
        flex-direction: row;
        align-items: flex-start;
    }

    .thumbnails {
        flex-direction: column;
        justify-content: flex-start;
        flex: 0 0 80px;
    }

    .main-img img {
        max-height: 300px;
    }
}

/* Pas de scroll horizontal */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Téléphones très petits (moins de 480px) */
@media (max-width: 480px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
    }

    .header-right {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: space-between;
    }

    .product-details h1 {
        font-size: 1.5rem;
    }

    .product-details p {
        font-size: 0.9rem;
    }

    .add-to-cart {
        width: 100%;
        text-align: center;
    }
}

/* Tablettes */
@media (max-width: 1024px) {
    .product-description {
        flex-direction: column;
        align-items: center;
    }

    .product-gallery,
    .product-details {
        width: 100%;
        max-width: 600px;
    }

    .main-img img {
        max-height: 400px;
    }
}

/* Très grands écrans */
@media (min-width: 1440px) {
    body {
        font-size: 1.125rem;
    }

    .product-description {
        max-width: 1400px;
    }

    .main-img img {
        max-height: 650px;
    }
}