/* css/theme.css - VERSIÓN PREMIUM CONSOLIDADA */

:root {
    /* Paleta Bake Sale (Extraída de la imagen de portada) */
    --color-primary: #5BC0BE;     /* Turquesa pastel */
    --color-secondary: #B4DC7F;   /* Verde lima pastel */
    --color-accent: #4A0F61;      /* Púrpura oscuro (Botones principales) */
    --color-success: #28A745;     /* Verde éxito estándar para el Toast */
    --color-bg: #F8F9FA;          /* Fondo base crema muy claro/grisáceo */
    --color-surface: #FFFFFF;     /* Fondo de tarjetas puro */
    --color-text: #212529;        /* Texto principal */
    --color-text-muted: #6C757D;  /* Texto secundario */
    --color-oferta: #F05D5E;      /* Coral pastel (Ofertas y alertas) */

    /* Variables estructurales PREMIUM */
    --font-main: 'Inter', system-ui, sans-serif;
    --border-radius: 16px;
    --shadow-sm: 0 4px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.12);
    --transition: all 0.2s ease-in-out;
}

/* Reset Básico */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    padding-bottom: 80px;
}

/* Encabezado Premium */
header {
    background-color: var(--color-primary);
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.logo-container img {
    height: 40px;
}
.logo-container h1 {
    font-size: 1.5rem;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    color: var(--color-accent);
}

.cart-icon {
    position: relative;
    background: var(--color-surface);
    color: var(--color-accent);
    padding: 0.6rem;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.cart-icon:hover {
    transform: scale(1.05);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--color-oferta);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Filtros de Categoría */
.categorias-nav {
    display: flex;
    gap: 0.8rem;
    padding: 1.2rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.categorias-nav::-webkit-scrollbar { display: none; }

.btn-categoria {
    background-color: var(--color-surface);
    border: none;
    color: var(--color-text);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: bold;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.btn-categoria:hover { background-color: #EEE; }
.btn-categoria.activa {
    background-color: var(--color-accent);
    color: white;
}

/* Grilla de Productos */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.2rem;
    padding: 0 1.2rem 1.2rem 1.2rem;
}

/* Tarjeta de Producto */
.producto-card {
    background-color: var(--color-surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition);
}
.producto-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.oferta-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--color-oferta);
    color: white;
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-weight: bold;
    z-index: 2;
}

.producto-img-container {
    width: 100%;
    height: 150px;
    overflow: hidden;
}
.producto-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #EEE;
    transition: var(--transition);
}
.producto-card:hover .producto-img { transform: scale(1.05); }

.producto-info { padding: 1rem; flex-grow: 1; display: flex; flex-direction: column; }
.producto-titulo { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.producto-desc { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 0.8rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.producto-precio-row { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 1rem; }
.producto-precio { font-weight: 900; color: var(--color-accent); font-size: 1.2rem; }
.producto-precio-old { font-size: 0.85rem; color: var(--color-text-muted); text-decoration: line-through; }

.btn-agregar {
    background-color: var(--color-accent);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin-top: auto;
    transition: var(--transition);
}
.btn-agregar:hover { background-color: var(--color-primary); color: var(--color-accent); }

/* --- Off-Canvas Carrito --- */
.cart-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 999;
    opacity: 0; visibility: hidden; transition: var(--transition);
}
.cart-overlay.activo { opacity: 1; visibility: visible; }

.cart-sidebar {
    position: fixed; top: 0; right: -100%;
    width: 100%; max-width: 380px; height: 100%;
    background-color: var(--color-surface); z-index: 1000;
    transition: right 0.3s ease;
    display: flex; flex-direction: column;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
}
.cart-sidebar.activo { right: 0; }

.cart-header {
    padding: 1.2rem; background-color: var(--color-primary);
    color: var(--color-accent);
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 900; font-size: 1.2rem;
}
.btn-cerrar { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--color-accent); }

.cart-body { padding: 1rem; flex-grow: 1; overflow-y: auto; background-color: var(--color-bg); }
.cart-item {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--color-surface); padding: 1rem;
    border-radius: 10px; margin-bottom: 0.8rem;
    box-shadow: var(--shadow-sm);
}
.cart-item-info h4 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.cart-item-precio { color: var(--color-accent); font-weight: 900; }
.btn-eliminar { background: var(--color-oferta); color: white; border: none; padding: 0.4rem 0.8rem; border-radius: 6px; cursor: pointer; }

