/* Heading smoothing for crisp titles */
h1, h2, h3, h4, h5, h6 {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    color: var(--text-color);
    font-weight: 800;
}
:root {
    --primary: #c5a059; /* Or discret */
    --secondary: #1a1a1a; /* Noir profond */
    --accent: #d4af37; /* Or plus vif */
    --bg-color: #0d0d0d;
    --card-bg: #141414;
    --text-color: #e0e0e0;
    --text-muted: #888;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-mode {
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-color: #1d1d1f;
    --text-muted: #666666;
    --glass: rgba(0, 0, 0, 0.03);
    --border: rgba(0, 0, 0, 0.08);
    --secondary: #ffffff;
}
.section { padding: 4rem 5%; } /* Plus compact de base */

.section-title {
    text-align: center;
    margin-bottom: 2rem; /* Réduit */
}

.section-title h2,
.hero h2,
header h1 {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-weight: 800;
    color: var(--text-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0 !important; /* ON FORCE LE CARRÉ SUR TOUT LE SITE */
}

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 80px; /* EVITE QUE LE CONTENU PASSE SOUS LE HEADER */
}

/* Animations globale */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header & Nav */
header {
    background: rgba(13, 13, 13, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #ffffff !important;
    font-weight: 700;
    transition: var(--transition);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--primary) !important;
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link i, .nav-link span {
    pointer-events: none;
}

/* Hero Section */
.hero {
    height: 50vh; /* Hauteur très compacte */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; 
    align-items: center;
    text-align: center;
    padding: 0 5% 5vh; /* Plus proche du bas */
    background: radial-gradient(circle at center, rgba(197, 160, 89, 0.1) 0%, transparent 70%);
}

.hero h2 {
    font-size: 22px !important; /* Texte très fin et discret */
    margin-bottom: 1rem;
    animation: fadeIn 1s ease-out;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 2rem;
    animation: fadeIn 1s ease-out 0.2s backwards;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 0 !important; /* FORCÉ EN CARRÉ */
    cursor: pointer;
    font-weight: 800;
    font-size: 0.85rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #fff 200%) !important;
    color: #000000 !important; /* Noir pur pour contraste max */
    border: none !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6) !important;
    transform: perspective(1px) translateZ(0);
}

.btn-primary:hover {
    transform: translateY(-5px) scale(1.05) !important;
    filter: brightness(1.2) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.7) !important;
}

/* Product Cards */
.products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 3rem 5%;
    justify-content: center;
    max-width: 1400px;
    margin: 0 auto;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    animation: fadeIn 0.8s ease-out;
    width: 240px;
    flex-shrink: 0;
}

.product-card:hover {
    border-color: var(--primary);
    transform: translateY(-10px);
}

