/* =========================================
   VARIABLES GLOBALES Y RESET
   ========================================= */
:root {
    /* Paleta de Colores basada en el logo */
    --bg-dark: #0a0a0a;
    --bg-surface: #1a1a1a;
    --primary-green: #39FF14;
    /* Ajustaremos según el verde del logo */
    --primary-green-hover: #2cd40f;
    --text-light: #f3f4f6;
    --text-muted: #9ca3af;

    /* Sombras y Efectos */
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);

    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* =========================================
   NAVBAR (Glassmorphism)
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: var(--glass-border);
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
    border-radius: 50%;
    /* Si el logo es circular */
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.2);
}

/* =========================================
   CATÁLOGO Y TARJETAS DE PRODUCTO
   ========================================= */
.catalogo-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

/* Botones de Filtro Estilizados */
.filtros {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-green);
    color: var(--bg-dark);
    border-color: var(--primary-green);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
}

/* El Grid Mágico (Responsive automático) */
.grid-container {
    display: grid;
    /* En móviles: 1 columna, en tablets: 2, en PC: 3 o 4 */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

/* Diseño de la Tarjeta (Glassmorphism + Neumorphism oscuro) */
.product-card {
    background: var(--bg-surface);
    border: var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: var(--transition-smooth);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 10px rgba(57, 255, 20, 0.1);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-category {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary-green);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.product-prices {
    margin-top: auto;
    margin-bottom: 1.5rem;
}

.price-usd {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

.price-bs {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-add-cart {
    background: var(--primary-green);
    color: var(--bg-dark);
    border: none;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-add-cart:hover {
    background: var(--primary-green-hover);
    transform: scale(1.02);
}

/* =========================================
   HERO SECTION Y UTILIDADES
   ========================================= */
.hero {
    margin-top: 100px;
    /* Evita que el Navbar fijo tape el texto */
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-green);
}

.hidden {
    display: none !important;
}

/* =========================================
   CARRITO LATERAL (OFFCANVAS)
   ========================================= */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    /* Lo escondemos fuera de la pantalla por defecto */
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: var(--bg-surface);
    border-left: var(--glass-border);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
    transition: right var(--transition-smooth);
    z-index: 1001;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

/* Esta clase la agregaremos con JS cuando el cliente haga clic en el botón */
.cart-sidebar.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.close-btn:hover {
    color: var(--primary-green);
}

.cart-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

/* =========================================
   FILTROS DE CATEGORÍAS (Scroll Horizontal)
   ========================================= */
.filtros-wrapper {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 15px; /* Espacio para el scroll */
    margin-bottom: 2rem;
    /* Ocultar barra de scroll en navegadores modernos manteniendo la función */
    scrollbar-width: none; 
}
.filtros-wrapper::-webkit-scrollbar {
    display: none;
}

.filtros {
    display: flex;
    gap: 1rem;
    width: max-content; /* Clave para que no se amontonen y hagan scroll */
    margin: 0 auto;
    padding: 0 1rem;
}

/* =========================================
   CARRITO DE COMPRAS VIP
   ========================================= */
.cart-items-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 15px;
}

/* Scrollbar personalizada y elegante para el carrito */
.cart-items-container::-webkit-scrollbar {
    width: 6px;
}
.cart-items-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}
.cart-items-container::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 10px;
}

.cart-item {
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    align-items: center;
    transition: var(--transition-fast);
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.cart-item-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
    line-height: 1.2;
    margin-bottom: 5px;
}

.cart-item-price {
    color: var(--primary-green);
    font-size: 0.85rem;
    font-weight: 700;
}

.cart-item-qty {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.btn-checkout {
    background: var(--primary-green);
    color: var(--bg-dark);
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 1rem;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(57, 255, 20, 0.3);
}

/* =========================================
   BOTÓN DE CARRITO PREMIUM Y BADGE
   ========================================= */
.cart-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.8rem; /* Ícono más grande y vistoso */
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
}

.cart-btn:hover {
    color: var(--primary-green);
    transform: scale(1.1); /* Pequeño salto al pasar el mouse */
}

.badge {
    position: absolute;
    top: -5px;
    right: -12px;
    background: var(--primary-green);
    color: var(--bg-dark);
    font-size: 0.8rem;
    font-weight: 800;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(57, 255, 20, 0.6); /* Brillo verde */
    border: 2px solid var(--bg-dark); /* Borde para separarlo del ícono */
}

/* =========================================
   PANEL ADMINISTRATIVO (ADMIN.HTML)
   ========================================= */
.admin-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-main {
    margin-top: 100px;
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.admin-card {
    background: var(--bg-surface);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 500px; /* Para el login */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
}

.form-group input, 
.form-group select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-group input:focus, 
.form-group select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
}

/* Layout del Dashboard */
.admin-dashboard {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: var(--glass-border);
    padding-bottom: 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   UI PREMIUM: FILE UPLOAD, TOASTS Y CRUD
   ========================================= */

/* Zona de Drag & Drop para Imágenes */
.file-drop-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2rem;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    transition: var(--transition-fast);
    text-align: center;
    cursor: pointer;
}

.file-drop-area:hover, .file-drop-area.is-active {
    border-color: var(--primary-green);
    background: rgba(57, 255, 20, 0.05);
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    cursor: pointer;
    opacity: 0; /* Ocultamos el input feo pero mantenemos su funcionalidad */
}

.file-msg {
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.9rem;
    pointer-events: none;
}

.file-msg i {
    font-size: 2.5rem;
    color: var(--primary-green);
}

/* Notificaciones Toast (Reemplazo del alert) */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-surface);
    border-left: 4px solid var(--primary-green);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast.error {
    border-left-color: #ff3333;
}
.toast.error i { color: #ff3333; }
.toast.success i { color: var(--primary-green); }

@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Botones de Editar y Eliminar en la Lista */
.admin-list-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition-fast);
}

.btn-edit { color: #4facfe; }
.btn-edit:hover { color: #00f2fe; transform: scale(1.2); }
.btn-delete { color: #ff3333; }
.btn-delete:hover { color: #ff0000; transform: scale(1.2); }