/* ============================================
   RESPONSIVE CSS PARA FUNDACION CORGESDE
   ============================================ */

/* ==========================================
   NAVEGACIÓN RESPONSIVE
   ========================================== */
@media (max-width: 991px) {
    /* Navbar en móviles */
    #mainNav {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    #mainNav .navbar-brand img {
        height: 2rem;
    }
    
    #mainNav .navbar-nav .nav-item .nav-link {
        padding: 0.75rem 0;
    }
    
    #mainNav.navbar-shrink .navbar-brand img {
        height: 1.75rem;
    }
}

/* ==========================================
   MASTHEAD (HEADER PRINCIPAL) RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .masthead {
        padding-top: 8rem;
        padding-bottom: 8rem;
    }
    
    .masthead .masthead-heading {
        font-size: 2rem !important;
        line-height: 2rem;
        margin-bottom: 2rem;
    }
    
    .masthead .masthead-subheading {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .masthead {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
    
    .masthead .masthead-heading {
        font-size: 1.5rem !important;
        line-height: 1.5rem;
    }
}

/* ==========================================
   SERVICIOS RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    #services .row.text-center > div {
        margin-bottom: 3rem;
    }
    
    #services .fa-stack {
        font-size: 3rem !important;
    }
    
    #services h4 {
        font-size: 1.25rem;
    }
    
    #services .text-muted {
        font-size: 0.95rem;
    }
}

/* ==========================================
   PORTFOLIO/CLIENTES RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    #portfolio .col-lg-4,
    #portfolio .col-sm-6 {
        margin-bottom: 2rem;
    }
    
    #portfolio h3 {
        font-size: 1.5rem;
        margin-top: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .portfolio-item {
        margin-bottom: 1rem;
    }
    
    .portfolio-caption-heading {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    #portfolio .portfolio-item img {
        margin-bottom: 1rem;
    }
}

/* ==========================================
   TIMELINE (NOSOTROS) RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .timeline > li {
        margin-bottom: 3rem;
    }
    
    .timeline > li .timeline-panel {
        width: calc(100% - 90px);
        padding: 1rem 1.5rem;
    }
    
    .timeline > li .timeline-image {
        width: 80px;
        height: 80px;
        left: 0;
        margin-left: 0;
    }
    
    .timeline > li .timeline-image img {
        width: 80px;
        height: 80px;
    }
    
    .timeline > li .timeline-image h4 {
        font-size: 0.75rem;
        line-height: 14px;
        margin-top: 1rem;
    }
    
    .timeline > li.timeline-inverted > .timeline-panel {
        float: right;
    }
    
    .timeline .timeline-heading h4 {
        font-size: 1.1rem;
    }
    
    .timeline .timeline-body p {
        font-size: 0.9rem;
    }
    
    /* Imagen del mapa responsive */
    .timeline .timeline-body img {
        max-width: 100%;
        height: auto !important;
        width: 100% !important;
    }
}

@media (max-width: 576px) {
    .timeline > li .timeline-panel {
        width: calc(100% - 70px);
        padding: 0.75rem 1rem;
    }
    
    .timeline > li .timeline-image {
        width: 60px;
        height: 60px;
    }
    
    .timeline > li .timeline-image img {
        width: 60px;
        height: 60px;
    }
}

/* ==========================================
   POLÍTICAS Y PQR RESPONSIVE
   ========================================== */
@media (max-width: 991px) {
    #team .row {
        flex-direction: column;
    }
    
    #team .col-lg-6 {
        width: 100%;
        max-width: 100%;
        margin-bottom: 2rem;
    }
    
    #team .team-member {
        margin-bottom: 2rem;
    }
    
    /* Formulario PQR responsive */
    #contactForm2 .form-control,
    #contactForm2 select,
    #contactForm2 textarea {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    #team h2 {
        font-size: 1.75rem;
    }
    
    #team .team-member img {
        width: 150px;
        height: 150px;
    }
    
    #team a {
        font-size: 0.9rem;
        display: block;
        margin-bottom: 0.5rem;
    }
}

/* ==========================================
   FORMULARIO DE CONTACTO RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    #contact .row.align-items-stretch {
        flex-direction: column;
    }
    
    #contact .form-group {
        margin-bottom: 1rem;
    }
    
    #contact textarea {
        min-height: 150px;
    }
    
    #contact h2 {
        font-size: 1.75rem;
    }
    
    #contact h6 {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    #contact .btn-xl {
        font-size: 1rem;
        padding: 1rem 2rem;
    }
}

@media (max-width: 576px) {
    #contact h2 {
        font-size: 1.5rem;
    }
    
    #contact h6 {
        font-size: 0.85rem;
    }
    
    #contact .btn-xl {
        width: 100%;
    }
}

/* ==========================================
   MODALES PDF RESPONSIVE
   ========================================== */