.cart-footer { padding: 1.5rem; background: var(--color-surface); border-top: 2px solid #EEE; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.4rem; font-weight: 900; margin-bottom: 1.5rem; }
.btn-pagar { background: var(--color-accent); color: white; border: none; padding: 1rem; width: 100%; border-radius: 10px; font-size: 1.1rem; font-weight: bold; cursor: pointer; text-align: center; display: block; text-decoration: none; transition: var(--transition); }
.btn-pagar:hover { opacity: 0.9; }

/* NUEVO: Toast centrado y contrastado (Verde Éxito) */
.toast-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background-color: var(--color-success);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Animación elástica */
    text-align: center;
    width: 80%;
    max-width: 350px;
}
.toast-notification.mostrar {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Footer Global */
.main-footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border-top: 1px dashed #CCC;
    margin-top: 2rem;
}

/* NUEVO: Controles de cantidad en el carrito */
.cart-item-controles {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0.5rem 0;
}
.btn-cant {
    background-color: #F8F9FA;
    border: 1px solid #DDD;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--color-text);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
}
.btn-cant:hover {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.cart-item-cantidad {
    font-weight: bold;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}


/* ============================================= */
/* --- ESTILOS CORREGIDOS POP-UP FLOTANTE ---- */
/* ============================================= */

/* Capa de fondo difuminado y oscuro (Overlay) */
.popup-overlay {
    display: none; /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7); /* Fondo oscuro semitransparente */
    z-index: 99999; /* Asegura que esté por encima de TODO */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px); /* Efecto de difuminado del fondo */
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px; /* Margen de seguridad en móviles */
}

/* Cuando el pop-up está activo */
.popup-overlay.activo {
    display: flex;
    opacity: 1;
}

/* Ventana flotante blanca (Content) */
.popup-content {
    background-color: var(--color-surface); /* Blanco desde theme.css */
    padding: 40px;
    border-radius: 20px;
    max-width: 480px; /* Ancho controlado para PC */
    width: 100%; /* Responsive en móviles */
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    text-align: center;
    position: relative; /* Para el botón 'X' */
    
    /* Animación de entrada (Pop-in) */
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* Animación cuando está activo */
.popup-overlay.activo .popup-content {
    transform: scale(1);
}

/* Botón 'X' para cerrar en la esquina */
.popup-close-x {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
}
.popup-close-x:hover {
    color: var(--color-primary);
}

/* Contenedor del Logo */
.popup-logo-container {
    margin-bottom: 25px;
}
.popup-logo {
    max-width: 120px; /* Tamaño controlado */
    height: auto;
}

/* Títulos y Textos del Pop-up (Usando theme.css) */
.popup-titulo {
    font-family: var(--font-heading); /* Playfair Display */
    color: var(--color-primary); /* #a78bfa */
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 700;
}
.popup-text {
    font-family: var(--font-body); /* Quicksand */
    color: var(--color-text); /* #4B5563 */
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}
.popup-btn-cta {
    width: 100%; /* Botón ancho total en el popup */
    font-size: 1.1rem;
    padding: 15px;
}


/* ============================================= */
/* --- ESTILOS HERO Y FILTROS EN PÁGINA ------ */
/* ============================================= */
.hero-intro {
    padding: 30px 15px;
    background-color: #f3f0ff; 
    border-radius: 15px;
    margin-top: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.hero-text {
    font-size: 0.9rem; /* Reducido para que sea más sutil */
    color: var(--color-text);
    line-height: 1.5;
    max-width: 700px;
    margin: 0 auto;
}

.category-filter-title {
    text-align: center;
    font-size: 0.95rem; /* Achicado para que no compita visualmente */
    color: var(--color-text);
    margin-bottom: 15px;
    font-weight: 600;
}

.current-category-label {
    text-align: center;
    color: var(--color-primary); /* Toma el color principal (Turquesa) del header */
    font-family: var(--font-main); /* Misma fuente estándar que "Filtra tus antojos" */
    font-size: 1.1rem; /* Reducido para integrarse mejor */
    margin: 20px 0 15px;
    font-weight: 700;
}


/* ======================================= */
/* Estilos para las instrucciones de pago */
/* ===================================== */

/* Estilos para las instrucciones de pago */
.instrucciones-pago {
    background: #fdf2f8; /* Un rosado muy suave */
    border: 2px dashed var(--color-primary);
    border-radius: 12px;
    padding: 1.2rem;
    margin: 1rem 0;
    display: none; /* Se activa por JS */
}

.instrucciones-pago h4 { margin-top: 0; color: var(--color-primary); display: flex; align-items: center; gap: 8px; }

.paso-pago { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; font-size: 0.95rem; }
.paso-pago .numero-paso { 
    background: var(--color-primary); color: white; border-radius: 50%; 
    width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; 
    font-size: 0.8rem; font-weight: bold; flex-shrink: 0; margin-top: 2px;
}

.box-numero {
    background: white; border: 1px solid #ddd; padding: 5px 10px; 
    border-radius: 6px; display: inline-flex; align-items: center; gap: 10px; margin-top: 5px;
}
.btn-copiar { 
    background: var(--color-secondary); color: white; border: none; 
    padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; cursor: pointer; 
}