/* =========================================
   css/global.css - Variables y Base
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;600;700&display=swap');

:root {
    --primary: #8B1818; /* Burdeos / Rojo clásico */
    --primary-glow: rgba(139, 24, 24, 0.5);
    --dark-bg: #1a1515; /* Fondo oscuro cálido */
    --card-bg: #ffffff;
    --text-main: #2d2424;
    --text-muted: #736b6b;
    --border-color: #e8e2e2;
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    overflow-x: hidden;
    /* Las propiedades que ya tenías: */
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #f8fafc;
    color: var(--text-main);
}

/* Navbar Moderna */
.navbar {
    background-color: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 15px 0;
}

.navbar-brand { font-weight: 700; letter-spacing: -1px; }

/* Botones con estilo Tech */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 20px;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    border: none;
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--primary-glow);
}

/* ==========================================
   Efecto Cinta "AGOTADO" Diagonal
   ========================================== */
.product-card-container {
    position: relative;
    overflow: hidden; /* Crucial para que la cinta no se salga de la tarjeta */
}

.ribbon-wrapper {
    width: 150px;
    height: 150px;
    overflow: hidden;
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 10;
}

.ribbon-sold-out {
    font-weight: bold;
    font-size: 0.75rem;
    color: #fff;
    text-transform: uppercase;
    text-align: center;
    line-height: 20px;
    transform: rotate(45deg);
    position: relative;
    padding: 7px 0;
    left: -5px;
    top: 30px;
    width: 200px;
    background-color: #ef4444; /* Rojo intenso */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    letter-spacing: 1px;
}

.text-decoration-line-through {
    font-size: 0.9rem;
    opacity: 0.7;
}

.badge.bg-danger {
    font-size: 0.7rem;
    vertical-align: middle;
    padding: 4px 8px;
    border-radius: 50px;
}

/* ==========================================
   NAVEGACIÓN MÓVIL (APP STYLE)
   ========================================== */
.mobile-bottom-nav {
    display: none; /* Oculto por defecto en PC */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffffff;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
    z-index: 1050;
    padding: 0.5rem 0;
    justify-content: space-around;
    border-top: 1px solid #e9ecef;
}

.mobile-bottom-nav .nav-item {
    text-decoration: none;
    color: #6c757d; /* Gris para inactivos */
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s ease;
    width: 20%;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

/* Estado activo (color primario burdeos de la librería) */
.mobile-bottom-nav .nav-item.active {
    color: var(--primary); 
}

/* Botón Flotante de WhatsApp Más Pequeño */
.btn-whatsapp-float {
    position: fixed;
    bottom: 75px; /* Flota justo arriba de la barra inferior */
    right: 15px;
    background-color: #25D366;
    color: white;
    border-radius: 50%;
    width: 45px;  /* Reducido a 45px */
    height: 45px; /* Reducido a 45px */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem; /* Ícono un poco más compacto */
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4);
    z-index: 1040;
    transition: transform 0.3s ease;
}

.btn-whatsapp-float:hover {
    transform: scale(1.1);
    color: white;
}

/* Responsive: Activar la barra solo en móviles y tablets */
/* Responsive: Activar la barra solo en móviles y tablets */
@media (max-width: 991px) {
    .mobile-bottom-nav { 
        display: flex; 
    }
    body { 
        padding-bottom: 70px; /* Evita que el footer quede tapado por la barra */
    }
    /* Centrar el logo en móviles */
    .navbar > .container {
        justify-content: space-between;
    }
}

/* ==========================================
   SCROLL HORIZONTAL MÓVIL (CAROUSEL NATIVO)
   ========================================== */
.scroll-mobile-x {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Oculta scrollbar en Firefox */
    -ms-overflow-style: none;  /* Oculta scrollbar en IE y Edge */
    padding-bottom: 10px; /* Espacio para la sombra de las tarjetas */
}

/* Oculta scrollbar en Chrome, Safari y Opera */
.scroll-mobile-x::-webkit-scrollbar {
    display: none; 
}

/* Efecto magnético para que las tarjetas se centren al deslizar */
.scroll-mobile-x > div {
    scroll-snap-align: center;
}

/* ==========================================
   CARRUSEL DE PRODUCTOS DESTACADOS
   ========================================== */
.scroll-container {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Suavidad táctil en móviles (iOS) */
    scrollbar-width: none; /* Oculta scrollbar en Firefox */
    -ms-overflow-style: none; /* Oculta scrollbar en IE y Edge */
    scroll-snap-type: x mandatory; /* Efecto magnético al deslizar */
}

/* Oculta scrollbar en Chrome, Safari y Opera */
.scroll-container::-webkit-scrollbar {
    display: none; 
}

/* Efecto magnético en las tarjetas */
.scroll-container > div {
    scroll-snap-align: start;
}

/* Estilos de las flechas flotantes (Solo PC) */
.carousel-btn-prev, .carousel-btn-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    z-index: 10;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.carousel-btn-prev { left: -15px; }
.carousel-btn-next { right: -15px; }

.carousel-btn-prev:hover, .carousel-btn-next:hover {
    transform: translateY(-50%) scale(1.1); /* Ligero zoom al pasar el mouse */
}

/* ==========================================
   ANIMACIONES FLOTANTES (PARA LOS ÍCONOS)
   ========================================== */
.flotante-1 { animation: flotar 4s ease-in-out infinite; }
.flotante-2 { animation: flotar 5s ease-in-out infinite alternate-reverse; }
.flotante-3 { animation: flotar 6s ease-in-out infinite 1s; }

