/* VARIABLES Y RESET */
:root {
    --bg-color: #050508;
    --card-bg: #0c0c14;
    --text-main: #ffffff;
    --text-muted: #8b8b9f;
    --neon-cyan: #00f3ff;
    --neon-purple: #b900ff;
    --border-color: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    /* Fondo dinámico sutil para la tienda */
    background-image: 
        radial-gradient(circle at top left, rgba(0, 243, 255, 0.05), transparent 30%),
        radial-gradient(circle at bottom right, rgba(185, 0, 255, 0.05), transparent 30%);
    background-attachment: fixed;
    color: var(--text-main);
    overflow-x: hidden;
}

/* SCROLLBAR PREMIUM */
::-webkit-scrollbar { width: 8px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: #1a1a24; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--neon-cyan); }

/* NAVBAR */
.navbar {
    position: fixed;
    top: 0; width: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 5%;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.nav-left { display: flex; align-items: center; gap: 30px; }
.back-btn { 
    color: var(--text-muted); text-decoration: none; font-size: 14px; 
    display: flex; align-items: center; gap: 5px; transition: 0.3s;
}
.back-btn:hover { color: var(--neon-cyan); text-shadow: 0 0 8px rgba(0,243,255,0.4); transform: translateX(-3px); }

.logo { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.logo span { color: var(--neon-cyan); text-shadow: 0 0 10px rgba(0, 243, 255, 0.3); }

/* MENÚ DE CATEGORÍAS (Desplazable en móvil) */
.nav-categories { 
    display: flex; 
    gap: 15px; 
}
.cat-btn {
    background: transparent; border: none; color: var(--text-muted);
    font-size: 15px; font-weight: 600; cursor: pointer; transition: 0.3s;
    padding: 5px 12px; border-radius: 8px; white-space: nowrap; /* Evita que el texto se rompa */
}
.cat-btn:hover, .cat-btn.active { 
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
    box-shadow: 0 2px 10px rgba(0,243,255,0.1);
    border-bottom: 2px solid var(--neon-cyan);
}

.cart-icon {
    font-size: 28px; cursor: pointer; position: relative; transition: 0.3s;
}
.cart-icon:hover { color: var(--neon-cyan); transform: scale(1.1); }
.cart-count {
    position: absolute; top: -5px; right: -8px;
    background: var(--neon-purple); color: white;
    font-size: 12px; font-weight: bold;
    height: 18px; width: 18px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    box-shadow: 0 0 10px var(--neon-purple);
}

/* HERO SECTION */
.hero {
    height: 40vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center; margin-top: 60px;
    background: radial-gradient(circle at center, rgba(0, 243, 255, 0.08) 0%, transparent 60%);
}
.hero h1 { font-size: 52px; margin-bottom: 10px; letter-spacing: -1px; }
.hero h1 span {
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple), var(--neon-cyan));
    background-size: 200% auto;
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: shineText 3s linear infinite;
}
@keyframes shineText { to { background-position: 200% center; } }
.hero p { color: var(--text-muted); font-size: 17px; }

/* PRODUCT GRID */
.container { padding: 40px 5%; min-height: 50vh; }
.products-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 35px;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px; padding: 20px;
    transition: all 0.4s ease; position: relative;
    overflow: hidden;
}
.product-card::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%);
    opacity: 0; transition: 0.5s;
}
.product-card:hover {
    transform: translateY(-10px);
    border-color: rgba(0, 243, 255, 0.4);
    box-shadow: 0 15px 35px rgba(0, 243, 255, 0.15);
}
.product-card:hover::before { opacity: 1; }

.product-img {
    height: 180px; background: #13131c; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 20px; position: relative;
}

.product-img img {
    width: 100%; height: 100%; object-fit: contain; padding: 15px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.5s ease;
}

.product-card:hover .product-img img { 
    transform: scale(1.15) translateY(-5px); 
    filter: drop-shadow(0 15px 20px rgba(0, 243, 255, 0.25));
}

.product-cat { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; }
.product-title { font-size: 19px; margin: 8px 0; font-weight: 600; }

.product-prices { display: flex; flex-direction: column; margin-bottom: 20px; }
.price-usd { font-size: 22px; font-weight: 700; color: var(--neon-cyan); }
.price-ars { font-size: 14px; color: var(--text-muted); }