.product-img {
    height: 350px;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-img img {
    scale: 1.1;
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-price {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
}

/* Admin Dashboard Styles */
.admin-container {
    background: var(--bg-color);
    color: var(--text-color);
}

.admin-container a {
    color: var(--primary) !important;
}

.admin-sidebar {
    background: var(--card-bg);
    color: var(--text-color);
}

.admin-sidebar a {
    color: var(--text-color) !important;
}

.admin-main h1, .admin-main h2, .admin-main h3 {
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-weight: 800;
}


.sidebar {
    width: 250px;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    padding: 2rem;
}

.main-content {
    flex: 1;
    padding: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    background: var(--glass);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    color: var(--text-color);
}

th {
    background: var(--glass);
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-color);
    border-radius: 0;
}

input:focus {
    border-color: var(--primary);
    outline: none;
}

/* --- RESPONSIVITÉ --- */

/* Menu Burger */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 30px;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

@media (max-width: 768px) {
    header {
        padding: 1rem 5%;
    }

    header h1 {
        font-size: 1.1rem !important;
        letter-spacing: 1px !important; /* Réduit un peu pour mieux passer */
        white-space: normal !important; /* Permet au texte de passer à la ligne */
        line-height: 1.1 !important;
        margin: 0 !important;
    }

    .menu-toggle {
        display: flex;
    }

    nav {
        position: fixed;
        top: 90px; /* Sous le header */
        left: 0;
        width: 100%;
        height: auto;
        background: rgba(13, 13, 13, 0.98);
        backdrop-filter: blur(25px);
        border: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        border-bottom-left-radius: 25px;
        border-bottom-right-radius: 25px;
        padding: 2.5rem 0;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        display: flex !important;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    }

    nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    #close-mobile-nav {
        display: none !important;
    }

    nav ul {
        flex-direction: column;
        gap: 1.8rem !important;
        align-items: center !important;
        width: 100%;
    }

    nav ul li a {
        font-size: 1.15rem;
        font-weight: 600;
        letter-spacing: 2px;
        text-transform: uppercase;
        color: #fff !important;
        display: block;
        padding: 0.5rem 2rem;
    }

    .hero h2 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero p {
        font-size: 0.9rem;
    }

    .products-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 25px !important;
        padding: 1rem 5% !important;
    }

    .product-card {
        width: 100% !important;
        max-width: 380px !important;
        margin: 0 auto !important;
    }

    .product-img {
        height: 280px !important;
    }

    .product-info {
        padding: 0.8rem !important;
    }

    .product-name {
        font-size: 0.8rem !important;
    }

    /* Admin Mobile */
    .admin-container {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .admin-main {
        margin-left: 0;
        padding: 1.5rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    header {
        height: 70px !important;
    }

    /* FIX NAVIGATION MOBILE */
    .header-mobile-tools { 
        display: flex !important; 
        align-items: center !important; 
        gap: 1.5rem !important; 
    }
    #nav-menu { display: none !important; }
    
    /* Force l'affichage quand on clique sur le burger */
    #nav-menu.active { 
        display: flex !important; 
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #000;
        z-index: 10000;
        padding-top: 80px;
    }

    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
    }
    .menu-toggle span {
        display: block;
        width: 25px;
        height: 2px;
        background: #fff !important;
    }

    .section-title h2 { 
        font-size: 0.95rem !important;
        letter-spacing: 1px !important;
        margin-bottom: 0.5rem !important;
    }

    /* Products grid mobile spacing overrides */
    .products-grid {
        margin-top: 1rem !important;
    }

    /* Pourquoi choisir Deantech compact */
    section[style*="padding: 6rem 5%"] {
        padding: 2rem 5% !important;
    }
    
    div[style*="gap: 3rem"] {
        gap: 1.5rem !important; /* Moitié moins d'espace entre les icônes */
    }

    div[style*="margin-bottom: 1.5rem"] {
        margin-bottom: 0.5rem !important;
    }

    h4[style*="margin-bottom: 1rem"] {
        margin-bottom: 0.3rem !important;
    }
    
    .product-img {
        height: 150px !important; /* Plus compact */
    }

    #close-mobile-nav {
        display: block !important;
        cursor: pointer;
        padding: 1.5rem 5% !important;
    }

    .hero-slider {
        height: 60vh !important;
    }

    .hero {
        justify-content: center !important;
        padding-bottom: 0 !important;
        background: rgba(0,0,0,0.3) !important;
    }

    .hero h2 {
        font-size: 20px !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
        font-weight: 300 !important;
        text-transform: uppercase;
        letter-spacing: 4px !important;
        color: #fff !important;
    }
    
    .hero p {
        font-size: 11px !important;
        margin-bottom: 1.5rem !important;
        letter-spacing: 1px;
        opacity: 0.9;
        text-transform: none;
    }

    .btn {
        padding: 0.8rem 1.5rem !important;
        font-size: 0.75rem !important;
    }

    * {
        border-radius: 0 !important;
    }

    .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.65rem !important;
        min-width: unset !important;
    }

    .btn-primary {
        background: var(--primary) !important;
        color: #000 !important;
    }

    .stat-card {
        padding: 1.5rem !important;
    }
}

/* --- PAGES SPÉCIFIQUES --- */

/* Détail Produit Professionnel */
.product-page-grid {
    display: grid !important;
    grid-template-areas: 
        "gallery title"
        "gallery info";
    grid-template-columns: 1fr 1fr;
    align-items: start;
}
.product-title-section { grid-area: title; }
.product-gallery { grid-area: gallery; }
.product-info-block { grid-area: info; }

/* Panier Professionnel Desktop */
.cart-table th { text-align: left; padding: 1.5rem 1rem; }
.cart-table td { border-bottom: 1px solid var(--border); padding: 1.5rem 1rem; }
.cart-product-cell { display: flex; align-items: center; gap: 1rem; }