@media (max-width: 991px) {
    .modal-xl-custom {
        max-width: 95%;
    }
    
    .pdf-modal-container {
        height: 65vh;
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .modal-xl-custom {
        max-width: 98%;
        margin: 0.5rem auto;
    }
    
    .modal-xl-custom .modal-header {
        padding: 0.75rem 1rem;
    }
    
    .modal-xl-custom .modal-title {
        font-size: 1rem;
    }
    
    .modal-xl-custom .modal-body {
        padding: 10px;
    }
    
    .pdf-modal-container {
        height: 60vh;
        min-height: 350px;
        padding: 5px;
    }
    
    .pdf-iframe {
        transform: scale(1.5);
        height: 900px;
    }
}

@media (max-width: 576px) {
    .modal-xl-custom .modal-title {
        font-size: 0.9rem;
    }
    
    .pdf-modal-container {
        height: 55vh;
        min-height: 300px;
    }
    
    .pdf-iframe {
        transform: scale(1.2);
        height: 720px;
    }
}

/* Modal de Aviso de Privacidad (texto) */
@media (max-width: 768px) {
    #pdfModal8 .modal-body {
        font-size: 0.85rem;
        padding: 1rem;
    }
    
    #pdfModal8 ol {
        padding-left: 1.25rem;
    }
}

/* ==========================================
   MODALES PORTFOLIO RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .portfolio-modal .modal-dialog {
        margin: 1rem;
    }
    
    .portfolio-modal h2 {
        font-size: 1.5rem;
    }
    
    .portfolio-modal p {
        font-size: 0.9rem;
    }
    
    .portfolio-modal .close-modal {
        width: 50px;
        height: 50px;
    }
    
    .portfolio-modal .btn-xl {
        font-size: 0.9rem;
        padding: 0.75rem 1.5rem;
    }
}

/* ==========================================
   FOOTER RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .footer .row {
        text-align: center !important;
    }
    
    .footer .col-lg-4 {
        margin-bottom: 1rem;
    }
    
    .footer .text-lg-start,
    .footer .text-lg-end {
        text-align: center !important;
    }
    
    .btn-social {
        margin: 0.25rem !important;
    }
}

/* ==========================================
   BOTÓN WHATSAPP FLOTANTE RESPONSIVE
   ========================================== */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    color: #FFF;
    transform: scale(1.1);
    text-decoration: none;
}

@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 25px;
    }
}

@media (max-width: 576px) {
    .whatsapp-float {
        width: 45px;
        height: 45px;
        bottom: 15px;
        right: 15px;
        font-size: 22px;
    }
}

/* ==========================================
   UTILIDADES GENERALES RESPONSIVE
   ========================================== */

/* Textos responsive */
@media (max-width: 768px) {
    .section-heading {
        font-size: 1.75rem !important;
    }
    
    .section-subheading {
        font-size: 1rem !important;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.1rem; }
    h6 { font-size: 1rem; }
}

@media (max-width: 576px) {
    .section-heading {
        font-size: 1.5rem !important;
    }
    
    .section-subheading {
        font-size: 0.9rem !important;
    }
}

/* Imágenes responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Contenedor principal */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Espaciado de secciones */
@media (max-width: 768px) {
    .page-section {
        padding: 4rem 0 !important;
    }
}

@media (max-width: 576px) {
    .page-section {
        padding: 3rem 0 !important;
    }
}

/* Botones responsive */
@media (max-width: 576px) {
    .btn-xl {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .btn-primary,
    .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ==========================================
   FIXES ESPECÍFICOS
   ========================================== */

/* Fix para imágenes en timeline */
.timeline img {
    max-width: 100%;
    height: auto !important;
}

/* Fix para overflow horizontal */
body {
    overflow-x: hidden;
}

.row {
    margin-left: 0;
    margin-right: 0;
}

/* Fix para formularios en móviles */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important; /* Evita zoom en iOS */
    }
}

/* ==========================================
   LANDSCAPE MODE (Orientación horizontal)
   ========================================== */
@media (max-width: 768px) and (orientation: landscape) {
    .masthead {
        padding-top: 6rem;
        padding-bottom: 4rem;
    }
    
    .pdf-modal-container {
        height: 80vh;
    }
    
    .modal-xl-custom {
        max-width: 98%;
    }
}

/* ==========================================
   PRINT STYLES (Para impresión)
   ========================================== */
@media print {
    .navbar,
    .whatsapp-float,
    .btn,
    .modal {
        display: none !important;
    }
    
    .page-section {
        page-break-inside: avoid;
    }
}