.add-btn {
    width: 100%; padding: 12px; border: none; border-radius: 10px;
    background: rgba(255,255,255,0.05); color: white;
    font-weight: 600; cursor: pointer; transition: 0.3s;
    display: flex; justify-content: center; align-items: center; gap: 8px;
    position: relative; overflow: hidden;
}
.add-btn:hover { 
    background: linear-gradient(90deg, var(--neon-cyan), #00a2ff); 
    color: #000; box-shadow: 0 5px 20px rgba(0,243,255,0.4); 
}

/* ANIMACIONES */
.fade-in { animation: fadeIn 0.8s ease forwards; opacity: 0; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* CARRITO LATERAL */
.cart-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(5px);
    z-index: 999; opacity: 0; pointer-events: none; transition: 0.3s;
}
.cart-overlay.active { opacity: 1; pointer-events: auto; }

.cart-sidebar {
    position: fixed; top: 0; right: -400px; width: 100%; max-width: 420px; height: 100vh;
    background: #08080c; border-left: 1px solid var(--border-color);
    z-index: 1000; transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    display: flex; flex-direction: column;
}
.cart-sidebar.active { right: 0; }

.cart-header { display: flex; justify-content: space-between; padding: 25px; border-bottom: 1px solid var(--border-color); }
.cart-header h2 { font-size: 22px; }
#close-cart { background: none; border: none; color: white; font-size: 32px; cursor: pointer; transition: 0.2s; }
#close-cart:hover { color: #ff3366; transform: rotate(90deg); }

.cart-items { flex: 1; overflow-y: auto; padding: 25px; display: flex; flex-direction: column; gap: 15px; }

.cart-item {
    display: flex; gap: 15px; align-items: center; background: rgba(255,255,255,0.02);
    padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
}
.cart-item:hover { border-color: rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); }

.cart-item-img { 
    width: 60px; height: 60px; object-fit: contain; 
    background: #13131c; padding: 5px; border-radius: 10px; 
}

.item-details { flex: 1; }
.item-details h4 { font-size: 15px; margin-bottom: 5px; }
.item-details p { font-size: 14px; color: var(--neon-cyan); font-weight: bold; }
.remove-btn { background: none; border: none; color: #ff3366; font-size: 22px; cursor: pointer; transition: 0.2s;}
.remove-btn:hover { transform: scale(1.2); }

.cart-footer { padding: 30px; border-top: 1px solid var(--border-color); background: #050508; }
.total-row { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--text-muted); }
.total-row.highlight { color: white; font-size: 20px; font-weight: bold; margin-bottom: 25px; }

.checkout-btn {
    width: 100%; padding: 16px; border: none; border-radius: 12px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    color: white; font-size: 17px; font-weight: bold; cursor: pointer;
    box-shadow: 0 5px 20px rgba(185, 0, 255, 0.3); transition: 0.3s;
}
.checkout-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0, 243, 255, 0.5); }


/* RESPONSIVE MÓVIL */
@media (max-width: 768px) {
    .navbar { flex-wrap: wrap; padding: 15px; }
    
    /* MEJORA 1: Menú de categorías con scroll horizontal en celular */
    .nav-categories { 
        order: 3; 
        width: 100%; 
        justify-content: flex-start; /* Alineado a la izq para notar el scroll */
        margin-top: 15px; 
        overflow-x: auto; /* Permite deslizar hacia los lados */
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
        /* Oculta la barra de scroll estéticamente pero funciona el dedo */
        scrollbar-width: none; 
    }
    .nav-categories::-webkit-scrollbar { display: none; }

    .hero h1 { font-size: 38px; }
    .cart-sidebar { max-width: 100%; }

    /* MEJORA 2: 2 productos por fila en móvil */
    .container { padding: 30px 10px; }
    .products-grid { 
        grid-template-columns: repeat(2, 1fr); /* Fuerza 2 columnas */
        gap: 15px; /* Reduce el espacio entre tarjetas */
    }
    
    /* Ajustes para que la tarjeta de producto encaje bien en media pantalla */
    .product-card { padding: 12px; border-radius: 12px; }
    .product-img { height: 120px; margin-bottom: 10px; border-radius: 8px;}
    .product-title { font-size: 14px; margin: 5px 0; }
    .product-cat { font-size: 10px; }
    .price-usd { font-size: 16px; }
    .price-ars { font-size: 12px; }
    .add-btn { padding: 8px; font-size: 13px; border-radius: 8px; }
    .add-btn i { font-size: 16px; }
}