/* =================================================================
 VARIABLES Y RESET (Usando tus variables existentes)
================================================================= */
:root {
    /* Variables de Color y Tipografía */
    --color-background: #ffffff;
    --color-text: #0b1447;
    --color-dark-background: #0b1447; /* Azul Marino */
    --color-light-text: #ffffff;
    --color-subtle-text: #555;
    --font-family-body: 'Open Sans', sans-serif;
    --font-family-titles: 'Poppins', sans-serif;
    --color-accent: #8366e9; /* Violeta/Morado de acento (Para el formulario) */
    --color-secondary-accent: #49ceab; /* Verde/Cian (Para el hero) */
    
    /* Variables Adicionales requeridas */
    --colors-line-and-border: 230, 230, 230; /* Gris claro (RGB) */
    --colors-text: 0, 0, 0;
    --colors-heading: 11, 20, 71; /* RGB del azul marino */
    --colors-button: #0b1447;
    --colors-button-hover: #000000;
    --colors-button-text-hover: #ffffff;
    --border-radius: 20px;
    --font-button: 'Open Sans', sans-serif;
    --font-button-weight: 700;

    /* Variables de Altura */
    --top-bar-height: 38px;
    --header-height: 61px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    /* Padding para compensar el fixed header y top bar */
    padding-top: calc(var(--top-bar-height) + var(--header-height)); 
    font-family: var(--font-family-body);
    color: var(--color-text);
    background-color: #f8f9fa; /* Fondo general sutil/grisáceo */
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    margin: 0;
}

body.modal-open {
    overflow: hidden;
}

/* =================================================================
 TOP BAR
================================================================= */
.top-bar {
    background-color: var(--color-dark-background);
    color: var(--color-light-text);
    padding: 10px 0;
    font-size: 0.8rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: var(--top-bar-height);
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-bar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: center; 
}
.top-bar a {
    color: var(--color-light-text); 
    text-decoration: none;
    transition: opacity 0.3s;
}
.top-bar a:hover {
    opacity: 0.8;
}


/* =================================================================
 HEADER PRINCIPAL
================================================================= */
.site-header {
    background-color: var(--color-background);
    padding: 15px 0;
    position: fixed;
    top: var(--top-bar-height);
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: var(--header-height);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 170px 0 20px; 
    display: flex;
    justify-content: space-between;
    align-items: center; 
    position: relative;
}

.site-logo {
    height: 30px; 
    display: block;
    align-self: center; 
}


.main-nav {
    height: 100%; 
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
    height: 100%;
    align-items: center;;
    padding: 0;
}

.main-nav a {
    color: var(--color-text);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.85rem;
}

.main-nav a:hover {
    color: var(--color-accent);
}

/* Mega-Menú */
.mega-dropdown { 
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    top: calc(var(--top-bar-height) + var(--header-height));
    background-color: var(--color-background);
    color: var(--color-text);
    padding: 25px 0;
    box-shadow: 0 16px 32px -30px rgba(0, 0, 0, 0.25);
    z-index: 999;
    text-align: left;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0s 0.3s;
}

.mega-dropdown.open { 
    max-height: 500px;
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

#mega-categorias-lista {
list-style: none;
    margin: 0;
    padding: 0;
    display: grid; 
    grid-template-columns: repeat(5, 1fr);
    gap: 10px 30px;
    width: 100% !important;
}
.mega-col {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.mega-col h4 {
    color: var(--color-text);
    text-transform: uppercase;
    font-family: var(--font-family-titles);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--color-text);
    padding-bottom: 5px;
}

#mega-categorias-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid; 
    grid-template-columns: repeat(5, 1fr);
    gap: 10px 30px;
}

#mega-categorias-lista li {
    padding: 0;
}

#mega-categorias-lista a {
    color: var(--color-text);
    text-decoration: none;
    font-family: var(--font-family-body);
    font-size: 0.85rem;
    transition: all 0.2s;
    line-height: 1.5;
    padding: 5px 0;
    display: block;
}

