/* --- VARIABLES --- */
:root {
    --sage: #5d6d5a;
    --gold: #d4a373;
    --white: #ffffff;
    --bg: #fdfcfb;
    --gray-light: #f9f9f9;
}

/* --- STRUCTURE GLOBALE --- */
html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg);
    color: #333;
    line-height: 1.6;
}

/* --- NAVIGATION --- */
.main-nav {
    background: var(--white);
    padding: 25px 0;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    text-decoration: none;
    color: var(--sage);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 35px;
    margin: 0;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #666;
    font-size: 0.75rem;
    letter-spacing: 2px;
    transition: 0.3s;
    text-transform: uppercase;
}

.nav-links a:hover { color: var(--gold); }

/* --- GRILLE DE PRODUITS (INDEX.PHP) --- */
.container {
    max-width: 1100px;
    margin: 60px auto;
    padding: 0 20px;
    flex: 1 0 auto; /* Pousse le footer vers le bas */
}

.shop-header {
    text-align: center;
    margin-bottom: 60px;
}

.shop-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--sage);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
}

/* Amélioration visuelle des cartes articles */
.product-card {
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03); /* Légère ombre pour détacher l'article */
    border: 1px solid #f0f0f0;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.1);
}

/* --- RÉAJUSTEMENT PAGE PRODUIT (PRODUIT.PHP) --- */

/* --- AJUSTEMENT IMAGE PRINCIPALE (PRODUIT.PHP) --- */

.product-view-image {
    width: 100%;
    aspect-ratio: 1 / 1; /* On garde le format carré pour la cohérence */
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    border: 1px solid #f0f0f0;
    overflow: hidden;
    margin-bottom: 20px;
}

.product-view-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; /* L'image s'ajuste sans être coupée ni déformée */
}

/* --- AJUSTEMENT DES VIGNETTES --- */

.product-thumbnails {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.product-thumbnails img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover; /* Pour les vignettes, le cover est mieux car il remplit bien les petits carrés */
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.3s;
}

.product-thumbnails img:hover {
    border-color: var(--sage);
}

/* --- AJUSTEMENT DES IMAGES DANS LA GRILLE --- */

.product-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1; /* Force le cadre carré pour l'alignement des boutons */
    overflow: hidden;
    background-color: #ffffff; /* Fond blanc pour boucher les trous si l'image est étroite */
    display: flex;
    align-items: center; /* Centre l'image verticalement */
    justify-content: center; /* Centre l'image horizontalement */
    border-radius: 12px;
    border: 1px solid #f0f0f0;
}

.product-image-wrapper img {
    /* Ce combo permet à l'image de s'adapter au plus grand côté sans jamais dépasser */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain; 
    transition: transform 0.5s ease;
}

/* Effet de zoom propre au survol */
.product-card:hover .product-image-wrapper img {
    transform: scale(1.08);
}

.product-info h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--sage);
    margin: 5px 0 10px 0;
    line-height: 1.2;
    font-weight: 700;
}

.price {
    font-size: 1.2rem;
    color: var(--gold);
    font-weight: bold;
    margin-bottom: 15px;
}
/* --- BOUTONS --- */
.btn-cart {
    background: var(--sage);
    color: white;
    padding: 15px 25px;
    border: none;
    width: 100%;
    font-weight: 600;
    letter-spacing: 1px;
    transition: 0.3s;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-top: auto; /* Aligne les boutons en bas */
}

.btn-cart:hover {
    background: var(--gold);
    transform: translateY(-2px);
}

/* --- PANIER LATÉRAL (OVERLAY) --- */
.cart-overlay {
    position: fixed;
    right: -400px;
    top: 0;
    width: 350px;
    height: 100%;
    background: white;
    z-index: 2000;
    transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
}

.cart-overlay.open { right: 0; }

#cart-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: none;
    z-index: 1999;
}

.cart-content { display: flex; flex-direction: column; height: 100%; }

.cart-header {
    padding: 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 { font-family: 'Playfair Display'; margin: 0; color: var(--sage); }

.close-cart {
    font-size: 2.5rem;
    line-height: 1;
    color: var(--sage);
    transition: transform 0.3s;
}

.close-cart:hover {
    transform: rotate(90deg);
    color: var(--gold);
}

#cart-items-container { flex-grow: 1; overflow-y: auto; padding: 20px; }

.cart-footer { padding: 25px; border-top: 1px solid #eee; background: var(--bg); }

.cart-total { display: flex; justify-content: space-between; font-weight: bold; margin-bottom: 20px; font-size: 1.2rem; }

.btn-view-cart, .btn-checkout {
    display: block;
    width: 100%;
    text-align: center;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.btn-view-cart { border: 1px solid #333; color: #333; }
.btn-checkout { background: var(--sage); color: white; border: none; }
.btn-checkout:hover { background: var(--gold); }

/* --- AUTHENTIFICATION --- */
.auth-container {
    max-width: 450px;
    margin: 80px auto;
    padding: 50px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.05);
    text-align: center;
    flex: 1 0 auto;
}

.auth-container h2 { font-family: 'Playfair Display'; color: var(--sage); margin-bottom: 30px; }

.form-group { margin-bottom: 25px; text-align: left; }

.form-group label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--sage);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 1px solid #eee;
    background: #fafafa;
    box-sizing: border-box;
}

.btn-auth {
    width: 100%;
    background: var(--sage);
    color: white;
    border: none;
    padding: 18px;
    letter-spacing: 2px;
    font-weight: 600;
    cursor: pointer;
}

.btn-auth:hover { background: var(--gold); }

/* --- FOOTER --- */
footer {
    flex-shrink: 0;
    background: #fff;
    padding: 40px 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.footer-content p { font-size: 0.85rem; color: #888; margin-bottom: 10px; }

.admin-access-link { font-size: 0.75rem; color: #ccc; text-decoration: none; }
.admin-access-link:hover { color: var(--gold); }

/* --- PAGE CONTACT --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    margin-bottom: 80px;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.info-item {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #eee;
    transition: 0.3s;
}

.info-item:hover {
    border-color: var(--gold);
    transform: translateY(-5px);
}

.info-item i {
    font-size: 1.5rem;
    color: var(--sage);
    margin-bottom: 15px;
}

.info-item h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.info-item p, .info-item a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

/* Ajustement pour mobile */
@media (max-width: 768px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}