:root {
    --primary-color: #3498db;
    --secondary-color: #2563eb;
    --accent-color: #e74c3c;
}


body {
    font-family: 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
/* .navbar {
    background-color: var(--primary-color) !important;
} */

/* Tarjetas de Manuales */
.manual-card {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.manual-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.manual-img-container {
    position: relative;
    width: 100%;
    padding-top: 61.4%; /* Aspect Ratio aproximado para 1270x780 */
    overflow: hidden;
    background-color: #eee;
}

.manual-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.manual-card:hover .manual-img {
    transform: scale(1.05);
}

.manual-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.manual-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.manual-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.manual-desc {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limitar a 3 líneas */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-ver {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.2s;
    width: 100%;
}

.btn-ver:hover {
    background-color: #2980b9;
    color: white;
}

/* Estilos para Vista de Lista (Modificador) */
.view-list .col-md-4 {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
}

.view-list .manual-card {
    flex-direction: row;
    height: auto;
    min-height: 200px;
}

.view-list .manual-img-container {
    width: 300px;
    padding-top: 0;
    flex-shrink: 0;
}

.view-list .manual-img {
    position: relative;
}

/* Responsive adjustments for List View */
@media (max-width: 768px) {
    .view-list .manual-card {
        flex-direction: column;
    }
    .view-list .manual-img-container {
        width: 100%;
        padding-top: 61.4%;
    }
}

/* Toastr Customization */
#toast-container > .toast-success {
    background-color: var(--secondary-color);
}

/* Hero Section */
.hero-section {
    /* 1. Color de respaldo: Si la imagen falla, se verá azul oscuro y el texto blanco será legible */
    background-color: var(--primary-dark); 
    
    /* 2. Imagen de fondo: Asegúrate que el nombre coincida EXACTAMENTE (mayúsculas/minúsculas) con el archivo en el servidor */
    background-image: url('/images/Portada.jpg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    
    position: relative;
    z-index: 1;
}

.hero-overlay {
    background: rgba(2, 13, 63, 0.7); /* Un poco más oscuro para mejor contraste */
    color: white; /* Asegurar texto legible */
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.3s ease;
}

.hero-overlay:hover {
    transform: translateY(-5px);
}

.hero-overlay h1, .hero-overlay p, .hero-overlay span {
    text-shadow: 0 2px 4px rgba(0,0,0,0.5); /* Sombra para mejorar legibilidad sin blur */
}

/* Button Effects */
.btn-hero-cta {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
}

.btn-hero-cta:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(13, 110, 253, 0.4) !important;
}

.btn-hero-cta::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
    z-index: -1;
}

.btn-hero-cta:hover::before {
    left: 100%;
}

/* Botones Modernos */
.btn {
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-lg {
    padding: 0.8rem 2rem;
}

.btn-outline-light:hover {
    background-color: white;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,255,255,0.3);
}

/* Active Nav Link Color matching btn-primary */
.navbar-dark .navbar-nav .nav-link.active {
    color: #3498db !important;
    font-weight: 700;
}

/* Ocultar botón de Cargar Datos */
#btn-reload {
    display: none !important;
}

/* Utilidad para imágenes de tarjetas */
.object-fit-cover {
    object-fit: cover;
}

/* Ajustes Responsivos para Hero Section (Móviles y Tablets) */
@media (max-width: 991px) {
    .hero-section {
        /* Desactivar efecto parallax en móviles (causa problemas visuales en iOS/Android) */
        background-attachment: scroll !important; 
        background-position: center center !important;
        background-size: cover !important;
        
        /* Ajustes de espaciado para que el menú fijo no tape el contenido */
        margin-top: 0 !important; 
        padding-top: 140px !important; /* Espacio suficiente para el Navbar */
        padding-bottom: 60px !important;
    }

    .hero-overlay {
        padding: 2rem 1.5rem !important;
        background: rgba(0, 0, 0, 0.6); /* Fondo más oscuro en móviles para garantizar lectura */
        backdrop-filter: none;
    }

    .hero-overlay h1 {
        font-size: 2rem; /* Título más pequeño */
    }

    .hero-overlay h1 span {
        font-size: 1.1rem !important; /* Subtítulo ajustado */
        margin-top: 1rem !important;
    }

    .hero-overlay .lead {
        font-size: 1rem;
        margin-bottom: 2rem !important;
    }
}