/* Estilo de selección al hacer hover o activo en Mega-Menú */
.mega-dropdown.open #mega-categorias-lista li a:hover,
.mega-dropdown.open #mega-categorias-lista li a.activa-category-menu { 
    color: var(--color-light-text) !important;
    background-color: var(--color-dark-background) !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
    border-radius: 4px !important; 
    transform: none !important;
}

.search-and-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-container-header, .search-btn {
    display: none; /* Ocultar en desktop si no se usa */
}

/* =================================================================
 MENÚ MÓVIL (OFF-CANVAS)
================================================================= */
#menu-toggle {
    display: none; /* Ocultar por defecto en desktop */
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    color: var(--color-text);
}

.mobile-menu-offcanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 80%; /* Ancho del panel */
    max-width: 300px;
    height: 100%;
    background-color: var(--color-background);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transform: translateX(-100%); /* Inicialmente fuera de la pantalla */
    transition: transform 0.3s ease-in-out;
    overflow-y: auto; /* Permite scroll si el contenido es largo */
}

.mobile-menu-offcanvas.open {
    transform: translateX(0); /* Se desliza a la vista */
}

/* Estilos de encabezado y botón de cierre */
.mobile-menu-header { 
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(var(--colors-line-and-border), 1);
    background-color: var(--color-dark-background);
    color: var(--color-light-text);
    position: sticky; 
    top: 0;
    z-index: 2001;
}

.menu-title {
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    font-family: var(--font-family-titles); 
}

.close-menu-btn {
    background: none;
    border: none;
    color: var(--color-light-text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Estilos de los enlaces principales */
.mobile-nav-links { 
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-links > li {
    border-bottom: 1px solid rgba(var(--colors-line-and-border), 0.7);
}

/* Asegurar que el texto y la flecha estén separados */
.mobile-nav-links a {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.mobile-nav-links a:hover {
    background-color: #f5f5f5;
}

.mobile-nav-links li i {
    font-size: 0.8rem;
    color: var(--color-subtle-text);
}

/* Estilos sociales en el móvil */
.mobile-social {
    padding: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.15); 
}

.mobile-social a {
    color: var(--color-subtle-text);
    font-size: 1.2rem;
}


/* =================================================================
 BANNER PRINCIPAL (HERO)
================================================================= */
#hero-banner {
    width: 100%;
    /* Se elimina 'max-height: 190px;' para permitir que el elemento crezca en escritorio */
    min-height: 0px; /* Altura mínima para asegurar visibilidad en móvil */
    height: 500px; /* Altura fija para móvil si quieres los 190px */

    background-color: #f0f0f0;
    background-image: url('/images/banner_catalogo.png');
    
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.1); 
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--color-light-text);
    max-width: 800px;
    padding: 0 20px;
}

.hero-content h1 {
    font-family: var(--font-family-titles);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
    text-transform: uppercase;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    font-weight: 300;
}

.hero-content .btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-light-text);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
    background: var(--color-secondary-accent); /* Usamos el color secundario para el Hero */
}

.hero-content .btn:hover {
    background: #0b1447; /* Usa el color que quieres para el hover */
}

/* =================================================================
 CATÁLOGO
================================================================= */
.catalog-container {
    padding-top: 2rem;
}

/* --- ESTILO DEL TÍTULO "Nuestro Catálogo" --- */
.catalog-container .section-title {
    font-family: var(--font-family-titles); 
    font-weight: 700; 
    color: var(--color-dark-background); 
    text-align: center;
    margin: 0 auto 30px; 
    padding-bottom: 5px;
    font-size: clamp(2em, 5vw, 2.5em); 
    text-transform: uppercase;
    display: table; 
}
/* ----------------------------------------------------------------- */

#catalogo-layout {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
    opacity: 1; 
}

/* Oculta el catálogo principal (catalog-layout) mientras carga */
.render-block {
    display: none !important;
}

/* Estilos para la barra de carga (loading-bar) */
#loading-bar {
    text-align: center;
    padding: 100px 20px; 
    font-size: 1.8em;
    font-weight: 700;
    color: #0b1447; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    min-height: 300px; 
}

.loading-spinner {
    font-size: 2.5em; 
    margin-bottom: 35px; 
    color: #49ceab; 
}