@keyframes flotar {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

/* ==========================================
   HERO PRINCIPAL MÁGICO (INICIO - TONOS PASTEL)
   ========================================== */
.hero-magico {
    /* Degradado alegre para el inicio */
    background: linear-gradient(135deg, #cce5ff 0%, #f8d7da 50%, #fff3cd 100%);
    position: relative;
    overflow: hidden;
}

.hero-texto-sombra {
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.9);
}

/* ==========================================
   BANNER MÁGICO (CATÁLOGO - TONOS PASTEL)
   ========================================== */
.banner-magico {
    background: linear-gradient(135deg, #fff3cd 0%, #f8d7da 50%, #cce5ff 100%);
    position: relative;
    overflow: hidden;
    border: 3px solid #ffffff;
}

/* ==========================================
   ANIMACIONES MÁGICAS PARA SECCIONES MEDIAS
   ========================================== */

/* 1. Fondo con colores en movimiento suave */
.bg-gradiente-animado {
    background: linear-gradient(-45deg, #ff9a9e, #fecfef, #f6d365, #fda085);
    background-size: 400% 400%;
    animation: moverGradiente 12s ease infinite;
}

@keyframes moverGradiente {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 2. Efecto de levitación para las categorías */
.card-categoria-magica {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Rebote súper suave */
    border: 2px solid transparent !important;
}

.card-categoria-magica:hover {
    transform: translateY(-12px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
    background-color: #ffffff !important;
}

/* Colores de borde al pasar el mouse por cada categoría */
.hover-borde-1:hover { border-color: #cce5ff !important; }
.hover-borde-2:hover { border-color: #f8d7da !important; }
.hover-borde-3:hover { border-color: #d1e7dd !important; }
.hover-borde-4:hover { border-color: #cff4fc !important; }

/* ==========================================
   SECCIÓN DE MARCAS MÁGICAS
   ========================================== */
/* Texto con reflejo de luz animado */
.texto-gradiente-brillo {
    background: linear-gradient(to right, #d63384, #ff7e5f, #f59e0b, #ff7e5f, #d63384);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: brilloTexto 3s linear infinite;
}

@keyframes brilloTexto {
    to { background-position: 200% center; }
}

/* Estallido de color de las marcas al pasar el mouse */
.marca-hover { transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

.hover-staedtler:hover { color: #0055a4 !important; transform: translateY(-5px) scale(1.1); }
.hover-faber:hover { color: #005c42 !important; transform: translateY(-5px) scale(1.1); }
.hover-crayola:hover { color: #ff0054 !important; transform: translateY(-5px) scale(1.1); }
.hover-norma:hover { color: #e3000f !important; transform: translateY(-5px) scale(1.1); }
.hover-pelikan:hover { color: #0087ce !important; transform: translateY(-5px) scale(1.1); }

/* ==========================================
   AJUSTES MÓVILES PARA EL HERO (INICIO)
   ========================================== */
@media (max-width: 991px) {
    /* Quitamos el alto forzado y reducimos los márgenes en pantallas pequeñas */
    .hero-magico {
        min-height: auto !important; 
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* Achicamos un poco el título principal para que no ocupe tantas líneas */
    .hero-magico .display-4 {
        font-size: 2.2rem; 
    }
    
    /* Achicamos ligeramente el texto descriptivo */
    .hero-magico .lead {
        font-size: 1rem;
        margin-bottom: 1.5rem !important;
    }

    /* Reducimos el tamaño de los íconos de fondo para que no estorben */
    .hero-magico .bi-lightbulb-fill {
        font-size: 5rem !important;
        top: 5% !important;
    }
    .hero-magico .bi-stars {
        font-size: 2.5rem !important;
    }
}

/* ==========================================
   AJUSTES RESPONSIVOS PARA TARJETAS DE PRODUCTO
   ========================================== */
/* Altura por defecto para PC y Tablets */
.img-producto {
    height: 220px;
}

@media (max-width: 767px) {
    /* Achicamos la imagen en celulares para que no deje espacios blancos gigantes */
    .img-producto {
        height: 130px !important;
        padding: 0.5rem !important;
    }
    
    /* Reducimos el relleno de la tarjeta para aprovechar el espacio */
    .product-card .card-body {
        padding: 0.75rem; 
    }
    
    /* Título un poco más pequeño para que no ocupe tantas líneas */
    .product-card .card-title {
        font-size: 0.85rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    /* Achicamos ligeramente el precio */
    .product-card .fs-5 {
        font-size: 1.1rem !important; 
    }
    
    /* Hacemos el botón un poco más compacto */
    .product-card .btn {
        font-size: 0.85rem !important;
        padding-top: 0.4rem !important;
        padding-bottom: 0.4rem !important;
    }
}

/* ==========================================
   AJUSTES MÓVILES PARA EL BANNER DE CATÁLOGO
   ========================================== */
@media (max-width: 767px) {
    /* Reducimos el relleno (padding) del banner para que sea más delgado */
    .banner-magico {
        padding: 1.5rem !important;
    }

    /* Achicamos el título principal */
    .banner-magico .display-5 {
        font-size: 1.8rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Achicamos el texto descriptivo y juntamos un poco las líneas */
    .banner-magico p {
        font-size: 0.95rem !important;
        line-height: 1.4 !important;
    }

    /* Ajustamos la etiqueta de "MATERIALES Y PAPELERÍA" */
    .banner-magico .badge {
        font-size: 0.75rem !important;
    }

    /* Encogemos el cohete y lo hacemos un poco más transparente para que no estorbe */
    .banner-magico .bi-rocket-takeoff-fill {
        font-size: 4.5rem !important;
        right: -10px !important;
        bottom: -10px !important;
        opacity: 0.15 !important;
    }

    /* Achicamos las estrellitas */
    .banner-magico .bi-stars {
        font-size: 2rem !important;
        top: 5% !important;
        right: 5% !important;
    }
}