﻿/* Variables de Color y Diseño Premium */
:root {
    --color-verde-oscuro: #A01A16;
    --color-vinotinto: #A01A16;
    --color-vinotinto-hover: #801411;
    --color-verde-claro: #801411;
    --color-plateado: #e0e0e0;
    --color-blanco: #ffffff;
    --texto-oscuro: #2d3748;
    --radio-borde: 20px;
}

/* Reset y Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    min-height: 100vh;
    background: #e2e8f0; /* Color base claro */
    color: var(--texto-oscuro);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    z-index: 0;
}

/* Orbes de luz hiper-premium */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.7;
    pointer-events: none;
}

body::before {
    background: radial-gradient(circle, rgba(160, 26, 22, 0.35) 0%, rgba(128, 20, 17, 0) 70%);
    bottom: -10vw;
    left: -10vw;
}

body::after {
    background: radial-gradient(circle, rgba(144, 164, 174, 0.6) 0%, rgba(224, 224, 224, 0) 70%);
    top: -10vw;
    right: -10vw;
}

/* Contenedor Principal Mobile-First */
#aplicacion {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    z-index: 1;
    position: relative;
}

/* Clases Utilitarias para Vistas */
.vista {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    animation: aparecer 0.5s ease-out;
}

.vista.activa {
    display: flex;
}

.vista.oculta {
    display: none;
}

/* Efecto Glassmorphism Nivel Premium (Cristal Real) */
.cristal {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    
    /* El secreto del volumen con bordes de luz */
    border-top: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    
    border-radius: var(--radio-borde);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07) !important;
}

/* ---------- VISTA LOGIN Y REGISTRO ---------- */
#vista-login, #vista-registro {
    padding: 30px;
    height: auto;
    text-align: center;
    width: 90%;
    max-width: 400px;
    margin: auto;
    box-sizing: border-box;
}

.logo-login {
    max-width: 220px;
    width: 100%;
    height: auto;
    margin: 0 auto 20px auto;
    display: block;
}

.encabezado-login p {
    font-size: 14px;
    margin-bottom: 30px;
    opacity: 0.8;
}

/* Formularios Mobile-First */
.grupo-entrada {
    margin-bottom: 20px;
    text-align: left;
}

.grupo-entrada label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.grupo-entrada input {
    width: 100%;
    padding: 15px;
    border-radius: var(--radio-borde);
    
    /* Inputs como cristal empotrado */
    background: rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-left: 1px solid rgba(0, 0, 0, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    
    color: var(--texto-oscuro);
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
}

.grupo-entrada input:focus {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6), 0 0 8px rgba(160, 26, 22, 0.2);
}

.error-login {
    color: #ff5252;
    font-size: 13px;
    margin-bottom: 15px;
    text-align: center;
    display: none;
    background: rgba(255, 0, 0, 0.1);
    padding: 8px;
    border-radius: 8px;
    font-weight: bold;
}

/* Botones con transición suave premium */
button {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radio-borde);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: scale(0.98) translateY(0);
}

.boton-primario {
    background: var(--color-verde-oscuro);
    color: var(--color-blanco);
    box-shadow: 0 4px 15px rgba(160, 26, 22, 0.4);
}

.boton-primario:hover {
    background: #801411;
    box-shadow: 0 6px 20px rgba(128, 20, 17, 0.4);
}

.boton-secundario {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--texto-oscuro);
}

.separador {
    margin: 20px 0;
    position: relative;
    text-align: center;
}

.separador::before,
.separador::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
}

.separador::before { left: 0; }
.separador::after { right: 0; }

.boton-google {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.boton-google::before {
    content: 'G';
    font-weight: 900;
    color: #DB4437;
    font-size: 18px;
}

.enlace-registro {
    margin-top: 20px;
    font-size: 14px;
}

.enlace-registro a {
    color: var(--color-verde-oscuro);
    font-weight: bold;
    text-decoration: underline;
}

/* ---------- VISTA DASHBOARD ---------- */
#vista-dashboard {
    background: transparent;
    padding: 0;
}

.encabezado-dashboard {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin: 20px 20px 10px 20px;
}

.logo-header img {
    height: 35px;
    width: auto;
}

.boton-hamburguesa {
    background: transparent;
    border: none;
    color: var(--color-verde-oscuro);
    padding: 5px;
    width: auto;
    box-shadow: none;
}

.boton-hamburguesa:hover {
    transform: scale(1.1);
    box-shadow: none;
}