.cart-remove-btn {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.05);
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important; /* Force le rond */
    transition: var(--transition);
    text-decoration: none;
}
.cart-remove-btn:hover {
    background: #ff4d4d;
    color: white;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    /* Header Fix */
    header h1 {
        font-size: 1rem !important;
        letter-spacing: 1px !important;
        white-space: nowrap !important;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    /* Ordre Produit Mobile: Titre -> Image -> Infos */
    .product-page-grid {
        grid-template-areas: 
            "title"
            "gallery"
            "info";
        grid-template-columns: 1fr;
        gap: 2rem !important;
    }
    .product-title-section h2 { 
        font-size: 1.8rem !important; 
        margin-top: 0 !important;
    }

    /* Transformation du Panier en CARTES (Mobile) */
    .cart-table, .cart-table thead, .cart-table tbody, .cart-table tr { 
        display: block !important; 
        width: 100% !important;
    }
    .cart-table thead { display: none !important; } /* On cache les titres */
    .cart-table tr { 
        border-bottom: 5px solid var(--primary); 
        margin-bottom: 2rem;
        background: var(--card-bg);
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }
    .cart-table td { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        padding: 1.2rem !important;
        text-align: right;
        border-bottom: 1px solid var(--border);
        width: 100% !important;
    }
    .cart-product-cell {
        flex-direction: column !important;
        justify-content: center !important;
        text-align: center !important;
        background: rgba(255,255,255,0.02);
    }
    .cart-table td:before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.7rem;
        color: var(--primary);
        text-align: left;
    }
    .cart-table td:first-child { 
        flex-direction: row; 
        justify-content: flex-start;
        gap: 1rem;
        background: rgba(255,255,255,0.02);
    }
    .cart-table td:last-child { 
        border-bottom: none; 
        justify-content: center; /* CENTRE LE BOUTON SUPPRIMER */
        background: rgba(255,77,77,0.02);
    }
    .cart-table td:last-child:before {
        content: ''; /* Supprimé à votre demande */
    }

    .cart-summary {
        flex-direction: column-reverse !important;
        gap: 2rem !important;
        text-align: center !important;
        padding: 2rem 1rem !important;
    }
    .cart-summary div {
        text-align: center !important;
        width: 100%;
    }
}
/* ----- Login Page Premium Styles ----- */
.login-page {
    background: linear-gradient(135deg, var(--primary) 0%, var(--bg-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    border: 2px solid var(--primary);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    animation: slideIn 0.6s ease-out;
    transition: transform var(--transition);
}
.login-card:hover {
    transform: translateY(-5px);
}

@keyframes slideIn {
    from { opacity:0; transform: translateY(20px); }
    to { opacity:1; transform: translateY(0); }
}

/* Theme toggle button styling */
#theme-toggle {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
#theme-toggle:hover {
    background: var(--primary);
    color: var(--white);
}

/* --- SECTION GALERIE DE REALISATIONS --- */
.gallery-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 30px !important;
    padding: 2rem 5% !important;
    margin-bottom: 5rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-item {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    max-width: 450px;
    flex: 1 1 320px;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    border-color: var(--primary);
}

.gallery-media-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.gallery-media-wrapper img,
.gallery-media-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover .gallery-media-wrapper img,
.gallery-item:hover .gallery-media-wrapper video {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(13, 13, 13, 0.9) 0%, rgba(13, 13, 13, 0.2) 60%, rgba(13, 13, 13, 0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

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

.gallery-item-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0.5rem;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-title {
    transform: translateY(0);
}

.gallery-tag {
    align-self: flex-start;
    background: var(--primary);
    color: #000 !important;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 10px;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(197, 160, 89, 0.9);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 1;
    transition: var(--transition);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.gallery-item:hover .video-indicator {
    background: #fff;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Lightbox Premium */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightboxMediaContainer {
    width: 100%;
    max-height: 75vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#lightboxMediaContainer img,
#lightboxMediaContainer video {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border: 1px solid var(--border);
}

#lightboxCaption {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.5rem;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
    z-index: 2010;
}

.lightbox-close:hover {
    opacity: 1;
    color: var(--primary);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2010;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }

@media (max-width: 768px) {
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-prev, .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}