#sidebar-filtros {
    flex: 0 0 250px;
    border: 1px solid rgba(var(--colors-line-and-border), 1);
    border-radius: 8px;
    padding: 1rem;
    background-color: var(--color-background);
    box-shadow: 0 2px 8px rgba(var(--colors-text), 0.05);
    height: fit-content;
    position: sticky;
    top: calc(var(--top-bar-height) + var(--header-height) + 20px);
}

#sidebar-filtros h2.sidebar-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: rgba(var(--colors-heading), 1);
}

#sidebar-filtros input {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 1px solid rgba(var(--colors-line-and-border), 1);
    border-radius: 4px;
    background-color: #fff;
    box-sizing: border-box;
}

#filtro-categorias-container {
    margin-top: 0.5rem;
}

#btn-toggle-categorias {
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    background-color: #4063f9;
    color: var(--colors-button-text-hover);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#btn-toggle-categorias:hover {
    background-color: #4063f9;
}

/* Nuevo estilo para el botón circular de volver */
.btn-circular-volver {
    display: inline-flex; 
    justify-content: center;
    align-items: center;
    width: 45px; 
    height: 45px; 
    border-radius: 50%; 
    background-color: var(--color-dark-background); 
    color: var(--color-light-text); 
    font-size: 1.2rem; 
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    
    /* 🚨 CÓDIGO CORREGIDO Y CLAVE 🚨 */
    position: absolute; 
    top: 25px;    
    left: 25px;   
    z-index: 100; 
    margin: 0;     
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); 
    cursor: pointer;
}

.btn-circular-volver:hover {
    background-color: var(--color-accent); 
    transform: scale(1.05); 
}

/* Ajuste al título si fuera necesario para que no choque */
.titulo-cotizacion-pagina {
    margin-bottom: 1.5rem; 
}

#filtro-categorias-lista {
    display: block;
    overflow-y: hidden; 
    overflow-x: hidden;
    max-height: none; 
    transition: max-height 0.4s ease, opacity 0.4s ease;
    padding-right: 5px; 
}

#filtro-categorias-lista:not(.visible) {
    max-height: 0;
    opacity: 0;
}

.categoria-link {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    color: var(--color-text);
    cursor: pointer;
    transition: color 0.3s ease;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
}

.categoria-link:hover {
    color: var(--color-accent);
    background-color: #f0f0f0;
}

.categoria-link.activa {
    font-weight: bold;
    background-color: var(--color-dark-background);
    color: var(--color-light-text);
}

/* Contenedor de productos */
#productos-cdo {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columnas en desktop */
    gap: 2rem;
    flex-grow: 1;
    transition: opacity 0.2s ease-in;
}

#productos-cdo.loaded {
    opacity: 1;
}

/* Estilos de la tarjeta de producto */
#productos-cdo .product-card {
    background-color: #ffffff;
    border: 1px solid rgba(var(--colors-line-and-border), 1);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(var(--colors-text), 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    will-change: transform; 
    transform: translateZ(0); 
}

#productos-cdo .product-card:hover {
    transform: translateY(-4px);
}

#productos-cdo .image-container {
    position: relative;
    padding-top: 100%; 
    overflow: hidden;
    background: #ffffff;
}

#productos-cdo .image-container img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: translate(-50%, -50%) scale(0.9);
    padding: 1rem;
}

/* Estilos para Lazy Load */
.image-container img.lazy-image:not(.loaded) {
    opacity: 0;
    transition: opacity 0.5s;
}

.image-container img.lazy-image.loaded {
    opacity: 1;
}

#productos-cdo .product-card:hover .image-container img {
    transition: transform 0.5s ease; 
    transform: translate(-50%, -50%) scale(0.95);
}

/* Contenido de la información del producto */
#productos-cdo .product-info {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

/* Título */
#productos-cdo .product-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    text-align: center;
    margin-bottom: 15px; 
    min-height: 2.8em; 
    display: -webkit-box;
    line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Precio/SKU */
#productos-cdo .price {
    display: block; 
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-subtle-text);
    margin-top: 5px; 
    margin-bottom: 15px;
    padding: 0 10px; 
}

