/* =========================================
   1. VARIABLES & RESET GLOBAL
   ========================================= */
   :root {
    --bg-color: #09090b;       /* Fondo Principal */
    --card-bg: #18181b;        /* Fondo Tarjetas Sólidas */
    /* Nuevo: Fondo para efecto vidrio */
    --glass-bg: rgba(24, 24, 27, 0.7); 
    --input-bg: #27272a;       /* Fondo Inputs */
    --text-main: #ffffff;      /* Texto Blanco */
    --text-muted: #a1a1aa;     /* Texto Gris */
    --accent: #6366f1;         /* Color Principal (Indigo) */
    --accent-glow: rgba(99, 102, 241, 0.4);
    --error: #ef4444;          /* Rojo alertas */
    --success: #22c55e;        /* Verde éxito */
    --font-main: 'Inter', sans-serif;
    --border-radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }
body { font-family: var(--font-main); background-color: var(--bg-color); color: var(--text-main); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* =========================================
   2. NAVBAR (ESTILO TRANSPARENTE RESTAURADO)
   ========================================= */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 5%;
    
    /* ESTILO VIDRIO ELEGANTE */
    background: rgba(0, 0, 0, 0.3); /* Muy transparente */
    backdrop-filter: blur(20px);    /* Desenfoque fuerte */
    -webkit-backdrop-filter: blur(20px); /* Para Safari */
    border-bottom: 1px solid rgba(255,255,255,0.05);
    
    position: fixed; width: 100%; top: 0; z-index: 1000;
    transition: all 0.3s ease;
}
.logo-text { font-weight: 900; font-size: 1.4rem; letter-spacing: -0.5px; }
.logo-text .accent { color: var(--accent); }

.nav-links { display: flex; gap: 2rem; }
.nav-links a { color: rgba(255,255,255,0.7); font-weight: 500; font-size: 0.9rem; }
.nav-links a:hover { color: white; }

.nav-actions { display: flex; align-items: center; gap: 1rem; }
.login-btn-nav { background: var(--accent); padding: 0.5rem 1.2rem; border-radius: 50px; font-size: 0.85rem; font-weight: 600; color: white; }
.cart-icon { position: relative; font-size: 1.4rem; cursor: pointer; color: rgba(255,255,255,0.8); transition: 0.3s; }
.cart-icon:hover { color: white; transform: scale(1.1); }
#cart-count { position: absolute; top: -5px; right: -8px; background: var(--accent); font-size: 0.7rem; padding: 2px 6px; border-radius: 10px; font-weight: bold; color: white; }
.user-avatar { width: 35px; height: 35px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.2); cursor: pointer; }

/* =========================================
   3. HERO & LAYOUT
   ========================================= */
.page-container { padding: 7rem 5% 4rem; min-height: 80vh; }
.hero { padding: 8rem 10% 5rem; min-height: 95vh; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
h1 { font-size: 3.5rem; font-weight: 900; line-height: 1.1; margin-bottom: 1rem; }
.gradient-text { background: linear-gradient(45deg, var(--accent), #fff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.badge { background: rgba(255,255,255,0.05); border: 1px solid var(--accent); color: var(--accent); padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; display: inline-block; margin-bottom: 1rem; }
.hero-image img { border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); width: 100%; max-width: 650px; animation: float 6s infinite ease-in-out; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

.hero-btns { display: flex; gap: 1rem; margin-top: 1.5rem; }
.cta-btn, .checkout-btn { background: var(--accent); color: white; padding: 0.9rem 1.5rem; border-radius: 50px; font-weight: 700; border: none; display: inline-block; width: 100%; text-align: center; transition: 0.3s; }
.cta-btn:hover, .checkout-btn:hover { transform: translateY(-3px); box-shadow: 0 0 30px var(--accent-glow); }
.secondary-btn { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: white; }
.secondary-btn:hover { background: rgba(255,255,255,0.1); border-color: white; }

/* =========================================
   4. PRODUCTOS & CATALOGO
   ========================================= */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; }
.search-bar { padding: 14px 24px; border-radius: 50px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.05); color: white; width: 100%; max-width: 500px; outline: none; transition: 0.3s; font-size: 1rem; backdrop-filter: blur(5px); }
.search-bar:focus { border-color: var(--accent); background: rgba(0,0,0,0.2); }

.products-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2.5rem; width: 100%; }