.boton-flotante {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-left: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    box-shadow: 0 4px 10px rgba(31, 38, 135, 0.1);
}

.icono-carrito {
    font-size: 20px;
}

.contador-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff5252;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Buscador */
.contenedor-buscador {
    padding: 0 20px 15px 20px;
}

.buscador {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    color: var(--texto-oscuro);
    outline: none;
    transition: all 0.3s ease;
}

/* Navegación Categorías */
.barra-categorias {
    display: flex;
    gap: 12px;
    padding: 0 20px 15px 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.barra-categorias::-webkit-scrollbar {
    display: none;
}

.btn-categoria {
    flex: 0 0 auto;
    width: auto;
    padding: 10px 18px;
    color: var(--texto-oscuro);
    font-size: 14px;
    font-weight: 600;
}

.btn-categoria.activo {
    background: rgba(160, 26, 22, 0.85) !important;
    color: var(--color-blanco) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 12px rgba(160, 26, 22, 0.4) !important;
}

/* Grid de Productos */
.contenido-dashboard {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 30px 20px;
}

.grid-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

/* Tarjetas Premium */
.tarjeta-producto {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-left: 1px solid rgba(255, 255, 255, 0.8);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radio-borde);
    padding: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    transition: all 0.3s ease;
}

.tarjeta-producto:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.12);
}

.imagen-producto {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.categoria-producto {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--color-verde-oscuro);
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.nombre-producto {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1.2;
    flex-grow: 1;
}

.precio-producto {
    font-size: 18px;
    color: #A01A16;
    font-weight: 900;
    margin-bottom: 15px;
}

.btn-agregar {
    padding: 12px;
    font-size: 13px;
}

/* ---------- MENÃš LATERAL Y OVERLAY ---------- */
.overlay-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.overlay-menu.oculta-menu {
    opacity: 0;
    pointer-events: none;
}

.menu-lateral {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 999;
    transform: translateX(0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-right: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 0 20px 20px 0;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
}

.menu-lateral.oculta-menu {
    transform: translateX(-100%);
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    color: var(--color-verde-oscuro);
}

.btn-cerrar {
    background: transparent;
    color: var(--color-verde-oscuro);
    font-size: 24px;
    width: auto;
    padding: 5px;
    box-shadow: none;
}

.btn-cerrar:hover {
    transform: rotate(90deg) scale(1.1);
}

.opciones-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.btn-opcion {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 1);
    color: var(--texto-oscuro);
    text-align: left;
    padding: 16px 20px;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 15px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.btn-opcion:hover {
    transform: translateX(5px);
}

.text-danger {
    color: #d32f2f;
    background: rgba(253, 237, 237, 0.9);
    border-color: rgba(250, 200, 200, 0.5);
}

/* Animaciones */
@keyframes aparecer {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---------- PANEL DEL CARRITO ---------- */
.panel-carrito {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100vh;
    max-height: 100vh;
    z-index: 999;
    transform: translateX(0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px 0 0 20px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
}

.panel-carrito.oculta-carrito {
    transform: translateX(100%);
}

.contenido-carrito {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.item-carrito {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.6);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.item-carrito img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.item-carrito-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-carrito-nombre {
    font-size: 13px;
    font-weight: bold;
    color: var(--texto-oscuro);
    line-height: 1.2;
    margin-bottom: 4px;
}

.item-carrito-precio {
    font-size: 14px;
    color: var(--color-verde-oscuro);
    font-weight: 800;
}

.item-carrito-controles {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cantidad {
    background: rgba(0,0,0,0.05);
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 5px;
    font-weight: bold;
    color: var(--texto-oscuro);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.btn-cantidad:hover {
    background: rgba(0,0,0,0.1);
    transform: scale(1.05);
}

.item-cantidad {
    font-size: 14px;
    font-weight: bold;
}

.footer-carrito {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 1rem;
    margin-top: auto;
    flex-shrink: 0;
}

.totales-carrito {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 900;
    color: var(--texto-oscuro);
    margin-bottom: 20px;
}

#total-carrito-precio {
    color: var(--color-verde-oscuro);
}


/* ---------- MODAL SÓLIDO ---------- */
.modal-solido {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    height: auto;
    z-index: 1000;
    padding: 25px;
    border-radius: 20px;
    background: rgba(250, 250, 250, 0.98);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 1);
}

/* Bloquear la insignia inyectada por Netlify */
#nl-badge-frame {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -9999 !important;
}


