:root {
    --primario: #00f0ff;
    --secundario: #7000ff;
    --fondo: #0a0a0b;
    --texto: #ffffff;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--fondo);
    color: var(--texto);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* HEADER Y ALINEACIÓN */
.header {
    background: rgba(10, 10, 11, 0.95);
    padding: 1rem 0;
    border-bottom: 1px solid var(--primario);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-top { 
    display: flex; 
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
 }

.logo-img { height: 50px; }
.header-actions { display: flex !important; align-items: center !important; gap: 1.5rem !important; }

.cart { font-size: 1.5rem; cursor: pointer; position: relative; }
#contador-carrito {
    position: absolute; top: -10px; right: -10px;
    background: var(--secundario); color: white;
    font-size: 0.7rem; padding: 2px 6px; border-radius: 50%;
}

.btn-auth {
    background: transparent; border: 1px solid var(--primario); color: var(--primario);
    padding: 8px 16px; border-radius: 4px; cursor: pointer; transition: 0.3s;
    display: flex !important; align-items: center !important; height: fit-content;
}
.btn-auth:hover { background: var(--primario); color: black; }
.btn-logout { background: transparent; border: none; font-size: 1.5rem; cursor: pointer; }

/* HERO BANNER CORREGIDO */
.hero { padding: 40px 0; }
.hero-container { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.hero-card {
    width: 200px; background: #1a1a1c; border-radius: 10px;
    overflow: hidden; text-align: center; border: 1px solid #333;
    opacity: 1; /* AHORA ES VISIBLE SIEMPRE */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hero-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 240, 255, 0.2);
}
.hero-card img { width: 100%; height: 120px; object-fit: cover; }
.hero-card p { padding: 10px; font-weight: bold; margin: 0; }

/* CATÁLOGO */
.titulo-seccion { text-align: center; margin-bottom: 30px; }
.grid-productos {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px; margin-top: 20px;
}
.tarjeta-producto {
    background: #1a1a1c; border-radius: 12px; overflow: hidden;
    border: 1px solid #333; transition: 0.3s; opacity: 0; transform: translateY(20px);
}
.tarjeta-producto.visible { opacity: 1; transform: translateY(0); }
.producto-img { width: 100%; height: 200px; object-fit: cover; }
.info-producto { padding: 20px; text-align: center; }
.btn-comprar {
    background: var(--primario); border: none; padding: 10px 20px;
    border-radius: 6px; font-weight: bold; cursor: pointer; width: 100%; margin-top: 10px;
}

/* CARRITO LATERAL (FLEXBOX) */
.oculto { display: none !important; }
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); z-index: 2000;
}
.carrito-panel {
    position: fixed; right: 0; top: 0; width: 350px; height: 100vh;
    background: #111; z-index: 3000; padding: 20px; transition: 0.4s;
    box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
    box-sizing: border-box;
}
.carrito-oculto { transform: translateX(100%); }
.header-carrito { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #333; padding-bottom: 10px; }
#lista-carrito {
    flex: 1; overflow-y: auto; margin: 15px 0; padding-right: 5px;
}
.item-carrito { display: flex; justify-content: space-between; margin-bottom: 15px; border-bottom: 1px solid #222; padding-bottom: 10px; }
.btn-eliminar-item { background: transparent; border: none; cursor: pointer; }

/* FOOTER DEL CARRITO */
.footer-carrito {
    margin-top: auto; border-top: 1px solid #333; padding-top: 15px;
}
.total { font-size: 1.2rem; font-weight: bold; margin-bottom: 10px; }
.btn-pagar { width: 100%; background: #00f0ff; padding: 15px; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; color: #000; }
.btn-vaciar { 
    width: 100%; background: transparent; border: 1px solid #ff4444; color: #ff4444; 
    padding: 10px; border-radius: 5px; margin-bottom: 10px; cursor: pointer; font-weight: bold; transition: 0.3s;
}
.btn-vaciar:hover { background: #ff4444; color: white; }

/* FOOTER PRINCIPAL */
.footer { background: #111; border-top: 1px solid var(--primario); padding: 40px 0; margin-top: 50px; }
.footer-content { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.footer h3 { color: var(--primario); margin-top: 0; }
.footer-contacto p { margin: 5px 0; color: #ccc; }
.footer-redes a { color: var(--secundario); text-decoration: none; margin-right: 15px; font-weight: bold; }
.footer-redes a:hover { color: var(--primario); }

/* CHATBOT (A LA DERECHA) */
.btn-chatbot { 
    position: fixed; bottom: 30px; right: 30px; left: auto;
    background: var(--secundario); color: white; border: none; border-radius: 50%; 
    width: 60px; height: 60px; font-size: 1.5rem; cursor: pointer; z-index: 1000; box-shadow: 0 0 15px rgba(112, 0, 255, 0.5); 
}
.ventana-chat { 
    position: fixed; bottom: 100px; right: 30px; left: auto;
    width: 300px; height: 400px; background: #1a1a1c; border-radius: 10px; border: 1px solid var(--secundario); 
    z-index: 1000; display: flex; flex-direction: column; overflow: hidden; transition: 0.3s; 
}
.chat-oculto { opacity: 0; pointer-events: none; transform: translateY(20px); }
.header-chat { background: var(--secundario); padding: 15px; display: flex; justify-content: space-between; font-weight: bold; }
.header-chat button { background: transparent; border: none; color: white; cursor: pointer; font-size: 1.2rem; }
.chat-mensajes { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.msg-bot { background: #333; padding: 10px; border-radius: 10px 10px 10px 0; align-self: flex-start; max-width: 80%; }
.msg-usuario { background: var(--secundario); padding: 10px; border-radius: 10px 10px 0 10px; align-self: flex-end; max-width: 80%; }
.footer-chat { display: flex; padding: 10px; background: #111; border-top: 1px solid #333; }
.footer-chat input { flex: 1; background: #222; border: none; color: white; padding: 10px; border-radius: 5px; margin-right: 10px; }
.footer-chat button { background: var(--secundario); border: none; color: white; padding: 10px 15px; border-radius: 5px; cursor: pointer; }

/* MODAL LOGIN 3D */
.modal-checkout {
    background: #1a1a1c; width: 400px; margin: 100px auto; padding: 30px;
    border-radius: 10px; border: 1px solid var(--primario); position: relative;
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.15); transition: transform 0.1s ease-out;
}
.btn-cerrar-modal { position: absolute; top: 10px; right: 15px; background: transparent; border: none; color: white; font-size: 1.5rem; cursor: pointer; }
.tabs-auth { display: flex; margin-bottom: 20px; border-bottom: 1px solid #333; }
.tab-btn { flex: 1; background: transparent; border: none; color: gray; padding: 10px; cursor: pointer; }
.tab-btn.activa { color: var(--primario); border-bottom: 2px solid var(--primario); }
#form-checkout div { margin-bottom: 15px; }
#form-checkout input { width: 100%; padding: 10px; background: #111; border: 1px solid #333; color: white; border-radius: 5px; box-sizing: border-box; margin-top: 5px;}
.btn-principal { width: 100%; background: var(--primario); color: black; padding: 12px; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; margin-top: 10px;}

/* TOASTS */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
.toast { background: #333; color: white; padding: 12px 24px; border-radius: 4px; margin-top: 10px; transition: 0.3s; }
.toast-exito { border-left: 5px solid #00ff00; }
.toast-error { border-left: 5px solid #ff0000; }
.toast-info { border-left: 5px solid #00f0ff; }
.ocultar { opacity: 0; }

/* ========================================= */
/* EFECTOS HOVER (INTERACTIVIDAD)            */
/* ========================================= */

/* 1. Efecto en las tarjetas de productos */
.tarjeta-producto {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.tarjeta-producto:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 10px 25px rgba(0, 240, 255, 0.15);
    border-color: var(--primario);
}

/* 2. Zoom suave en las imágenes al pasar el mouse */
.contenedor-imagen {
    overflow: hidden; /* Evita que la imagen se salga de los bordes al hacer zoom */
}
.producto-img {
    transition: transform 0.4s ease;
}
.tarjeta-producto:hover .producto-img {
    transform: scale(1.08);
}

/* 3. Botón "Agregar al carrito" */
.btn-comprar {
    transition: all 0.3s ease;
}
.btn-comprar:hover {
    background: #00c4cc; /* Cyan un poco más oscuro */
    transform: scale(1.03);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
    color: black;
}

/* 4. Botón "Ir a Pagar" del carrito */
.btn-pagar {
    transition: all 0.3s ease;
}
.btn-pagar:hover:not(:disabled) {
    background: #00c4cc;
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

/* 5. Botones Principales (Login / Registro) */
.btn-principal {
    transition: all 0.3s ease;
}
.btn-principal:hover {
    background: #00c4cc;
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

/* 6. Enlaces del Footer */
.footer-redes a {
    transition: color 0.3s ease, text-shadow 0.3s ease;
}
.footer-redes a:hover {
    color: var(--primario);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

/* DISEÑO RESPONSIVO (MÓVILES Y TABLETS) */
@media screen and (max-width: 768px) {
    .header-top { flex-direction: column; gap: 15px; padding: 10px; }
    .header-actions { width: 100%; justify-content: center !important; gap: 2rem !important; }
    .hero-container { flex-direction: column; align-items: center; }
    .hero-card { width: 90%; max-width: 300px; }
    .modal-checkout { width: 90%; margin: 50px auto; padding: 20px; box-sizing: border-box; }
    .carrito-panel { width: 100%; }
    .ventana-chat { width: 90%; right: 5%; left: 5%; bottom: 90px; }
    .btn-chatbot { right: 15px; bottom: 15px; width: 55px; height: 55px; }
    .footer-content { flex-direction: column; text-align: center; gap: 30px; }
    .footer-redes a { margin: 0 10px; }
    .grid-productos { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }
    .producto-img { height: 150px; }
    .info-producto { padding: 10px; }
}

/* ANIMACIÓN PURA CSS PARA EL HERO BANNER */
.animar-entrada {
    opacity: 0; /* Inicia invisible solo durante la animación */
    transform: translateY(30px);
    animation: deslizarArriba 0.6s ease-out forwards;
}
@keyframes deslizarArriba {
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================= */
/* ANIMACIONES DE LOGO Y CARRITO             */
/* ========================================= */

/* 1. Animación del Logo: Brillo Neón y Levitación */
.logo-img {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.4s ease;
}

.logo-link:hover .logo-img {
    transform: scale(1.08) translateY(-3px);
    /* Crea un resplandor utilizando tu color primario (cyan) */
    filter: drop-shadow(0px 8px 12px rgba(0, 240, 255, 0.6)); 
}

/* 2. Animación del Carrito: Sacudida al pasar el mouse */
.cart {
    display: inline-block; /* Necesario para que las rotaciones funcionen correctamente */
    transform-origin: center;
}

.cart:hover {
    animation: sacudirCarrito 0.5s ease-in-out forwards;
}

/* 3. Animación de "Salto" para el contador del carrito */
#contador-carrito {
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.cart:hover #contador-carrito {
    transform: scale(1.2);
    background-color: var(--primario);
    color: black;
}

/* Keyframes (La secuencia de movimiento del carrito) */
@keyframes sacudirCarrito {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-15deg) scale(1.1); }
    50% { transform: rotate(10deg) scale(1.1); }
    75% { transform: rotate(-15deg) scale(1.1); }
    100% { transform: rotate(0deg) scale(1); }
}