.product-card {
    background: var(--card-bg); border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.05); overflow: hidden;
    display: flex; flex-direction: column; position: relative; transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.product-card:hover { transform: translateY(-7px); border-color: var(--accent); box-shadow: 0 20px 40px rgba(99, 102, 241, 0.2); }
.discount-badge { position: absolute; top: 12px; right: 12px; background: #ef4444; color: white; padding: 5px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 800; z-index: 10; }
.product-card img { width: 100%; height: 240px; object-fit: cover; }

.card-body { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.card-body h3 { font-size: 1.2rem; margin-bottom: 0.5rem; font-weight: 700; }
.price-container { margin-top: auto; margin-bottom: 1rem; }
.old-price { text-decoration: line-through; color: #666; font-size: 0.9rem; margin-right: 8px; }
.current-price { color: var(--accent); font-weight: 900; font-size: 1.3rem; }

.card-actions { display: flex; gap: 10px; }
.btn-small { padding: 12px; border-radius: 10px; flex: 1; border: none; cursor: pointer; font-weight: 600; font-size: 0.9rem; transition: 0.3s; }
.btn-details { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: #ccc; }
.btn-details:hover { border-color: white; color: white; background: rgba(255,255,255,0.05); }
.btn-add { background: var(--accent); color: white; }
.btn-add:hover { filter: brightness(1.1); box-shadow: 0 5px 15px var(--accent-glow); }

/* =========================================
   5. MODALES (CARRITO LATERAL "DE VIDRIO")
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Fondo un poco más claro para ver el efecto */
    z-index: 2000;
    display: none;
    backdrop-filter: blur(5px);
    justify-content: center; align-items: center;
}
.modal-overlay.open { display: flex; }

/* === CARRITO LATERAL TRANSPARENTE === */
.cart-modal-overlay {
    justify-content: flex-end;
    align-items: stretch;
}

.cart-modal {
    /* ESTILO VIDRIO */
    background: rgba(18, 18, 21, 0.85); /* Semitransparente */
    backdrop-filter: blur(30px);        /* Desenfoque fuerte */
    -webkit-backdrop-filter: blur(30px);
    border-left: 1px solid rgba(255,255,255,0.1); /* Borde sutil */
    box-shadow: -10px 0 40px rgba(0,0,0,0.5); /* Sombra de profundidad */

    width: 100%; max-width: 420px; height: 100%;
    padding: 2.5rem; display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-overlay.open .cart-modal { transform: translateX(0); }

.cart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.cart-header h2 { font-size: 1.8rem; font-weight: 800; }
.close-btn { background: none; border: none; color: rgba(255,255,255,0.6); font-size: 1.8rem; transition: 0.3s; }
.close-btn:hover { color: white; transform: rotate(90deg); }

.cart-items { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; padding-right: 5px; }
/* Scrollbar bonita para el carrito */
.cart-items::-webkit-scrollbar { width: 5px; }
.cart-items::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

.cart-item { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.03); padding: 15px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }

.total-row { display: flex; justify-content: space-between; font-weight: 800; font-size: 1.4rem; margin-bottom: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem; }

/* === MODAL CENTRALES (Sólidos para contraste) === */
.product-modal {
    background: var(--card-bg); width: 90%; max-width: 500px;
    padding: 2.5rem; border-radius: 20px; border: 1px solid rgba(255,255,255,0.08);
    position: relative; animation: zoomIn 0.3s ease; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* === EMBED DE SEGURIDAD === */
.security-card {
    background: #131316; padding: 3rem; border-radius: 24px;
    border: 2px solid #ef4444; text-align: center; max-width: 420px; width: 90%;
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.25);
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.security-icon { font-size: 4rem; margin-bottom: 1.5rem; animation: shake 0.6s ease-in-out; display: inline-block; text-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
.security-card h2 { color: #ef4444; font-size: 2rem; margin-bottom: 0.5rem; text-transform: uppercase; font-weight: 900; }
.security-card p { color: rgba(255,255,255,0.7); margin-bottom: 2.5rem; font-size: 1.1rem; }
.security-actions { display: flex; gap: 1rem; justify-content: center; }

@keyframes zoomIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes popIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px) rotate(-4deg); } 40% { transform: translateX(6px) rotate(4deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

/* =========================================
   6. FORMULARIOS & EXTRAS
   ========================================= */
.auth-container { width: 100%; max-width: 420px; margin: 0 auto; background: var(--card-bg); padding: 3rem; border-radius: 24px; border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.form-group { margin-bottom: 1.5rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.6rem; color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
.form-group input, .form-group select { width: 100%; padding: 14px 18px; background: var(--input-bg); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; color: white; outline: none; font-size: 1rem; transition: 0.3s; }
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); background: rgba(255,255,255,0.05); }
.auth-toggle { text-align: center; margin-top: 2rem; color: var(--text-muted); font-size: 1rem; }
.auth-toggle span { color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; }

#toast-container { position: fixed; bottom: 30px; right: 30px; z-index: 3000; display: flex; flex-direction: column; gap: 15px; }
.toast { background: rgba(24, 24, 27, 0.95); backdrop-filter: blur(10px); padding: 1rem 1.8rem; border-radius: 12px; border-left: 5px solid var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,0.5); animation: slideUp 0.4s ease-out; display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1rem; border: 1px solid rgba(255,255,255,0.05); }
.toast.error { border-left-color: #ef4444; }
@keyframes slideUp { from{transform:translateY(30px); opacity:0;} to{transform:translateY(0); opacity:1;} }

.whatsapp-float { position: fixed; bottom: 40px; left: 40px; width: 65px; height: 65px; background-color: #25d366; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4); z-index: 1000; transition: 0.3s; }
.whatsapp-float:hover { transform: scale(1.1) rotate(10deg); }
.scroll-top-btn { position: fixed; bottom: 40px; right: 40px; width: 55px; height: 55px; background: var(--card-bg); color: white; border: 1px solid rgba(255,255,255,0.1); border-radius: 50%; font-size: 1.5rem; display: none; z-index: 999; align-items: center; justify-content: center; cursor: pointer; transition: 0.3s; box-shadow: 0 5px 20px rgba(0,0,0,0.3); }
.scroll-top-btn.visible { display: flex; animation: popIn 0.3s; }
.scroll-top-btn:hover { background: var(--accent); border-color: var(--accent); transform: translateY(-5px); }

footer { background: #050507; padding: 5rem 5% 3rem; border-top: 1px solid rgba(255,255,255,0.05); margin-top: 6rem; }
.footer-content { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3rem; max-width: 1200px; margin: 0 auto 3rem; }
.footer-links a { color: rgba(255,255,255,0.6); margin-left: 1.5rem; font-weight: 500; transition: 0.3s; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { text-align: center; color: rgba(255,255,255,0.4); padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.05); }

@media (max-width: 768px) {
    .navbar { padding: 1rem 1.5rem; }
    .nav-links { display: none; }
    .hero { flex-direction: column; text-align: center; padding: 7rem 1.5rem 4rem; }
    .hero-btns { justify-content: center; }
    h1 { font-size: 2.8rem; }
    .products-grid { grid-template-columns: 1fr; gap: 2rem; }
    .cart-modal { width: 100%; max-width: none; }
    .page-container { padding: 5rem 1.5rem 3rem; }
    .search-bar { width: 100%; }
    .whatsapp-float { bottom: 20px; left: 20px; width: 55px; height: 55px; }
    .scroll-top-btn { bottom: 20px; right: 20px; }
}