/* ==========================================================================
   CHARTE GRAPHIQUE GLOBAL & VARIABLES - BY-FRED.FR
   ========================================================================== */

:root {
    /* Thème Bois / Gravure (Défaut) */
    --wood-primary: #B45309;
    --wood-bg: #FDFBF7;
    
    /* Thème Tech / Impression 3D */
    --tech-cyan: #0284C7;
    --tech-bg: #F0F9FF;
    
    /* Thème Résine */
    --resin-purple: #7E22CE;
    --resin-bg: #FAF5FF;

    /* Neutres */
    --bg-page: #F8FAFC;
    --bg-card: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
}

/* Reset & Typographie Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   EN-TÊTE & NAVIGATION MOBILE / BUREAU
   ========================================================================== */

header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--wood-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--wood-primary);
}

/* Pastilles Panier (Rouge) */
.cart-badge {
    background-color: #EF4444 !important;
    color: #FFFFFF !important;
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    padding: 2px 7px !important;
    border-radius: 10px !important;
    line-height: 1 !important;
    display: inline-block;
}

.mobile-header-actions {
    display: none;
}

.hamburger-btn {
    display: none;
}

/* RESPONSIVE SMARTPHONE (< 768px) */
@media (max-width: 768px) {
    header {
        padding: 12px 18px;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
        gap: 15px;
    }

    .nav-menu.active {
        display: flex;
    }

    .mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .cart-link-mobile {
        position: relative;
        font-size: 1.3rem;
        text-decoration: none;
        display: flex;
        align-items: center;
    }

    .cart-link-mobile .cart-badge {
        position: absolute;
        top: -6px;
        right: -10px;
        margin-left: 0;
    }

    .hamburger-btn {
        display: flex !important;
        background: transparent;
        border: none;
        font-size: 1.6rem;
        cursor: pointer;
        color: var(--text-main);
        padding: 0;
        margin: 0;
        line-height: 1;
    }
}

/* ==========================================================================
   CONTENEURS & GRILLES PRODUITS
   ========================================================================== */

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

.gallery-header {
    margin-bottom: 30px;
    text-align: center;
}

.gallery-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Grille Responsive */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Carte Produit */
.gallery-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08);
}

.img-box {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: #F1F5F9;
}

.img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.card-content h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.card-content p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.4;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.price-tag {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
}

.badge {
    background-color: var(--bg-page);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-weight: 600;
}

/* ==========================================================================
   MODALE DE PRODUIT / LIGHTBOX (DESIGN DEUX COLONNES)
   ========================================================================== */

.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-content-grid {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .lightbox-content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 10;
}

.close-btn:hover {
    color: var(--text-main);
}

/* Boutons de navigation inter-produits */
.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.2s;
}

.lightbox-nav-btn:hover {
    background: #FFFFFF;
    transform: translateY(-50%) scale(1.1);
}

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

.lightbox-nav-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-main);
    stroke-width: 2.5;
    fill: none;
}

/* ==========================================================================
   BOUTONS, FORMULAIRES & FOOTER
   ========================================================================== */

.btn-back {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-back:hover {
    color: var(--text-main);
}

.btn-submit {
    background-color: var(--wood-primary);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    opacity: 0.9;
}

/* Fil de filtres Admin */
.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 600;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--wood-primary);
    color: #FFFFFF;
    border-color: var(--wood-primary);
}

footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 25px 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
}

footer a {
    color: var(--text-muted);
    text-decoration: underline;
}