.btn {
    display: inline-block;
    padding: 0.75rem 1rem;
    background: var(--color-dark-background);
    color: var(--color-light-text);
    text-align: center;
    border-radius: var(--border-radius);
    font-family: var(--font-button);
    font-weight: var(--font-button-weight);
    text-decoration: none;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
    cursor: pointer;
    border: none;
}
/* Aseguramos que el botón en la tarjeta se posicione bien */
#productos-cdo .product-card .btn {
    margin-top: auto; 
}


.btn:hover {
    background: #4063f9;
}

.pagination {
    text-align: center;
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.pagination .btn:disabled {
    background-color: #f0f0f0;
    color: #ccc;
    cursor: not-allowed;
}

/* =================================================================
 ESTILOS PARA COTIZACION.HTML (Vista de página de cotización) - CORE
================================================================= */
.cotizacion-container {
    max-width: 1400px; 
    margin: auto;
    padding: 1.25rem 40px; 
    margin-bottom: 4rem;
    /* Ajuste de padding-top para evitar que el contenido quede bajo el header fijo */
    padding-top: 4rem
}

.titulo-cotizacion-pagina {
    text-align: center; 
    font-size: 2.2rem;
    margin-bottom: 2.5rem; 
    color: var(--color-dark-background);
    text-transform: uppercase;
    font-weight: 700;
    font-family: var(--font-family-titles); 
}

/* CLAVE: CAJA CONTENEDORA GRANDE (FONDO BLANCO ÚNICO) */
.cotizacion-box {
    background-color: var(--color-background); /* Fondo Blanco Único */
    border-radius: var(--border-radius); 
    box-shadow: 0 10px 30px rgba(var(--colors-text), 0.1); 
    /* Padding general reducido para dar más espacio a las columnas internas */
    padding: 25px; 
    position: relative;
}

/* Contenedor principal de las 2 COLUMNAS (Flexbox) */
.contenido-cotizacion {
    display: flex;
    gap: 40px; /* Espacio entre las dos columnas */
    flex-wrap: nowrap; 
    /* Se deja en 'stretch' (por defecto) o se remueve 'align-items' para que se estiren */
}

/* -------------------------------------- */
/* SECCIÓN DEL PRODUCTO (COLUMNA IZQUIERDA - 55%) */
/* -------------------------------------- */
.producto-detalles-col {
    /* CLAVE: Distribución 55% */
    flex: 1 1 55%; 
    max-width: 55%; 

    /* Aumentamos el padding para compensar el padding reducido del .cotizacion-box */
    padding: 15px 20px 15px 20px; 

    /* LÍNEA DIVISORIA VERTICAL */
    border-right: 1px solid rgba(var(--colors-line-and-border), 0.5); 
    
    background-color: transparent; 
    box-shadow: none; 
    text-align: center; 
}

.producto-imagen {
    padding: 0;
    margin-bottom: 1.5rem; 
    text-align: center; 
}

.producto-imagen img {
    max-width: 100%;
    height: auto; 
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.producto-nombre {
    font-family: var(--font-family-titles);
    font-size: 1.6rem; 
    font-weight: 700;
    color: var(--color-dark-background); 
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    text-align: center; 
}


.producto-sku,
.producto-color,
.producto-medidas,
.producto-stock{
    font-size: 0.95rem;
    color: var(--color-subtle-text);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    text-align: center; 
}

.producto-descripcion {
    margin-top: 0rem; 
    padding-top: 0rem;
    border-top: none; 
    color: var(--color-text);
    white-space: pre-wrap;
    text-align: center; 
    font-size: 0.9rem;
}

/* --- ESTILO DE CATEGORÍA (CORRECCIÓN DE LÍNEAS VACÍAS) --- */
.producto-categoria {
    display: block;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #388e3c; /* Verde para destacar */
    text-transform: uppercase;
    border: none !important; 
    margin: 0 !important;
    padding: 0 !important; 
}

.producto-categoria:not(:empty) {
    /* Estilo tipo 'Chip' o 'Badge' */
    background-color: #e8f5e9; /* Fondo muy claro */
    color: #1b5e20; /* Texto verde oscuro */
    padding: 4px 10px;
    border-radius: 20px;
    margin: 1rem auto 1rem auto; 
    width: fit-content; 
    max-width: 90%; 
}
/* ---------------------------------------------------------- */

.colores-selector {
    text-align: center; 
    margin-top: 1.5rem;
    border-bottom: 1px solid rgba(var(--colors-line-and-border), 1);
    margin-bottom: 1rem;
}

.colores-titulo {
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-text);
    text-transform: uppercase;
    font-size: 0.9rem;
}

.colores-cuadros {
    display: flex;
    justify-content: center; 
    gap: 8px;
    margin-bottom: 1rem;
}

.color-cuadro {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ccc;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0; 
}

.color-cuadro.seleccionado {
    border: 3px solid var(--color-accent);
    box-shadow: 0 0 0 3px rgba(131, 102, 233, 0.3); /* Sombra sutil del acento */
    transform: scale(1.1);
}

.color-cuadro:hover {
    opacity: 0.8;
}


/* -------------------------------------- */
/* SECCIÓN DEL FORMULARIO (COLUMNA DERECHA - 45%) */
/* -------------------------------------- */

.formulario-header {
    /* Ajusta estos valores al color de tu marca */
    background-color: #f3effe; 
    border-radius: 10px;
    padding: 15px 20px;
    /* La separación es importante para que no se pegue al primer campo */
    margin-bottom: 25px; 
    text-align: center;
    border: 1px solid #dcd0ff; 
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05); 
}

