/* VARIABLES GLOBALES */
:root {
    --oscuro-fondo: #0d141d;
    --oscuro-tarjeta: #1a2636;
    /* CAMBIO: De amarillo/dorado a LILA */
    --dorado: #a366ff; 
    --dorado-hover: #b88aff; 
    --blanco-suave: #f4f4f4;
    --gris-borde: #334455;
    --gradiente: linear-gradient(135deg, #223248 0%, #0d141d 100%);
}

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

body {
    background: var(--gradiente);
    color: var(--blanco-suave);
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ENCABEZADO Y NAVEGACIÓN */
header {
    background-color: rgba(0, 0, 0, 0.9);
    border-bottom: 2px solid var(--dorado);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center; 
    padding: 0 2rem; /* Eliminamos el padding vertical para que el logo mande sobre la altura */
}

.logo a {
    font-family: 'Playfair Display', serif;
    color: var(--blanco-suave);
    text-decoration: none;
    font-size: 1.8rem;
    letter-spacing: 2px;
}

.logo span {
    color: var(--dorado);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--blanco-suave);
    text-decoration: none;
    font-size: 1.1rem;      /* Subimos el tamaño (estaba en el estándar) */
    font-weight: 500;       /* Un poco más de grosor (Medium) */
    text-transform: uppercase; /* Opcional: ponerlo en mayúsculas le da un toque más premium */
    letter-spacing: 1px;    /* Espaciado entre letras para elegancia */
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--dorado);
}

.badge {
    background-color: var(--dorado);
    color: #fff;
    padding: 3px 10px;      /* Un poco más ancho */
    border-radius: 50%;
    font-size: 0.9rem;      /* Subimos un punto */
    font-weight: bold;
    margin-left: 8px;
}