/* Ajustes específicos para móviles pequeños */
@media (max-width: 576px) {
    .hero-section .d-flex {
        flex-direction: column; /* Apilar botones verticalmente */
        width: 100%;
    }

    .hero-section .btn {
        width: 100%; /* Botones ocupan todo el ancho */
        margin-bottom: 0.5rem;
    }

    .cta-modern .d-flex,
    .cta-modern .d-flex.justify-content-center {
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
        align-items: stretch !important;
    }
    .cta-modern .btn {
        width: 100% !important;
        min-width: 0 !important;
        margin-bottom: 0 !important;
        display: block !important;
        text-align: center !important;
    }
}

/* =========================================
   NUEVOS ESTILOS CENTRALIZADOS (REDISEÑO)
   ========================================= */

/* --- Estilos para Index (Moderno) --- */
.hero-section-modern {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.8) 100%),url('/images/Portada.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 8rem 0 6rem 0;
    margin-top: 0 !important;
}

/* Importante: Desactivar parallax en móviles para evitar problemas de scroll y rendimiento */
@media (max-width: 991px) {
    .hero-section-modern {
        background-attachment: scroll !important;
        background-position: center center !important;
        background-size: cover !important;
    }
}

.feature-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    background: white;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important;
    border-color: transparent;
}

.icon-circle {
    width: 80px;
    height: 80px;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    color: #0d6efd;
    transition: all 0.3s ease;
}

.feature-card:hover .icon-circle {
    background: #0d6efd;
    color: white;
}

.cta-section {
    background: linear-gradient(45deg, #0d6efd, #0a58ca);
}

/* --- Estilos para Servicios --- */
.service-img {
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    object-fit: cover;
    height: 350px;
    width: 100%;
}

.service-row:hover .service-img {
    transform: scale(1.02);
}

.icon-square {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.check-list li {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: start;
}

.check-list i {
    margin-top: 4px;
    color: #198754; /* Bootstrap Success Color */
}

/* --- Estilos para Contacto --- */
.contact-wrapper {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.contact-info-side {
    background: linear-gradient(135deg, #0d6efd 0%, #0043a8 100%);
    color: white;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.contact-info-side::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    top: -50px;
    right: -50px;
}

.contact-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.contact-icon-box {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.2rem;
}

/* Sobreescribir form-control solo si es necesario, o usar clases específicas */
.form-control {
    border: 1px solid #e0e0e0;
    padding: 0.8rem 1rem;
    border-radius: 8px;
}

.form-control:focus {
    box-shadow: none;
    border-color: #0d6efd;
    background-color: #f8faff;
}

#search-input.form-control-lg {
    border-radius: px !important;
}

/* =========================================
   REDISEÑO INDEX (CONTENIDO)
   ========================================= */

/* --- Tarjetas de Valores (Value Cards) --- */
.value-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.03);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.value-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.value-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.value-card:hover::after {
    opacity: 1;
}

.value-icon-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

.value-card:hover .value-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
}

/* Colores suaves para iconos */
.bg-blue-soft { background-color: rgba(13, 110, 253, 0.1); }
.bg-purple-soft { background-color: rgba(111, 66, 193, 0.1); }
.bg-green-soft { background-color: rgba(25, 135, 84, 0.1); }
.bg-orange-soft { background-color: rgba(255, 193, 7, 0.1); }

.text-purple { color: #6f42c1; }

/* --- Sección Cita (Quote) --- */
.quote-section {
    min-height: 500px;
    background-color: #1a1a1a;
    overflow: hidden;
}

.quote-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Parallax simple */
    filter: grayscale(100%); /* Imagen en blanco y negro */
    opacity: 0.4;
    transition: transform 0.5s ease;
}

.quote-section:hover .quote-bg-image {
    transform: scale(1.05); /* Zoom lento al hover */
}

.quote-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0.6));
}