.formulario-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #4a148c; /* Color de tu marca */
    margin: 0 0 5px 0;
}

.formulario-header p {
    font-size: 0.95rem;
    color: #555;
    margin: 0;
}

/* MODIFICACIÓN CLAVE: Centrar verticalmente el contenido */
.formulario-cotizacion {
    flex: 1 1 45%; 
    max-width: 45%;
    
    /* 1. Convertir el contenedor de la columna en Flex */
    display: flex; 
    /* 2. Dirección vertical (por si acaso) */
    flex-direction: column; 
    /* 3. CLAVE: Centrar el contenido verticalmente */
    justify-content: center; 
    
    /* Aumentamos el padding para compensar el padding reducido del .cotizacion-box */
    padding: 15px 20px 15px 20px; 

    background-color: transparent; 
    box-shadow: none; 
}

.formulario-cotizacion label {
    display: block;
    font-weight: 700;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-text); 
    font-size: 0.95rem;
    text-transform: uppercase; 
}

.formulario-cotizacion label:first-child {
    margin-top: 0; 
}

.formulario-cotizacion input[type="text"],
.formulario-cotizacion input[type="tel"],
.formulario-cotizacion input[type="email"],
#contact_cantidad,
.formulario-cotizacion textarea {
    width: 100%;
    padding: 0.85rem 1rem; 
    border: 1px solid rgba(var(--colors-line-and-border), 1); 
    border-radius: 8px; 
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    background-color: var(--color-background);
}

.formulario-cotizacion input:focus,
.formulario-cotizacion textarea:focus {
    border-color: var(--color-accent); 
    box-shadow: 0 0 0 2px rgba(131, 102, 233, 0.3); 
    outline: none;
    background-color: var(--color-background);
}

.formulario-cotizacion textarea {
    resize: vertical;
    min-height: 120px; 
}

/* Botón "Enviar Cotización" */
.formulario-cotizacion button[type="submit"] {
    width: 100%;
    /* Mantenemos este margen bajo el control de 'margin-top: auto' */
    margin-top: 1rem; 
    padding: 0.95rem 1rem;
    background: var(--color-accent); /* Usamos el color de acento del theme */
    color: var(--color-light-text);
    font-family: var(--font-button);
    font-weight: 800; 
    border: none;
    border-radius: 50px; /* Botón más redondeado */
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(131, 102, 233, 0.4);
}

.formulario-cotizacion button[type="submit"]:hover {
    background: var(--color-dark-background); /* Cambio a azul oscuro al pasar el mouse */
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

.error-input {
    border: 1px solid #dc3545 !important;
    box-shadow: 0 0 0 0.1rem rgba(220, 53, 69, 0.25);
}

/* ========================================== */
/* ESTILOS PARA POPUP DE COTIZACIÓN */
/* ========================================== */

#popup-container {
    display: none; 
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.popup-box {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    text-align: center;
    margin: 10px; 
}

#successMessage {
    border-top: 5px solid #28a745; /* Verde Éxito */
}