/* CONTENEDOR PRINCIPAL */
.contenedor-principal {
    flex: 1; /* Empuja el footer hacia abajo */
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.footer-profesional {
    background-color: #050a0f;
    border-top: 1px solid var(--gris-borde);
    padding: 3rem 0 1rem 0;
    margin-top: 4rem;
}
.footer-contenido {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
}

.footer-seccion h4 {
    color: var(--dorado);
    margin-bottom: 1.2rem;
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
}

.footer-seccion p {
    font-size: 0.9rem;
    color: #a0aab5;
}

.social-links a {
    color: var(--blanco-suave);
    text-decoration: none;
    margin-right: 15px;
    font-size: 0.9rem;
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #1a2636;
    font-size: 0.8rem;
    color: #667788;
}

/* ESTILO DE TARJETAS (Copiado y mejorado para el index) */
.contenedor-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.tarjeta-producto {
    background: var(--oscuro-tarjeta);
    border: 1px solid var(--gris-borde);
    border-radius: 12px;
    overflow: hidden; /* Importante: asegura que nada desborde los bordes redondeados */
    transition: transform 0.3s, border-color 0.3s;
    
    /* Mantenemos una altura constante para las tarjetas para que se alineen bien en la cuadrícula */
    display: flex;
    flex-direction: column;
    height: 480px; /* Puedes ajustar esta altura según prefieras */
}

.tarjeta-producto:hover {
    border-color: var(--dorado);
    transform: translateY(-10px);
}

.btn-dorado {
    background-color: var(--dorado);
    /* CAMBIO: Letra de negro a BLANCO */
    color: #fff; 
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    display: inline-block;
    transition: background 0.3s;
    border: none;
}

.imagen-contenedor {
    width: 100%;
    /* Definimos la altura máxima del 'cuadro' para la imagen */
    height: 300px; 
    overflow: hidden; /* Si la imagen es más grande, se recorta dentro de este cuadro */
    background-color: #000; /* Fondo negro para el cuadro si la imagen no lo llena */
    display: flex;
    justify-content: center;
    align-items: center;
}

.tarjeta-producto img {
    width: 100%;
    height: 100%;
    /* Mantenemos object-fit para que llene el cuadro sin deformarse */
    object-fit: cover; 
    
    /* ESTA ES LA LÍNEA MÁGICA QUE AGREGAREMOS:
       Alinea la imagen original a la parte superior del cuadro negro.
       Así, el recorte se hará abajo, mostrando de la cabeza a la cintura. */
    object-position: top; 
}

.info {
    padding: 1.5rem;
    text-align: center;
    /* Esto asegura que la info ocupe el espacio restante y el botón se alinee abajo */
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.btn-dorado:hover {
    background-color: var(--dorado-hover);
}

/* ESTILOS DEL DROPDOWN PERFIL */
.dropdown {
    position: relative;
    display: inline-block;
}

/* El nombre del usuario (David) también debe crecer */
.dropbtn {
    color: var(--blanco-suave);
    padding: 10px 15px;
    text-decoration: none;
    font-size: 1.1rem;      /* Empatamos con el resto del menú */
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.dropbtn:hover {
    color: var(--dorado);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0; /* Alínea a la derecha para que no se salga de la pantalla */
    background-color: #1a2636;
    min-width: 200px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.5);
    z-index: 1001;
    border: 1px solid var(--gris-borde);
    border-top: 2px solid var(--dorado);
    border-radius: 4px;
    margin-top: 10px;
}

.dropdown-header {
    padding: 12px 16px;
    font-size: 0.75rem;
    color: var(--dorado);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #223248;
}

.dropdown-content a {
    color: var(--blanco-suave);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: 0.2s;
}

.dropdown-content a:hover {
    background-color: #223248;
    color: var(--dorado);
    padding-left: 20px; /* Efecto sutil de movimiento */
}

.dropdown-divider {
    height: 1px;
    background-color: #223248;
    margin: 5px 0;
}

.logout-link {
    color: #ff6666 !important;
}

/* Mostrar el menú al pasar el mouse */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Flecha decorativa en el botón */
.dropbtn::after {
    font-size: 0.7rem;
    margin-left: 5px;
}

.contenedor-busqueda input:focus {
    outline: none;
    border-color: var(--dorado) !important;
    box-shadow: 0 0 5px rgb(120, 66, 190);
}

.tarjeta-producto h3 {
    margin-bottom: 2px; /* Espacio para el SKU pequeño debajo */
}

/* Ajuste para el logo en imagen */
.logo-img {
    height: 120px; /* Incrementado para mayor visibilidad */
    width: auto;  
    display: block;
    padding: 5px 0; /* Espaciado interno mínimo */
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.1); /* Efecto de zoom un poco más notable */
}
/* Quitamos márgenes extra que pudiera tener el contenedor */
.logo a {
    display: flex;
    align-items: center;
    padding: 0;
}

/* ----------------------------------------- */
/* ----------------------------------------- */
/* ----------------------------------------- */
/*            detalle.php                    */
/* ----------------------------------------- */
/* ----------------------------------------- */
/* ----------------------------------------- */

.detalle-producto {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.galeria img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 1px solid var(--gris-borde);
}

.categoria-tag {
    color: var(--dorado);
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.precio-grande {
    font-size: 2.5rem;
    color: var(--dorado);
    margin: 1rem 0;
}

.selector-variante select, .cantidad-seccion input {
    width: 100%;
    padding: 10px;
    background: var(--oscuro-tarjeta);
    color: white;
    border: 1px solid var(--gris-borde);
    margin: 10px 0 20px 0;
    border-radius: 5px;
}

.btn-comprar {
    width: 100%;
    padding: 1.2rem;
    background: var(--dorado);
    border: none;
    color: black;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    letter-spacing: 1px;
}

.btn-comprar:hover {
    background: #fff;
}

/* ----------------------------------------- */
/* ----------------------------------------- */
/* ----------------------------------------- */
/*            Login.php                    */
/* ----------------------------------------- */
/* ----------------------------------------- */
/* ----------------------------------------- */

/* ESTILOS DE AUTENTICACIÓN */
.contenedor-auth {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.tarjeta-auth {
    background: var(--oscuro-tarjeta);
    padding: 3rem;
    border-radius: 15px;
    border: 1px solid var(--gris-borde);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.tarjeta-auth h2 {
    font-family: 'Playfair Display', serif;
    color: var(--dorado);
    text-align: center;
    margin-bottom: 0.5rem;
}

.subtitulo {
    text-align: center;
    font-size: 0.9rem;
    color: #8899aa;
    margin-bottom: 2rem;
}

.grupo-input {
    margin-bottom: 1.5rem;
}

.grupo-input label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--blanco-suave);
}

.grupo-input input {
    width: 100%;
    padding: 12px;
    background: #0d141d;
    border: 1px solid var(--gris-borde);
    border-radius: 5px;
    color: white;
    outline: none;
}

.grupo-input input:focus {
    border-color: var(--dorado);
}

.btn-bloque {
    width: 100%;
    margin-top: 1rem;
    cursor: pointer;
}

.alerta-error {
    background: rgba(255, 0, 0, 0.1);
    border-left: 4px solid #ff4444;
    color: #ff4444;
    padding: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.alerta-info {
    background: rgba(255, 215, 0, 0.1);
    border-left: 4px solid var(--dorado);
    color: var(--dorado);
    padding: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--dorado);
    text-decoration: none;
    font-weight: 600;
}

/* ----------------------------------------- */
/* ----------------------------------------- */
/* ----------------------------------------- */
/*            carrito.php                    */
/* ----------------------------------------- */
/* ----------------------------------------- */
/* ----------------------------------------- */

/* ESTILOS CARRITO.PHP */
.contenedor-carrito {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

.grid-carrito {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.tabla-productos {
    background: var(--oscuro-tarjeta);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--gris-borde);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: var(--dorado);
    padding-bottom: 15px;
    border-bottom: 1px solid var(--gris-borde);
    font-size: 0.8rem;
    text-transform: uppercase;
}

td {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.img-mini {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 15px;
    vertical-align: middle;
}

.nombre-p {
    font-weight: 600;
}

.resumen-compra {
    background: #1a2636;
    padding: 30px;
    border-radius: 10px;
    height: fit-content;
    border: 1px solid var(--dorado);
}

.linea-resumen {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.total {
    font-size: 1.4rem;
    color: var(--dorado);
    font-weight: bold;
}

.btn-eliminar {
    color: #ff4444;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
}

.btn-seguir {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #8899aa;
    text-decoration: none;
    font-size: 0.9rem;
}

.carrito-vacio {
    text-align: center;
    padding: 100px 0;
}

@media (max-width: 900px) {
    .grid-carrito { grid-template-columns: 1fr; }
}

/* ----------------------------------------- */
/* ----------------------------------------- */
/* ----------------------------------------- */
/*            mi_perfil.php                  */
/* ----------------------------------------- */
/* ----------------------------------------- */
/* ----------------------------------------- */

/* DISEÑO DE LA PÁGINA MI PERFIL */
.perfil-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    margin-top: 20px;
}

.perfil-sidebar {
    background: var(--oscuro-tarjeta);
    padding: 40px 20px;
    border-radius: 15px;
    border: 1px solid var(--gris-borde);
    text-align: center;
    height: fit-content;
}

.perfil-avatar {
    width: 80px;
    height: 80px;
    background: var(--dorado);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 15px;
    box-shadow: 0 0 15px rgba(163, 102, 255, 0.4);
}

.rol-tag {
    color: var(--dorado);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 30px;
}

.perfil-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.perfil-nav a {
    color: var(--blanco-suave);
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    transition: 0.3s;
    font-size: 0.95rem;
}

.perfil-nav a:hover, .perfil-nav a.active {
    background: rgba(163, 102, 255, 0.1);
    color: var(--dorado);
}

.perfil-contenido {
    background: var(--oscuro-tarjeta);
    padding: 40px;
    border-radius: 15px;
    border: 1px solid var(--gris-borde);
}

.separador-lila {
    border: 0;
    height: 2px;
    background: var(--dorado);
    width: 50px;
    margin: 15px 0 30px 0;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.info-item label {
    display: block;
    color: #8899aa;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.info-item p {
    font-size: 1.1rem;
    font-weight: 500;
}

@media (max-width: 850px) {
    .perfil-container { grid-template-columns: 1fr; }
}

.info-item input {
    width: 100%;
    padding: 12px;
    background: #0d141d; /* Fondo más oscuro para resaltar */
    border: 1px solid var(--gris-borde);
    border-radius: 5px;
    color: white;
    font-family: 'Poppins', sans-serif;
    margin-top: 5px;
    outline: none;
    transition: border-color 0.3s;
}

.info-item input:focus {
    border-color: var(--dorado); /* Borde lila al hacer clic */
}

/* Estilo para el mensaje de éxito */
.alerta-info {
    background: rgba(163, 102, 255, 0.1);
    border-left: 4px solid var(--dorado);
    color: var(--dorado);
    padding: 15px;
    border-radius: 4px;
}

/* ----------------------------------------- */
/* ----------------------------------------- */
/* ----------------------------------------- */
/*            mis_direcciones                */
/* ----------------------------------------- */
/* ----------------------------------------- */
/* ----------------------------------------- */

.direcciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.tarjeta-direccion {
    background: #0d141d;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--gris-borde);
    position: relative;
}

.tarjeta-direccion p {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.tarjeta-direccion strong {
    color: var(--dorado);
}

.link-eliminar {
    display: inline-block;
    margin-top: 10px;
    color: #ff4444;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: bold;
}

.link-eliminar:hover {
    text-decoration: underline;
}

.tag-direccion {
    background: rgba(163, 102, 255, 0.2);
    color: var(--dorado);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}

.tarjeta-direccion {
    transition: border-color 0.3s;
}

.tarjeta-direccion:hover {
    border-color: var(--dorado);
}