/*1. ESTILOS GENERALES Y DARK MODE */
body { 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    margin: 0; 
    padding: 0; 
    background-color: #0f0f0f; /* Negro más profundo para dar lujo */
    color: #f5f5f5; 
    line-height: 1.6;
}

/* Efecto de luz ambiental en la esquina */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at top right, rgba(255, 204, 0, 0.05), transparent 40%);
    z-index: -1;
    pointer-events: none;
}

h1 { 
    text-align: center; 
    margin: 60px 0 40px; 
    font-weight: 300; 
    letter-spacing: 2px;
    text-transform: uppercase;
}

h1 span { 
    color: #ffcc00; 
    font-weight: bold; 
    text-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
}

/*2. BARRA DE NAVEGACIÓN (Estilo Cristal)*/
nav { 
    background: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(12px); /* Efecto desenfocado moderno */
    padding: 20px; 
    text-align: center; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav a { 
    color: #f1f1f1; 
    margin: 0 20px; 
    text-decoration: none; 
    font-weight: 600; 
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: 0.3s;
}

nav a:hover { 
    color: #ffcc00; 
}

/*3. BUSCADOR PREMIUM*/
.contenedor-buscador {
    max-width: 800px;
    margin: -30px auto 50px auto; /* Sube un poco para pisar la sección anterior */
    padding: 30px;
    background: #1a1a1a;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 10;
}

.formulario-busqueda {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.formulario-busqueda input {
    flex: 1;
    padding: 15px 20px;
    border: 1px solid #333;
    border-radius: 10px;
    background: #050505;
    color: #fff;
    font-size: 16px;
    outline: none;
    transition: 0.3s;
}

.formulario-busqueda input:focus {
    border-color: #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
}

.formulario-busqueda button {
    padding: 15px 35px;
    background: linear-gradient(135deg, #ffcc00, #ff9900);
    color: #000;
    border: none;
    border-radius: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
}

.formulario-busqueda button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 204, 0, 0.5);
}

/*4. CATÁLOGO / STOCK */
.catalogo { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 35px; 
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.tarjeta { 
    background: #1a1a1a; 
    border-radius: 20px; 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    text-align: center; 
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tarjeta:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border-color: rgba(255, 204, 0, 0.3);
}

.foto-coche { 
    width: 100%; 
    height: 220px; 
    object-fit: cover; 
}

.marca-modelo { 
    font-size: 20px; 
    margin: 20px 0 5px 0; 
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.datos { 
    color: #888; 
    font-size: 14px; 
    margin-bottom: 15px; 
}

.precio { 
    color: #ffcc00; 
    font-size: 28px; 
    font-weight: bold; 
    margin: auto 0 25px 0;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
}

/*5. ETIQUETAS DE ORIGEN (Estilo Pastilla) */
.etiqueta-verde, .etiqueta-azul, .etiqueta-naranja {
    padding: 6px 15px;
    text-align: center;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    border-radius: 50px;
    display: inline-block;
    margin: 15px auto;
}

.etiqueta-verde { background: rgba(39, 174, 96, 0.2); color: #2ecc71; border: 1px solid #27ae60; }
.etiqueta-azul { background: rgba(52, 152, 219, 0.2); color: #3498db; border: 1px solid #3498db; }
.etiqueta-naranja { background: rgba(230, 126, 34, 0.2); color: #e67e22; border: 1px solid #e67e22; }

/*6. TABLAS Y GESTIÓN*/
.tabla-gestion { 
    width: 95%; 
    margin: 30px auto; 
    border-collapse: separate; 
    border-spacing: 0;
    background: #1a1a1a; 
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.tabla-gestion th { 
    background-color: #000; 
    color: #ffcc00; 
    padding: 18px; 
    text-transform: uppercase;
    font-size: 13px;
}

.tabla-gestion td { 
    border-bottom: 1px solid #222; 
    padding: 15px; 
    text-align: center; 
}

.btn-añadir { 
    display: inline-block; 
    background: #ffcc00; 
    color: #000; 
    padding: 12px 25px; 
    text-decoration: none; 
    border-radius: 8px; 
    font-weight: bold;
    margin: 20px; 
    transition: 0.3s;
}

.btn-añadir:hover {
    background: #fff;
    transform: scale(1.05);
}
/* Estilos base del Navegador */
.navbar {
    background: #333333;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo a {
    color: #ffcc00;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.4rem;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-list li { margin-left: 20px; }

.nav-list a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-family: sans-serif;
    transition: 0.3s;
}

.nav-list a:hover { color: #ffcc00; }

.user-info { color: #ffcc00; font-weight: bold; margin-left: 20px; }
.btn-exit { color: #ff4444 !important; }

/* Botón Hamburguesa oculto en PC */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    transition: 0.4s;
}

/* --- MÓVIL (Menú Hamburguesa) --- */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }

    .nav-list {
        display: none; /* Se oculta */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #333;
        padding: 20px 0;
        text-align: center;
    }

    .nav-list.active { display: flex; } /* Se muestra al hacer clic */

    .nav-list li { margin: 15px 0; }

    /* Animación del botón a 'X' */
    .is-active span:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
    .is-active span:nth-child(2) { opacity: 0; }
    .is-active span:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }
}
/* RESET DE NAVEGACIÓN */
.navbar {
    background: #1a1a1a;
    width: 100%;
    padding: 10px 0;
    border-bottom: 2px solid #ffcc00;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.navbar .logo {
    color: #ffcc00;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.nav-list {
    display: flex;
    list-style: none; /* Esto quita los puntos */
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-list li {
    margin-left: 25px;
}

.nav-list a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    transition: 0.3s;
}

.nav-list a:hover {
    color: #ffcc00;
}

.user-item { color: #ffcc00; font-size: 0.8rem; font-weight: bold; margin-left: 20px; }
.btn-logout { color: #ff4444 !important; }

/* HAMBURGUESA */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.menu-toggle span {
    width: 28px;
    height: 3px;
    background: #ffcc00;
    transition: 0.3s;
}

/* RESPONSIVE MÓVIL */
@media (max-width: 850px) {
    .menu-toggle { display: flex; }

    .nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: #1a1a1a;
        padding: 20px 0;
        border-bottom: 2px solid #ffcc00;
        z-index: 999;
    }

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

    .nav-list li {
        margin: 15px 0;
    }
}
header, nav {
    display: flex;
    justify-content: space-between; /* Mantiene logo a la izquierda y botón a la derecha */
    align-items: center;
    width: 100%;
    padding: 0 20px; /* Ajusta el espacio lateral a tu gusto */
    box-sizing: border-box;
}
/* Estilo especial para el botón de publicar en el menú */
.btn-nav-publicar {
    background-color: #ffcc00 !important; /* El amarillo de Autostito */
    color: #121212 !important; /* Texto oscuro para que resalte */
    padding: 10px 22px !important;
    border-radius: 50px !important;
    font-weight: bold !important;
    transition: all 0.3s ease !important;
    border: 2px solid #ffcc00 !important;
    margin-left: 10px; /* Separación de los demás enlaces */
}

.btn-nav-publicar:hover {
    background-color: transparent !important;
    color: #ffcc00 !important;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.4);
}

/* Ajuste para que el menú no se amontone */
.nav-list {
    display: flex;
    align-items: center;
    gap: 15px;
}
.form-publicar {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 15px;
    border: 1px solid #333;
}

.campo {
    margin-bottom: 20px;
}

.campo label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
}

.campo input {
    width: 100%;
    padding: 12px;
    background: #222;
    border: 1px solid #444;
    color: white;
    border-radius: 8px;
    box-sizing: border-box; /* Importante para que no se salga del contenedor */
}

.btn-amarillo {
    width: 100%;
    background-color: #ffcc00;
    color: #121212;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
}

.btn-amarillo:hover {
    background-color: #e6b800;
}
/* Estilos unificados para el menú */
.navbar-principal {
    background: #1a1a1a;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: 'sans-serif';
}

.navbar-principal .logo a {
    color: #ffcc00;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.5rem;
}

.menu-links {
    display: flex;
    align-items: center;
}

.menu-links a {
    color: white;
    margin: 0 15px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

.btn-nav-publicar {
    background: #ffcc00;
    color: black !important;
    padding: 10px 20px;
    border-radius: 25px;
    margin-left: 10px;
}

.user-menu {
    list-style: none;
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.user-name { color: #ffcc00; font-weight: bold; margin-right: 15px; }

.btn-acceso {
    background: #ffcc00;
    color: black !important;
    padding: 5px 15px;
    border-radius: 5px;
}

.btn-salir { color: #ff4444 !important; }
/* Configuración General */
body {
    background-color: #121212; /* Fondo oscuro unificado */
    color: white;
    font-family: 'sans-serif', Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* Menú de Navegación Profesional */
.navbar-principal {
    background: #1a1a1a;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-principal .logo a {
    color: #ffcc00;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.5rem;
}

.menu-links a {
    color: white;
    margin: 0 15px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

.btn-nav-publicar {
    background: #ffcc00;
    color: black !important;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: bold;
    text-decoration: none;
}

.btn-acceso {
    background: #ffcc00;
    color: black !important;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 0.8rem;
    text-decoration: none;
}
/* PC: Escondemos la hamburguesa */
.menu-toggle { display: none; }

/* MÓVIL */
@media (max-width: 768px) {
    .menu-toggle { 
        display: block; 
        cursor: pointer;
    }
    .nav-list { 
        display: none; /* Se esconde por defecto */
        flex-direction: column;
        width: 100%;
        background: #1a1a1a;
    }
    .nav-list.active { 
        display: flex; /* Se muestra al pulsar la hamburguesa */
    }
}
/* --- ESTILOS NAVEGACIÓN UNIFICADOS --- */
nav {
    background: #1a1a1a;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1000;
    border-bottom: 1px solid #333;
}

.logo a {
    color: #ffcc00;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.5rem;
    text-transform: uppercase;
}

.nav-list {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-list li {
    margin-left: 20px;
}

.nav-list a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.btn-nav-publicar {
    background: #ffcc00;
    color: black !important;
    padding: 10px 20px;
    border-radius: 25px;
}

/* --- ESTILOS MÓVIL (HAMBURGUESA) --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #ffcc00;
    margin: 3px 0;
}

@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #1a1a1a;
        padding: 20px;
    }
    .nav-list.active { display: flex; }
}
@media (max-width: 768px) {
    .nav-list {
        display: none; /* Escondido por defecto */
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: #1a1a1a;
        z-index: 999;
    }

    /* Cuando tiene la clase active, se muestra */
    .nav-list.active {
        display: flex !important;
    }
}
@media (max-width: 768px) {
    .nav-list {
        display: none; /* Asegura que empieza oculto */
        z-index: 9999 !important; /* Ponlo por encima de TODO */
    }
    .nav-list.active {
        display: flex !important;
    }
}