#errorMessage {
    border-top: 5px solid #dc3545; /* Rojo Error */
}

.popup-close-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 15px; 
    font-weight: bold;
}

.success-close-btn {
    background-color: #007bff;
    color: white;
}

.error-close-btn {
    background-color: #6c757d;
    color: white;
}


/* =================================================================
 FOOTER
================================================================= */
.site-footer {
    background-color: var(--color-dark-background);
    color: #a0a0a0;
    padding: 60px 0 20px;
    font-family: var(--font-family-body);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    text-align: left;
}

.footer-col h4 {
    color: var(--color-light-text);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.explora a,
.nosotros a {
    color: #a0a0a0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.explora a:hover,
.nosotros a:hover {
    color: var(--color-light-text);
}

.contacto ul li {
    color: #a0a0a0;
    gap: 10px; 
    justify-content: flex-start; 
}

.contacto ul li i {
    color: #ffffff;
    min-width: 15px;
    text-align: center;
}

.social-icons {
    margin-top: 25px;
    display: flex;
    gap: 15px;
    justify-content: flex-start; 
}

.social-icons a {
    color: #a0a0a0;
    font-size: 1.25rem;
    text-decoration: none;
    border: 1px solid #a0a0a0;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    color: #ffffff;
    border-color: #ffffff; 
    background-color: rgba(255, 255, 255, 0.1); 
}

/* Pie de página inferior */
.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 20px;
    font-size: 0.85em;
    color: #ffffff;
}

/* =================================================================
 MEDIA QUERIES (RESPONSIVE)
================================================================= */
@media (max-width: 1200px) {
    #productos-cdo { 
        grid-template-columns: repeat(3, 1fr); 
    }
}

@media (max-width: 1024px) {
    .main-nav { 
        display: none; 
    }
    
    #menu-toggle { 
        display: block; 
    }

    .header-container {
        padding: 0 20px;
    }

    .hero-content h1 { font-size: 2.5rem; }
}

@media (max-width: 900px) {
    /* --- COTIZACIÓN MÓVIL (PILA) --- */
    .cotizacion-container {
        padding: 1.25rem 20px; 
    }
    
    .cotizacion-box {
        padding: 25px; /* Reducir padding en móvil */
    }
    
    /* En móvil, las columnas se apilan verticalmente */
    .contenido-cotizacion {
        flex-direction: column;
        gap: 30px;
        align-items: center; 
    }
    
    .producto-detalles-col {
        flex: 1 1 100%; /* Ocupa el 100% del ancho */
        max-width: 100%;
        padding-right: 0;
        padding-bottom: 25px; /* Añadir espacio debajo */
        border-right: none;
        border-bottom: 1px solid rgba(var(--colors-line-and-border), 0.5); /* Separador inferior */
    }
    
    .formulario-cotizacion {
        flex: 1 1 100%; /* Ocupa el 100% del ancho */
        max-width: 100%;
        padding: 0; /* Quitamos el padding para el móvil ya que ocupa todo el ancho */
        /* Eliminamos las reglas de centrado para que en móvil esté arriba */
        justify-content: flex-start;
        display: block;
    }

    /* -------------------------------- */
}
@media (max-width: 768px) {
    #productos-cdo { grid-template-columns: repeat(2, 1fr); }
    #catalogo-layout { flex-direction: column; }
    #sidebar-filtros { width: 100%; position: static; }
    .hero-content h1 { font-size: 2rem; }

    #hero-banner { 
        min-height: 300px;
        max-height: 400px;
        height: 50vh; 
        
        /* CLAVE: Nueva imagen para móvil con RUTA ABSOLUTA */
        background-image: url('./images/banner_catalogo_mobile.png'); 
    }
    
    /* FOOTER MÓVIL */
    .footer-container {
        padding: 0 20px 30px; 
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }

    .footer-col h4 {
        margin-bottom: 15px;
    }

    .footer-col ul li,
    .explora a,
    .nosotros a {
        font-size: 1rem;
        justify-content: center;
    }
    
    .social-icons {
        justify-content: center;
    }

    .contacto ul li {
        justify-content: center; 
    }
}

