/* ==========================================================================
   MAISON ÉCLAT - STYLE COMPLET (DÉMO PME SANDSY)
   Emplacement : /projects/projet-demo-pme/assets/css/style.css
   ========================================================================== */

/* 1. VARIABLES & RESET */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    --bg-cream: #F9F8F6;
    --text-dark: #2C302E;
    --accent-sage: #6C7A63;
    --accent-terra: #C87961;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-cream);
    color: var(--text-dark);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 400;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* 2. BANNIÈRE PROMO & BOUTONS */
.promo-banner {
    background-color: var(--accent-terra);
    color: #ffffff;
    text-align: center;
    padding: 10px 20px;
    font-size: 0.9rem;
    letter-spacing: 1px;
    font-weight: 300;
}

.btn {
    display: inline-block;
    padding: 10px 22px;
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-radius: 2px;
    cursor: pointer;
    border: 1px solid transparent;
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-sage);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: #55614f;
}

.btn-outline {
    border: 1px solid var(--text-dark);
    color: var(--text-dark);
    background: transparent;
}
.btn-outline:hover {
    background-color: var(--text-dark);
    color: #ffffff;
}

/* 3. HEADER, RECHERCHE & NAVIGATION */
.deco-header {
    background: rgba(249, 248, 246, 0.95);
    padding: 20px 0;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
    border-bottom: 1px solid #eaeaea;
    backdrop-filter: blur(10px);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.brand {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-style: italic;
    color: var(--text-dark);
}
.brand span {
    color: var(--accent-terra);
}

.search-bar input {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid #ccc;
    background: #ffffff;
    font-family: var(--font-body);
    width: 220px;
    outline: none;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}
.search-bar input:focus {
    border-color: var(--accent-terra);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}
.nav-links a:not(.btn) {
    font-size: 0.9rem;
    font-weight: 400;
}
.nav-links a:not(.btn):hover {
    color: var(--accent-terra);
}

/* Dropdown Mon Compte */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #ffffff;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    padding: 15px;
    border-radius: 4px;
    z-index: 101;
}
.dropdown:hover .dropdown-content {
    display: block;
}
.user-email {
    font-size: 0.85rem;
    color: #666666;
    margin-bottom: 10px;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 10px;
    word-break: break-all;
}
.btn-text {
    background: none;
    border: none;
    color: var(--accent-terra);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    text-decoration: underline;
    padding: 0;
}

/* 4. HERO SECTION */
.hero-section {
    height: 75vh;
    min-height: 480px;
    display: flex;
    align-items: center;
    background-image: linear-gradient(rgba(249, 248, 246, 0.75), rgba(249, 248, 246, 0.9)), url('https://images.unsplash.com/photo-1618220179428-22790b46a015?auto=format&fit=crop&w=1600&q=80');
    background-size: cover;
    background-position: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.15;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.hero-content p {
    font-size: 1.15rem;
    margin-bottom: 30px;
    color: #4a4a4a;
}

/* 5. GALERIE & FILTRES DYNAMIQUES */
.gallery-section {
    padding: 80px 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}
.section-title h2 {
    font-size: 2.2rem;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}
.filter-btn {
    background: transparent;
    border: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: #888888;
    cursor: pointer;
    padding: 5px 10px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}
.filter-btn:hover, .filter-btn.active {
    color: var(--accent-terra);
    border-bottom: 2px solid var(--accent-terra);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.gallery-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 4/5;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.gallery-item:hover .item-overlay {
    opacity: 1;
}

.item-overlay span {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-style: italic;
}

.quick-view {
    margin-top: 8px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--bg-cream);
    text-decoration: underline;
}

/* 6. FENÊTRES MODALES & PANIER / FAVORIS */
.modal {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-cream);
    width: 90%;
    max-width: 850px;
    border-radius: 6px;
    position: relative;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.close-modal {
    position: absolute;
    top: 15px; 
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #888888;
    line-height: 1;
}
.close-modal:hover { 
    color: #111111; 
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

.modal-img img { 
    width: 100%; 
    height: 380px; 
    object-fit: cover; 
    border-radius: 4px; 
}

.modal-info h2 { 
    font-size: 1.8rem; 
    margin-bottom: 10px; 
}

.m-price { 
    font-size: 1.4rem; 
    color: var(--accent-terra); 
    margin-bottom: 15px; 
    font-family: var(--font-heading); 
}

.m-specs { 
    background: #ffffff; 
    padding: 15px; 
    margin: 20px 0; 
    border-left: 3px solid var(--accent-sage); 
    font-size: 0.85rem; 
}

.m-actions { 
    display: flex; 
    gap: 12px; 
    margin-top: 25px; 
}

/* Listes Panier et Favoris */
.list-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border-top: 1px solid #eeeeee;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eeeeee;
}

.list-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}

.list-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.list-item-info strong {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-dark);
}

.btn-remove {
    background: none;
    border: none;
    color: #991b1b;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
    font-family: var(--font-body);
}

/* Résumé du Panier */
.cart-summary {
    background-color: #fcfcfc;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #eeeeee;
}

.promo-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.promo-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 2px;
    font-family: var(--font-body);
}

.totals {
    text-align: right;
    font-size: 1.1rem;
}

/* 7. FOOTER */
.deco-footer {
    background-color: var(--text-dark);
    color: var(--bg-cream);
    text-align: center;
    padding: 60px 20px;
}
.deco-footer h2 {
    font-style: italic;
    margin-bottom: 10px;
}
.deco-footer p {
    font-size: 0.9rem;
    color: #999999;
}
.footer-links { 
    margin-top: 20px; 
}
.footer-links a { 
    margin: 0 10px; 
    font-size: 0.85rem; 
    color: #aaaaaa; 
    text-decoration: underline; 
}
.footer-links a:hover { 
    color: #ffffff; 
}

/* 8. RESPONSIVE DESIGN */
@media (max-width: 992px) {
    .header-flex {
        flex-wrap: wrap;
    }
    .search-bar {
        order: 3;
        width: 100%;
    }
    .search-bar input {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header-flex { 
        flex-direction: column; 
        align-items: stretch;
        text-align: center;
    }
    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    .modal-grid, .auth-grid { 
        grid-template-columns: 1fr !important; 
    }
    .auth-grid > div:last-child {
        border-left: none !important;
        padding-left: 0 !important;
        border-top: 1px solid #eee;
        padding-top: 20px;
    }
    .modal-img img { 
        height: 220px; 
    }
    .modal-content {
        padding: 25px;
        max-height: 90vh;
        overflow-y: auto;
    }
    .m-actions {
        flex-direction: column;
    }
}