.h-1px { height: 2px; }
.w-100px { width: 100px; }

/* --- CTA Moderno --- */
.cta-modern {
    background: linear-gradient(135deg, #0d6efd 0%, #0043a8 100%);
}

.hover-scale {
    transition: transform 0.2s;
}
.hover-scale:hover {
    transform: scale(1.05);
}

/* Formas decorativas animadas en CTA */
.circle-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    z-index: 0;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation: float 6s ease-in-out infinite;
}

.shape-2 {
    width: 400px;
    height: 400px;
    bottom: -150px;
    right: -100px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(20px); }
    100% { transform: translateY(0px); }
}

/* --- Animaciones de Scroll (Clases base) --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   ESTILOS PORTAFOLIO (REDISEÑO)
   ========================================= */

.portfolio-hero {
    background: url('https://images.unsplash.com/photo-1519389950473-47ba0277781c?ixlib=rb-1.2.1&auto=format&fit=crop&w=1500&q=80');
    background-color: #343a40; /* Fallback color */
    background-size: cover;
    background-position: center;
    padding: 3rem 0; /* Altura reducida drásticamente */
    margin-top: 0 !important; /* Compensar Navbar Fijo */
    padding-top: 4.5rem !important; /* Separación visual entre navbar y hero en portafolio */
}

.bg-gradient-primary {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.9) 0%, rgba(13, 202, 240, 0.8) 100%);
}

/* Estilos para las tarjetas generadas por JS */
.hover-card {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 15px !important;
    overflow: hidden;
}

.hover-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}

.hover-card .card-img-top {
    transition: transform 0.5s ease;
}

.hover-card:hover .card-img-top {
    transform: scale(1.1);
}

/* Animación de entrada */
.fade-in-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Paginación Moderna */
.pagination .page-link {
    border: none;
    color: var(--primary-color);
    margin: 0 5px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.2s;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
    transform: scale(1.1);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

/* =========================================
   ESTILOS VISTA LISTA PORTAFOLIO (Igualar a Manuales)
   ========================================= */
   
#portafolio-container.view-list .hover-card {
    flex-direction: row;
    min-height: 220px;
    align-items: stretch;
}

/* Contenedor de la imagen en modo lista */
#portafolio-container.view-list .hover-card > .position-relative {
    width: 300px; /* Ancho fijo como en manuales */
    height: auto !important; /* Sobreescribir estilo inline (200px) del JS */
    flex-shrink: 0;
}

#portafolio-container.view-list .hover-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.5rem 2rem;
}

/* Ajustes Responsive para Portafolio Lista (Móviles) */
@media (max-width: 768px) {
    #portafolio-container.view-list .hover-card {
        flex-direction: column;
    }
    
    #portafolio-container.view-list .hover-card > .position-relative {
        width: 100%;
        height: 200px !important;
    }
}

/* Modal Info Portafolio Moderno */
#infoModal .modal-content {
    background: #fff;
    border-radius: 1.5rem;
    box-shadow: 0 8px 40px rgba(44,62,80,0.18);
    overflow: hidden;
}
#infoModal .modal-header {
    border-bottom: none;
}
#infoModal .modal-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
#infoModal .badge {
    font-size: 0.95rem;
    padding: 0.5em 1em;
    border-radius: 1em;
}
#infoModalImg {
    min-height: 320px;
    background-color: #f8f9fa;
    background-size: cover !important;
    background-position: center !important;
    border-top-left-radius: 1.5rem;
    border-bottom-left-radius: 1.5rem;
}
@media (max-width: 767px) {
    #infoModalImg {
        display: none !important;
    }
}