@media (min-width: 769px) {
    /* Ocultar botón de toggle en desktop */
    #btn-toggle-categorias { display: none !important; }
}

@media (max-width: 550px) {
    #productos-cdo { grid-template-columns: repeat(1, 1fr); }
}

@media (max-width: 480px) {
    .hero-content h1 { font-size: 1.5rem; }
    #hero-banner { height: 300px; }
}

/* Estilos para el nuevo mensaje de invitación a cotizar */
.cotizacion-invitacion {
    /* Mantiene tus estilos */
    margin-top: 1rem; 
    padding: 12px 15px;
    border-radius: 14px;
    background-color: #4063f9;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);

    /* NUEVA REGLA CLAVE: Para que abarque ambas columnas */
    grid-column: 1 / -1; 
}

.cotizacion-invitacion p {
    margin: 0.25rem;
    font-size: 1.05rem;
    line-height: 1.4;
    color: #ffffff; /* Color de texto estándar */
}

/* Hacer que la pregunta inicial sea más prominente */
.cotizacion-invitacion strong {
    color: #ffffff; /* Un color que haga juego con el botón "Enviar Cotización" */
    font-weight: 700;
    /* Opcional: para que ocupe su propia línea si es necesario en móvil */
    display: block; 
    margin-bottom: 4px;
    font-size: 1.6rem;
    font-family: var(--font-family-titles);
}

/* Estilo del campo de ENLACE */
.formulario-cotizacion input[type="url"] {
    /* Reutiliza los estilos genéricos de tus otros inputs */
    width: 100%;
    padding: 0.85rem 1rem; 
    border: 1px solid rgba(var(--colors-line-and-border), 1); 
    border-radius: 8px; 
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    background-color: var(--color-background);
}

.formulario-cotizacion input[type="url"]:focus {
    border-color: var(--color-accent); 
    box-shadow: 0 0 0 2px rgba(131, 102, 233, 0.3); 
    outline: none;
}

/* Estilo de la nota informativa para el enlace (.file-note) */
.formulario-cotizacion .file-note {
    display: block; 
    font-size: 0.85rem;
    color: var(--color-subtle-text);
    margin-top: 0.5rem;
    margin-bottom: 1.25rem; 
    /* Borde lateral usando tu color secundario para destacarlo */
    border-left: 3px solid var(--color-secondary-accent); 
    padding-left: 10px;
    line-height: 1.4;
    font-weight: 400;
}
/* MODIFICACIÓN: Se elimina la línea divisoria superior, que ahora la maneja .descripcion-titulo */
.producto-descripcion {
    margin-top: 0rem; /* Eliminado el margen superior */
    padding-top: 0rem; /* Eliminado el padding superior */
    border-top: none; /* Eliminada la línea divisoria superior */
    color: var(--color-text);
    white-space: pre-wrap;
    text-align: center; 
    font-size: 0.9rem;
}


/* =================================================================
 REGLAS CRUCIALES PARA FLEXBOX EN EL FORMULARIO (Solución final para centrado y textarea)
================================================================= */

/* 1. La etiqueta <form> debe ser un contenedor flex vertical y ocupar el 100% de la altura. */
.formulario-cotizacion form { 
    display: flex;
    flex-direction: column;
    /* CLAVE: Asegura que el formulario tome toda la altura disponible en la columna */
    height: 100%; 
    flex-grow: 1; 
}

/* 2. El textarea debe crecer para tomar todo el espacio restante. */
.formulario-cotizacion textarea {
    /* CLAVE: Permite que el textarea consuma el espacio vertical sobrante */
    flex-grow: 1; 
    min-height: 120px; 
    resize: vertical;
}

/* 3. Asegura que los demás elementos mantengan su altura fija. */
.formulario-cotizacion label,
.formulario-cotizacion input,
.formulario-cotizacion button[type="submit"],
.formulario-cotizacion .file-note {
    /* Asegura que no intenten crecer */
    flex-grow: 0;
    flex-shrink: 0;
}