/* ============ RESET ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: #e8f0f8;
    padding-top: 60px;
}

/* ============ NAVBAR ============ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 77, 140, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    height: 60px;
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 1001;
}

.nav-logo-img {
    height: 42px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(10, 77, 140, 0.97);
    backdrop-filter: blur(10px);
    padding: 16px;
    gap: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-links.active a {
    padding: 12px 16px;
    font-size: 0.9rem;
    width: 100%;
}

@media (max-width: 1099px) {
    .nav-toggle {
        display: flex;
    }
    .nav-links {
        display: none;
    }
}

/* ============ SLIDES ============ */
.slide {
    width: 100%;
    background-size: contain;
    background-position: top center;
    background-repeat: no-repeat;
    background-color: #f0f5fa;
    aspect-ratio: 1672 / 941;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 60px;
    background-origin: content-box;
}

@media (min-width: 1400px) {
    .slide {
        background-position: center center;
    }
}

@media (max-width: 1024px) {
    .slide {
        max-width: 100%;
        background-size: 100% auto;
        padding-top: 60px;
    }
}

@media (max-width: 768px) {
    .slide {
        max-width: 100%;
        background-size: 100% auto;
        background-position: top center;
        aspect-ratio: 1672 / 941;
        margin-bottom: 0;
        padding-top: 60px;
    }
}

/* ============ FOOTER ============ */
.footer {
    background: #0F1E2C;
    color: #CBD5E0;
    padding: 60px 0 0;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.footer-col h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-col p {
    font-size: 0.9rem;
    margin-bottom: 8px;
    line-height: 1.6;
}

.footer-tagline {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 12px;
}

.footer-col a {
    display: block;
    color: #CBD5E0;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 0;
    transition: all 0.2s ease;
}

.footer-col a:hover {
    color: #00B894;
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 24px;
    text-align: center;
    font-size: 0.85rem;
    color: #718096;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* ============ CATÁLOGOS / PRODUCTOS ============ */
.catalogos-section {
    position: relative;
    min-height: 100vh;
    padding: 100px 24px 60px;
    background: #f0f5fa;
}

.catalogos-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    z-index: 0;
}

.catalogos-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: #0A4D8C;
    margin-bottom: 12px;
    font-weight: 700;
}

.section-header p {
    font-size: 1.1rem;
    color: #4A5568;
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* CAMBIO CLAVE: La tarjeta es un flex container en columna */
.producto-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 24px rgba(10, 77, 140, 0.12);
    transition: all 0.3s ease;
    text-align: center;
    /* Flexbox para alinear contenido */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.producto-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(10, 77, 140, 0.2);
}

.producto-img {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.producto-img img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 8px;
}

.producto-card h3 {
    font-size: 1.5rem;
    color: #0A4D8C;
    margin-bottom: 12px;
    font-weight: 700;
}

/* CAMBIO CLAVE: La descripción crece para empujar el botón abajo */
.producto-card p {
    color: #4A5568;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1; /* Esto hace que ocupe el espacio disponible */
    min-height: 50px; /* Altura mínima para que se vea uniforme */
}

.producto-btn {
    display: inline-block;
    padding: 12px 32px;
    background: #0A4D8C;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    /* CAMBIO CLAVE: El botón siempre queda al fondo */
    margin-top: auto;
    align-self: center;
}

.producto-btn:hover {
    background: #073A6B;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 77, 140, 0.3);
}

/* ============ MODAL ============ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(10, 77, 140, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #073A6B;
    transform: rotate(90deg);
}

.modal-content {
    padding: 20px;
    max-height: 90vh;
    overflow: auto;
}

.modal-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .section-header h2 {
        font-size: 2rem;
    }
    
    .productos-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .producto-img {
        min-height: 200px;
    }
    
    .modal-container {
        max-width: 95vw;
    }
}

/* ============ MODAL ============ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(10, 77, 140, 0.9);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #073A6B;
    transform: rotate(90deg);
}

.modal-content {
    padding: 20px;
    max-height: 90vh;
    overflow: auto;
}

.modal-content img {
    max-width: 100%;
    height: auto;
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .section-header h2 {
        font-size: 2rem;
    }
    
    .productos-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .producto-img {
        min-height: 200px;
    }
    
    .modal-container {
        max-width: 95vw;
    }
}