/* --- Unificación de botones en toda la aplicación --- */
.btn,
.btn-primary,
.btn-ver,
.btn-outline-primary,
.btn-light,
.btn-outline-light {
    background-color: var(--primary-color) !important; /* Azul principal */
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 8px rgba(52,152,219,0.08); /* rgba de #3498db */
    transition: background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.12s;
    padding: 0.55rem 1.5rem;
    font-size: 1.05rem;
    outline: none;
}

.btn:hover,
.btn-primary:hover,
.btn-ver:hover,
.btn-outline-primary:hover,
.btn-light:hover,
.btn-outline-light:hover {
    background-color: #217dbb !important; /* Azul principal más oscuro */
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(52,152,219,0.13);
    transform: translateY(-1px) scale(1.03);
}

/* --- Botones especiales de barra de búsqueda (Vista Grid/Lista) --- */
#view-grid, #view-list {
    background-color: #f3f4f6 !important;
    color: var(--primary-color) !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600;
    box-shadow: none;
    transition: background 0.18s, color 0.18s, transform 0.12s;
    padding: 0.45rem 1.2rem;
    font-size: 1.1rem;
    margin-left: 0.2rem;
}

#view-grid.active, #view-list.active,
#view-grid:hover, #view-list:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
    transform: translateY(-1px) scale(1.06);
}

#view-grid:focus, #view-list:focus {
    outline: none;
    box-shadow: 0 0 0 0.13rem rgba(52,152,219,0.18);
}

/* --- Botones secundarios y modales --- */
.modal-footer .btn,
.btn-secondary {
    background-color: #f3f4f6 !important;
    color: var(--primary-color) !important;
    border: none !important;
    font-weight: 600;
    border-radius: 8px !important;
    transition: background 0.18s, color 0.18s;
}

.modal-footer .btn:hover,
.btn-secondary:hover {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

/* --- Botones compactos en vista lista --- */
.view-list .btn-info-modal,
.view-list .btn-primary,
.view-list .btn-ver {
    padding: 0.35rem 1rem !important;
    font-size: 0.97rem !important;
    border-radius: 6px !important;
    min-width: unset !important;
    width: auto !important;
    flex-grow: 0 !important;
    white-space: nowrap;
}

.card.rounded-pill,
.rounded-pill {
    border-radius: 1rem !important; /* Menos redondeado que 50rem */
}

.search-bar-card {
    border-radius: 0.75rem !important;
}

/* Nuevos estilos de botón */
.btn-outline-white {
    background: transparent !important;
    color: #fff !important;
    border: 2px solid #fff !important;
    border-radius: 50px;
    font-weight: 700;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn-outline-white:hover, .btn-outline-white:focus {
    background: #fff !important;
    color: #0d6efd !important; /* Azul principal para contraste */
    box-shadow: 0 4px 16px rgba(52,152,219,0.13);
    border-color: #fff !important;
}

/* --- Ajustes específicos para móviles pequeños */
@media (max-width: 576px) {
    .hero-section .d-flex {
        flex-direction: column; /* Apilar botones verticalmente */
        width: 100%;
    }

    .hero-section .btn {
        width: 100%; /* Botones ocupan todo el ancho */
        margin-bottom: 0.5rem;
    }

    .cta-modern .d-flex,
    .cta-modern .d-flex.justify-content-center {
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
        align-items: stretch !important;
    }
    .cta-modern .btn {
        width: 100% !important;
        min-width: 0 !important;
        margin-bottom: 0 !important;
        display: block !important;
        text-align: center !important;
    }
}

.circle-shape {
    pointer-events: none !important;
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    z-index: 0;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation: float 6s ease-in-out infinite;
}

.shape-2 {
    width: 400px;
    height: 400px;
    bottom: -150px;
    right: -100px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(20px); }
    100% { transform: translateY(0px); }
}

/* --- Animaciones de Scroll (Clases base) --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}
