/* =========================================
   1. CORE & VARIABLES
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    /* Identidad */
    --brand-blue: #013d70;
    --brand-blue-dark: #001f3a;
    --brand-orange: #FF6600;
    
    /* Fondos */
    --bg-body: #f4f7f9;
    --bg-surface: #ffffff;
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(1, 61, 112, 0.05);
    --shadow-md: 0 10px 30px -10px rgba(1, 61, 112, 0.15);
    --shadow-hover: 0 20px 40px -10px rgba(1, 61, 112, 0.25);
    
    /* UI */
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
}

body {
    background-color: var(--bg-body);
    font-family: 'Outfit', sans-serif;
    color: var(--brand-blue-dark);
}

/* =========================================
   2. NAVBAR & HEADER
   ========================================= */
.navbar-custom {
    background: linear-gradient(90deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
    box-shadow: 0 4px 20px rgba(1, 61, 112, 0.2);
    padding: 0.8rem 0;
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: -0.5px;
    font-size: 1.5rem;
}

.search-btn-custom {
    background-color: var(--brand-orange) !important;
    color: white !important;
    transition: all 0.3s ease;
}

.search-btn-custom:hover {
    background-color: #ff8533 !important;
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.4);
}

/* Ajuste Navbar Links Activos */
.navbar-custom .nav-link.active {
    color: var(--brand-orange) !important;
    font-weight: 800;
}

.navbar-custom .nav-link:hover {
    color: white !important;
    opacity: 1;
}

/* =========================================
   3. HERO SECTION (IMPACTO)
   ========================================= */
.hero-impact {
    position: relative;
    background: radial-gradient(circle at top right, #024b8a 0%, var(--brand-blue-dark) 100%);
    padding: 120px 0 140px 0; /* Espacio inferior para el solape de marcas */
    overflow: hidden;
    color: white;
    margin-bottom: 0; 
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.btn-hero-cta {
    background: var(--brand-orange);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 14px 40px;
    border-radius: 50px;
    border: 2px solid var(--brand-orange);
    box-shadow: 0 10px 25px rgba(255, 102, 0, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-hero-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(255, 102, 0, 0.6);
    color: white;
}

/* =========================================
   4. MARCAS PROTAGONISTAS (SOLO LOGO)
   ========================================= */
.brand-card {
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--radius-lg);
    padding: 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.brand-card:hover {
    transform: translateY(-10px);
    border-color: var(--brand-orange);
    box-shadow: var(--shadow-hover);
    z-index: 2;
}

.brand-logo-wrapper {
    height: 90px;
    width: 100%;
    /* Centrado interno */
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.4s ease;
}

.brand-card:hover .brand-logo-wrapper img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* =========================================
   5. CINTA DE CATEGORÍAS (COMPACTAS)
   ========================================= */
.category-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    text-align: center;
}

.category-compact:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-blue);
}

.category-compact i {
    transition: transform 0.3s;
}

.category-compact:hover i {
    transform: scale(1.2);
    color: var(--brand-orange) !important;
}

/* =========================================
   6. TARJETAS DE PRODUCTO (GRID DE 5)
   ========================================= */
