/* Reset et Base */
:root {
    --bg-dark: #121418;
    --bg-card: #1b1e24;
    --primary: #3b82f6; /* Bleu style Tebex/FiveM standard */
    --primary-hover: #2563eb;
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --border: #2d333b;
    --green: #10b981; /* Pour les items gratuits */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navigation */
.navbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    height: 100%;
}

.nav-links > a, .dropbtn {
    color: var(--text-muted);
    font-weight: 500;
    transition: 0.3s;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 100%;
    position: relative;
    cursor: pointer;
}

.nav-links > a:hover, .dropbtn:hover, .nav-links > a.active {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

.nav-links > a::after, .dropbtn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--text-main);
    transition: 0.3s;
}

.nav-links > a:hover::after, .dropbtn:hover::after, .nav-links > a.active::after {
    width: 100%;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 70px; /* Hauteur navbar */
    left: 0;
    background-color: #16191d;
    min-width: 260px;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.5);
    z-index: 1;
    border-radius: 0 0 5px 5px;
    border: 1px solid var(--border);
    border-top: none;
    padding: 0.5rem 0;
}

.dropdown-content a {
    color: var(--text-muted);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: 0.2s;
    border-left: 3px solid transparent;
}

.dropdown-content a:hover {
    background-color: rgba(255,255,255,0.05);
    color: white;
    border-left: 3px solid var(--primary);
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Section */
.hero {
    /* REMPLACER 'background.jpg' PAR LE NOM EXACT DE VOTRE IMAGE SI DIFFÉRENT */
    background: linear-gradient(rgba(18, 20, 24, 0.6), rgba(18, 20, 24, 1)), url('background.png'); 
    background-size: cover;
    background-position: center;
    padding: 6rem 2rem 8rem; /* Ajustement padding pour logo */
    text-align: center;
}

.hero-logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.3)); /* Petit effet néon autour du logo */
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Filtres de catégories (Cachés car remplacés par la navbar, mais gardés au cas où) */
.categories {
    display: none; /* Masqué car géré par le menu maintenant */
    justify-content: center;
    gap: 15px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.cat-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s;
}

.cat-btn:hover, .cat-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Grille de produits */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer; /* Indique que c'est cliquable */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: var(--primary);
}

.product-image {
    width: 100%;
    height: 180px;
    background-color: #2d333b;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.product-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    height: 40px; /* Limite hauteur */
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.price {
    font-size: 1.25rem;
    font-weight: 700;
}

.price.free {
    color: var(--green);
}

.btn-buy {
    background-color: var(--primary);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 5px;
    font-size: 0.9rem;
}

.btn-download {
    background-color: var(--green);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    background-color: var(--bg-card);
}

/* MODAL PRODUIT */
.modal-product-overlay {
    display: none; /* Caché par défaut */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
    overflow: hidden;
    justify-content: center;
    align-items: center;
}

.modal-product-content {
    background-color: var(--bg-card);
    width: 90%;
    max-width: 1100px;
    height: 85vh; /* Max hauteur */
    border-radius: 12px;
    border: 1px solid var(--border);
    position: relative;
    display: flex;
    flex-direction: column;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-muted);
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.close-modal:hover {
    color: white;
}

.modal-body {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* Colonne Média (Gauche) */
.modal-media {
    flex: 2;
    background-color: #000;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    border-right: 1px solid var(--border);
}

.main-image-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    background: #121418;
    border-radius: 8px;
}

#modal-main-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#modal-video-container {
    width: 100%;
    height: 100%;
}

.media-thumbnails {
    height: 80px;
    display: flex;
    gap: 10px;
    padding-top: 1rem;
    overflow-x: auto;
}

.thumb-img {
    height: 100%;
    width: auto;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: 0.2s;
}

.thumb-img:hover, .thumb-img.active {
    border-color: var(--primary);
    opacity: 1;
}

/* Colonne Infos (Droite) */
.modal-infos {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

#modal-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.badge {
    display: inline-block;
    background: var(--bg-dark);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    width: fit-content;
}

#modal-desc {
    color: #ccc;
    line-height: 1.8;
    white-space: pre-wrap;
    flex: 1;
}

.modal-footer-action {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-price {
    font-size: 2rem;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 900px) {
    .modal-body {
        flex-direction: column;
        overflow-y: auto;
    }

    .modal-media {
        flex: none;
        height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .modal-infos {
        flex: none;
        height: auto;
    }
}