/* public/assets/css/shop.css */

:root {
    --primary-glow: #4f46e5;
    --accent-glow: #8b5cf6;
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.03);

    /* ✅ Theme defaults (se sobreescriben desde shop.php con variables CSS) */
    --store-header-bg: rgba(15, 23, 42, 0.95);
    --store-header-border: rgba(255, 255, 255, 0.05);

    --store-bg-color: #0f172a;
    --store-bg-gradient:
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%);
    --store-bg-overlay: rgba(0,0,0,0.35);

    /* ✅ NUEVO: permite que el fondo "activo" se controle sin pelear con fallbacks */
    --store-bg-active: var(--store-bg-gradient);
}

/* ✅ Layer de fondo global (NO tapa productos) */
.store-bg{
    position: fixed;
    inset: 0;
    z-index: 0;

    /* ✅ IMPORTANTE: fondo activo (por defecto = gradiente) */
    background-color: var(--store-bg-color);
    background-image: var(--store-bg-active);

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    pointer-events: none;
}

.store-overlay{
    position: fixed;
    inset: 0;
    z-index: 1;
    background: var(--store-bg-overlay);
    pointer-events: none;
}

.store-app{
    position: relative;
    z-index: 2;
    min-height: 100vh;
}

body {
    background-color: var(--bg-dark);
    color: white;
    font-family: 'Inter', sans-serif;

    /* ✅ CAMBIO CLAVE: body ya NO mete background-image (para que reset se note SIEMPRE) */
    background-image: none;
    background-size: auto;
    background-attachment: scroll;

    min-height: 100vh;
}

/* --- NAVBAR (Glassmorphism) --- */
.navbar-glass {
    /* ✅ ahora el admin puede cambiar el color */
    background: var(--store-header-bg, rgba(15, 23, 42, 0.95));
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--store-header-border, rgba(255, 255, 255, 0.05));
}

/* ✅ Logo desde admin */
.store-logo{
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
    display: inline-block;
}

.dropdown-menu-dark {
    background-color: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-item { color: #cbd5e1; }
.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

/* --- HERO SECTION --- */
.hero-section {
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
}

.hero-title {
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

/* --- TARJETAS DE PRODUCTO --- */
.product-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-glow);
    box-shadow: 0 20px 40px -15px rgba(79, 70, 229, 0.3);
}

/* Contenedor de Imagen */
.card-img-wrapper {
    position: relative;
    height: 200px; /* Altura estándar PC */
    overflow: hidden;
    background: #1e293b;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.1);
}

/* Badge de Stock */
.stock-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #4ade80;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

/* Cuerpo de la tarjeta */
.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.card-desc {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.5;
    flex-grow: 1;
}

/* Footer de tarjeta */
.card-footer-custom {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}

/* Botón Carrito */
.btn-cart {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    transition: 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-cart:hover {
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.5);
    transform: scale(1.05);
    color: white;
}

/* --- OPTIMIZACIÓN MÓVIL (Compacto tipo App) --- */
@media (max-width: 768px) {
    .hero-section { padding: 30px 0 20px; }
    .hero-title { font-size: 1.8rem; }

    .card-img-wrapper { height: 140px; }
    .card-body { padding: 1rem; }
    .card-title { font-size: 1rem; }
    .card-desc {
        font-size: 0.85rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .price { font-size: 1.25rem; }
    .btn-cart { padding: 8px 15px; font-size: 0.9rem; }
}

/* --- ESTADOS DE STOCK --- */
.stock-badge.available {
    background: rgba(0, 0, 0, 0.6);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.stock-badge.out {
    background: rgba(0, 0, 0, 0.8);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.product-card.disabled {
    opacity: 0.7;
    filter: grayscale(0.8);
    cursor: not-allowed;
}

.product-card.disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.08);
}

.btn-cart:disabled {
    background: #334155;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}