.product-card-pro {
    background: white;
    border: 1px solid #e2e8f0; 
    border-radius: var(--radius-md);
    padding: 15px;
    transition: all 0.3s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-pro:hover {
    border-color: var(--brand-blue);
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.card-img-wrapper {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
}

.card-img-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.product-card-pro:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.price-tag {
    color: var(--brand-orange);
    font-size: 1.3rem;
    font-weight: 800;
}

.btn-add-cart {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--brand-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.product-card-pro:hover .btn-add-cart {
    background: var(--brand-blue);
    color: white;
}

/* =========================================
   7. PÁGINA DE CATÁLOGO (SIDEBAR)
   ========================================= */
.sidebar-filter {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.filter-title {
    font-weight: 800;
    color: var(--brand-blue);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-link {
    display: block;
    padding: 6px 0;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.filter-link:hover, .filter-link.active {
    color: var(--brand-orange);
    transform: translateX(5px);
    font-weight: 600;
}

/* =========================================
   8. PÁGINA DE DETALLE (FICHA TÉCNICA)
   ========================================= */
.product-gallery-main {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    overflow: hidden;
}

.product-gallery-main img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.detail-brand-badge {
    display: inline-block;
    background: #f1f5f9;
    padding: 5px 12px;
    border-radius: 4px;
    color: var(--brand-blue);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.detail-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--brand-orange);
    line-height: 1;
}

.detail-sku {
    font-family: monospace;
    color: #94a3b8;
    font-size: 0.9rem;
}

.stock-indicator {
    font-size: 0.9rem;
    font-weight: 600;
}
.stock-ok { color: #10b981; }
.stock-low { color: #f59e0b; }
.stock-out { color: #ef4444; }

.qty-input {
    width: 80px;
    text-align: center;
    font-weight: 700;
    border: 2px solid #e2e8f0;
    height: 50px;
}

.btn-buy-lg {
    background: var(--brand-orange);
    color: white;
    font-weight: 700;
    padding: 12px 30px;
    height: 50px;
    border-radius: 8px;
    border: none;
    width: 100%;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.btn-buy-lg:hover {
    background: #e65c00;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 102, 0, 0.3);
}

.tech-specs-table th {
    background: #f8fafc;
    color: var(--brand-blue);
    width: 40%;
}

/* =========================================
   9. MEJORAS UI CATÁLOGO (SCROLL & PAGINACIÓN)
   ========================================= */

/* Caja con Scroll para Filtros */
.filter-scroll-box {
    max-height: 220px; 
    overflow-y: auto;  
    padding-right: 5px; 
    border: 1px solid #f1f5f9;
    border-radius: 8px;
    padding: 10px;
    background-color: #fcfcfc;
}

.filter-scroll-box::-webkit-scrollbar { width: 6px; }
.filter-scroll-box::-webkit-scrollbar-track { background: #f1f1f1; }
.filter-scroll-box::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.filter-scroll-box::-webkit-scrollbar-thumb:hover { background: var(--brand-blue); }

/* Paginación Estilizada */
.pagination { margin-bottom: 0; }
.pagination .page-link {
    color: var(--brand-blue);
    border: 1px solid #e2e8f0;
    margin: 0 4px;
    border-radius: 8px;
    font-weight: 600;
    padding: 8px 16px;
    transition: all 0.2s;
}
.pagination .page-link:hover {
    background-color: #f1f5f9;
    color: var(--brand-orange);
}
.pagination .page-item.active .page-link {
    background-color: var(--brand-orange);
    border-color: var(--brand-orange);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 102, 0, 0.3);
}
.pagination .page-item.disabled .page-link {
    color: #cbd5e1;
    background-color: white;
    border-color: #f1f5f9;
}

/* =========================================
   10. ESTILOS DEL CARRITO Y CHECKOUT (MEJORADO)
   ========================================= */

/* 1. Tabla del Carrito más espaciosa */
.cart-table {
    border-collapse: separate; 
    border-spacing: 0; 
}

.cart-table thead th {
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 1rem;
    color: var(--brand-blue-dark);
}

.cart-table tbody tr {
    transition: background-color 0.2s;
}

.cart-table tbody tr:hover {
    background-color: #fcfcfc; /* Gris muy sutil al pasar el mouse */
}

.cart-table tbody td {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

/* 2. Marco de imagen de producto */
.cart-item-frame {
    width: 70px; 
    height: 70px; 
    border: 1px solid #e2e8f0; 
    border-radius: 12px; 
    padding: 5px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

/* 3. Input de cantidad más bonito */
.qty-input-sm {
    width: 50px;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-weight: 600;
    color: var(--brand-blue);
    padding: 4px;
}

/* 4. Tarjetas de Selección (Envío vs Tienda) */
.custom-radio-card input[type="radio"] {
    display: none;
}

.custom-radio-card label {
    cursor: pointer;
    background-color: white;
    color: #64748b;
    border: 2px solid #e2e8f0; /* Borde gris suave por defecto */
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.custom-radio-card label:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

/* Estado Activo (Seleccionado) */
.custom-radio-card input[type="radio"]:checked + label {
    border-color: var(--brand-orange);
    background-color: #fff7ed; /* Fondo naranja muy pálido */
    color: var(--brand-orange);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.15);
}

/* Pequeño indicador visual (círculo) */
.custom-radio-card input[type="radio"]:checked + label::after {
    content: '\f00c'; /* Icono Check de FontAwesome */
    font-family: "Font Awesome 5 Free"; 
    font-weight: 900;
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8rem;
    color: var(--brand-orange);
}

/* 5. Tarjeta de Resumen (Sticky) */
.cart-summary-card {
    position: sticky;
    top: 100px; /* Se queda pegada al hacer scroll */
    z-index: 10;
}

.cart-summary-total {
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-dark) 100%);
    color: white;
}

/* 6. Animaciones pequeñas */
.hover-scale {
    transition: transform 0.2s;
}
.hover-scale:hover {
    transform: scale(1.02);
}

/* Botón de eliminar (Basura) */
.btn-trash {
    color: #94a3b8;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 5px;
}
.btn-trash:hover {
    color: #ef4444; /* Rojo al pasar el mouse */
    transform: scale(1.1);
}

/* =========================================
   11. UTILIDADES DE COLOR (FIX VISIBILIDAD)
   ========================================= */

/* Fondos Corporativos */
.bg-brand-blue {
    background-color: var(--brand-blue) !important;
}

.bg-brand-orange {
    background-color: var(--brand-orange) !important;
}

/* Textos Corporativos */
.text-brand-blue {
    color: var(--brand-blue) !important;
}

.text-brand-orange {
    color: var(--brand-orange) !important;
}

/* Asegurar que el header del carrito tenga contraste */
.card-header.bg-brand-blue h5 {
    color: white !important;
    font-weight: 700;
}

/* =========================================
   12. PÁGINA DE CONTACTO Y BOTONES
   ========================================= */

.icon-square {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.hover-link:hover {
    color: var(--brand-orange) !important;
    text-decoration: underline !important;
}

/* Botón Flotante WhatsApp */
.btn-whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.4);
    color: white;
}

/* =========================================
   13. RESPONSIVE & MOBILE OPTIMIZATIONS
   ========================================= */
@media (max-width: 991px) {
    /* Navbar en Móvil */
    .navbar-brand img { max-height: 40px !important; }
    .navbar-brand span { font-size: 1rem !important; }
    
    /* El buscador se va abajo y ocupa todo el ancho */
    .search-btn-custom { width: 100%; border-radius: 0 0 50px 50px !important; margin-top: 5px; }
    .input-group input { border-radius: 50px 50px 0 0 !important; }
    .input-group { flex-direction: column; }
    
    /* Hero Section Móvil */
    .hero-impact { padding: 60px 0 80px 0; text-align: center; }
    .hero-title { font-size: 2.5rem; }
    .hero-impact .col-lg-5 { display: none !important; /* Ocultar imagen flotante en móvil */ }
    
    /* Sidebar en Móvil */
    .sidebar-filter { margin-bottom: 2rem; }
    
    /* El resumen del carrito ya no es sticky en movil */
    .cart-summary-card { position: relative; top: 0; margin-top: 2rem; }
}

@media (max-width: 576px) {
    /* Teléfonos pequeños */
    .hero-title { font-size: 2rem; }
    .brand-logo-wrapper { height: 60px; }
    .product-card-pro { padding: 10px; }
    .card-img-wrapper { height: 140px; }
    
    /* Transformar tabla del carrito en tarjetas para que quepa */
    .cart-table thead { display: none; } /* Ocultar cabeceras */
    .cart-table tbody td { display: block; text-align: center; padding: 10px; border-bottom: none; }
    .cart-table tbody tr { 
        border-bottom: 2px solid #e2e8f0; display: block; margin-bottom: 1rem; 
        background: white; border-radius: 12px; border: 1px solid #f1f5f9;
    }
    .cart-table td.ps-4 { padding-left: 10px !important; text-align: center; }
    .cart-table .d-flex { flex-direction: column; align-items: center; }
    .cart-table .ms-3 { margin-left: 0 !important; margin-top: 10px; }
}