/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-style: normal;
    line-height: 1.5;
    font-weight: 400;
    color: #232323;
    position: relative;
    background-color: #ffffff;
}

/* ===== TIPOGRAFÍA ===== */
h1, h2, h3, h4, h5, h6,
.display-1, .display-2, .display-4, .display-5, .display-7,
span, p, a {
    line-height: 1;
    word-break: break-word;
    word-wrap: break-word;
    font-weight: 400;
}

/* Clases display específicas como en Mobirise */
.display-1 {
    font-family: 'Inter Tight', sans-serif;
    font-size: 5rem;
    line-height: 1;
}

.display-2 {
    font-family: 'Inter Tight', sans-serif;
    font-size: 4rem;
    line-height: 1;
}

.display-4 {
    font-family: 'Inter Tight', sans-serif;
    font-size: 0.8rem;
    line-height: 1.5;
}

.display-5 {
    font-family: 'Inter Tight', sans-serif;
    font-size: 2rem;
    line-height: 1.5;
}

.display-7 {
    font-family: 'Inter Tight', sans-serif;
    font-size: 1.4rem;
    line-height: 1.3;
}

/* Responsive typography */
@media (max-width: 992px) {
    .display-1 {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    .display-1 {
        font-size: 3.5rem;
        font-size: calc(2.4rem + (5 - 2.4) * ((100vw - 20rem) / (48 - 20)));
        line-height: calc(1.1 * (2.4rem + (5 - 2.4) * ((100vw - 20rem) / (48 - 20))));
    }
    .display-2 {
        font-size: 3.2rem;
        font-size: calc(2.05rem + (4 - 2.05) * ((100vw - 20rem) / (48 - 20)));
        line-height: calc(1.3 * (2.05rem + (4 - 2.05) * ((100vw - 20rem) / (48 - 20))));
    }
    .display-4 {
        font-size: 0.64rem;
        font-size: calc(0.93rem + (0.8 - 0.93) * ((100vw - 20rem) / (48 - 20)));
        line-height: calc(1.4 * (0.93rem + (0.8 - 0.93) * ((100vw - 20rem) / (48 - 20))));
    }
    .display-5 {
        font-size: 1.6rem;
        font-size: calc(1.35rem + (2 - 1.35) * ((100vw - 20rem) / (48 - 20)));
        line-height: calc(1.4 * (1.35rem + (2 - 1.35) * ((100vw - 20rem) / (48 - 20))));
    }
    .display-7 {
        font-size: 1.12rem;
        font-size: calc(1.14rem + (1.4 - 1.14) * ((100vw - 20rem) / (48 - 20)));
        line-height: calc(1.4 * (1.14rem + (1.4 - 1.14) * ((100vw - 20rem) / (48 - 20))));
    }
}

b, strong {
    font-weight: bold;
}

.mbr-section-title {
    font-style: normal;
    line-height: 1.3;
}

.mbr-section-subtitle {
    line-height: 1.3;
}

.mbr-text {
    font-style: normal;
    line-height: 1.7;
}

/* ===== NAVEGACIÓN ===== */
.navbar {
    background: transparent !important;
    min-height: 90px;
    transition: all 0.3s;
    border-bottom: 1px solid transparent;
    padding: 0 !important;
    border-radius: 0 !important;
}

.navbar.fixed-top {
    background: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 72px;
}

.navbar-brand {
    flex-shrink: 0;
    align-items: center;
    margin-right: 0;
    padding: 10px 0;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
}

.navbar-brand img {
    height: 4.3rem;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0px !important;
}

.navbar-nav {
    margin: auto;
    margin-left: 0;
    margin-left: auto;
    margin-right: 0;
    flex-wrap: wrap;
}

.navbar-nav .nav-item {
    padding: 0 !important;
    transition: .3s all !important;
}

.navbar-nav .nav-link {
    color: #000000 !important;
    font-family: 'Inter Tight', sans-serif;
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 16px !important;
    margin: 0 !important;
    border-radius: 1rem !important;
    transition: .3s all !important;
    width: fit-content;
    position: relative;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(27, 31, 10, 0.06);
    color: #000000 !important;
}

.icons-menu {
    display: flex;
    align-items: center;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.icon-link {
    color: #000000;
    font-size: 1.2rem;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.icon-link:hover {
    color: #000000;
}

/* Dropdown específico */
.navbar .dropdown-menu {
    background: #ffffff;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
}

.navbar .dropdown-item {
    padding: 12px !important;
    border-radius: 0.5rem !important;
    margin: 0 8px !important;
    transition: .3s all !important;
    color: #000000 !important;
    font-family: 'Inter Tight', sans-serif;
    font-size: 0.8rem;
    line-height: 1.5;
}

.navbar .dropdown-item:hover {
    background-color: rgba(27, 31, 10, 0.06);
    color: #000000 !important;
}

/* Navbar toggler personalizado */
.navbar-toggler {
    outline: none;
    width: 31px;
    height: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
    align-self: center;
}

.navbar-toggler .hamburger {
    position: relative;
    width: 30px;
    height: 20px;
}

.navbar-toggler .hamburger span {
    position: absolute;
    right: 0;
    width: 30px;
    height: 2px;
    border-right: 5px;
    background-color: #000000;
}

.navbar-toggler .hamburger span:nth-child(1) {
    top: 0;
    transition: all 0.2s;
}

.navbar-toggler .hamburger span:nth-child(2) {
    top: 8px;
    transition: all 0.15s;
}

.navbar-toggler .hamburger span:nth-child(3) {
    top: 8px;
    transition: all 0.15s;
}

.navbar-toggler .hamburger span:nth-child(4) {
    top: 16px;
    transition: all 0.2s;
}

/* Responsive */
@media (max-width: 767px) {
    .navbar {
        min-height: 72px;
    }
    
    .navbar .navbar-logo img {
        height: 2rem !important;
    }
    
    .navbar-toggler {
        transform: scale(0.8);
    }
}

@media (max-width: 991px) {
    .icons-menu {
        padding-left: 0;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: optimize-contrast;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4));
    z-index: -1;
}

.hero-content {
    color: white;
    text-align: left;
    z-index: 1;
    position: relative;
    max-width: 600px;
    margin: 0;
    padding: 0 2rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.hero-text {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: 0;
    margin-right: 0;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.hero-btn {
    margin-top: 2rem;
}

.btn-outline-light {
    border: 2px solid #ffffff;
    color: #ffffff;
    padding: 12px 30px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background-color: #ffffff;
    color: #232323;
}

/* ===== SECCIONES GENERALES ===== */
.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #232323;
    margin-bottom: 1rem;
}

/* Títulos en secciones con fondo blanco */
.hero-section .section-title,
.equipment-section .section-title {
    color: #735b85;
}

/* Títulos en secciones con fondo #735b85 */
.studies-section .section-title,
.team-section .section-title,
.gallery-section .section-title,
.contact-section .section-title {
    color: #ffffff;
}

.section-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-top: 1rem;
}

/* Subtítulos en secciones con fondo #735b85 */
.studies-section .section-subtitle,
.team-section .section-subtitle,
.gallery-section .section-subtitle,
.contact-section .section-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

/* ===== ESTUDIOS ===== */
.studies-section,
.additional-studies-section {
    background-color: #735b85;
}

.study-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.study-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.study-image {
    overflow: hidden;
}

.study-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.study-card:hover .study-image img {
    transform: scale(1.05);
}

.study-content {
    padding: 1.5rem;
}

.study-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #232323;
}

.study-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ===== CONTADORES ===== */
.counters-section {
    background-color: #f8f9fa;
    color: #232323;
}

.counters-section .section-title {
    color: #232323;
}

.counter-item {
    padding: 2rem 1rem;
}

.counter-number {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #735b85;
}

.counter-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #232323;
}

.counter-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ===== ACORDEÓN ===== */
.instructions-section {
    background-color: #f8f9fa;
}

.accordion-item {
    border: none;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.accordion-button {
    background-color: #735b85;
    border: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1.5rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    width: 100%;
}

.accordion-button:not(.collapsed) {
    background-color: #5a4a6b;
    color: white;
}

.accordion-button:focus {
    box-shadow: none;
    border: none;
}

.accordion-button::after {
    background-image: none !important;
    content: "\f078" !important;
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    font-size: 0.8rem !important;
    color: white !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
    transition: transform 0.3s ease !important;
    width: auto !important;
    height: auto !important;
}

.accordion-button:not(.collapsed)::after {
    content: "\f077" !important;
    transform: rotate(0deg) !important;
}

.accordion-body {
    background-color: white;
    padding: 1.5rem;
    color: #232323;
    line-height: 1.6;
}

/* ===== EQUIPO ===== */
.team-section {
    background-color: #735b85;
}

.team-card {
    text-align: center;
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    height: 100%;
}

.team-card:hover {
    transform: translateY(-5px);
}

.team-image {
    overflow: hidden;
    border-radius: 50%;
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem;
}

.team-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #232323;
}

.team-position {
    color: #666;
    font-size: 1rem;
    margin-bottom: 0;
}

/* ===== EQUIPAMIENTO ===== */
.equipment-section {
    background-color: white;
}

.equipment-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.equipment-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #232323;
}

.equipment-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #666;
    margin-bottom: 0;
}

/* ===== GALERÍA CON SCROLL ===== */
.gallery-scroll-section {
    background-color: #f8f9fa;
    overflow: hidden;
}

.gallery-wrapper {
    overflow: hidden;
}

.gallery-wrapper .container,
.gallery-wrapper .container-fluid {
    overflow: hidden;
}

/* Usamos flexbox en lugar de grid para mejor compatibilidad (Safari incluido) */
.grid-container {
    display: flex;
    flex-direction: row;
    transform: translate3d(-3rem, 0, 0);
    width: 115vw;
    justify-content: flex-start;
    column-gap: 1rem;
    row-gap: 2rem;
}

.grid-container-3 {
    display: flex;
    flex-direction: row;
    gap: 0 2rem;
}

.grid-item {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.grid-item img {
    width: 25vw;
    min-width: 0;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 2rem !important;
}

/* Responsive para galería con scroll */
@media (max-width: 767px) {
    .grid-container {
        row-gap: 1rem;
    }
    
    .grid-container-3 {
        gap: 0 1rem;
    }
    
    .grid-item img {
        min-width: 35vw;
    }
}

/* ===== GALERÍA MASONRY ===== */
.gallery-section {
    background-color: #735b85;
}

.masonry-gallery {
    column-count: 4;
    column-gap: 1rem;
    padding: 0 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    break-inside: avoid;
    margin-bottom: 1rem;
    display: inline-block;
    width: 100%;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: white;
    font-size: 2rem;
}

/* Responsive masonry */
@media (max-width: 1200px) {
    .masonry-gallery {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .masonry-gallery {
        column-count: 2;
        column-gap: 0.5rem;
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .masonry-gallery {
        column-count: 1;
    }
}

/* ===== SLIDER OBRAS SOCIALES ===== */
.insurance-section {
    background-color: white;
    overflow: hidden;
}

.insurance-slider {
    position: relative;
    padding: 2rem 0;
}

.slider-container {
    overflow: hidden;
    position: relative;
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease;
    animation: slide 20s infinite linear;
}

.slider-slide {
    flex: 0 0 200px;
    margin: 0 1rem;
}

.slider-slide img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #edefea;
    border: none;
    color: #464845;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.slider-btn:hover {
    background-color: #007bff;
    color: white;
}

.slider-prev {
    left: 20px;
}

.slider-next {
    right: 20px;
}

@keyframes slide {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* ===== CONTACTO ===== */
.contact-section {
    background-color: #735b85;
}

.contact-section .section-header {
    margin-bottom: 1.5rem !important;
}


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

.contact-list-item {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #232323;
    display: flex;
    align-items: center;
    line-height: 1.5;
}

.contact-list-item i {
    color: #735b85;
    margin-right: 0.75rem;
    width: 24px;
    font-size: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.contact-list-item strong {
    font-weight: 600;
    color: #232323;
}

.map-container {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: 100%;
    max-height: 300px;
    min-height: 300px;
    flex: 1;
}

/* Asegurar que las columnas tengan la misma altura */
.contact-section .row {
    align-items: stretch;
}

.contact-section .col-12 {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.contact-info {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    min-height: 300px;
}

.copyright {
    color: #c5c2c2;
    font-size: 0.9rem;
    margin-top: 2rem;
}

/* ===== BOTÓN WHATSAPP ===== */
.whatsapp-float {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 50px;
    height: 50px;
    background-color: #25D366;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 211, 102, 0.4);
    color: #fff;
    text-decoration: none;
}

/* ===== SCROLL TO TOP ===== */
.scroll-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top:hover {
    background-color: rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-text {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .counter-number {
        font-size: 3rem;
    }
    
    .equipment-title {
        font-size: 2rem;
    }
    
    .slider-btn {
        display: none;
    }
    
    .navbar-icons {
        margin-top: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .study-image img,
    .gallery-item img {
        height: 200px;
    }
    
    .team-image {
        width: 120px;
        height: 120px;
    }
    
    .whatsapp-float {
        bottom: 80px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .scroll-to-top {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    /* Ajustes responsive para contacto */
    .contact-section .col-12 {
        height: auto;
        margin-bottom: 1rem;
    }
    
    .contact-info {
        max-height: none;
        padding: 1.5rem;
    }
    
    
}

/* ===== MODAL ===== */
.modal-header .btn-close {
    background-color: #000000;
    opacity: 0.8;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header .btn-close:hover {
    background-color: #333333;
    opacity: 1;
}

.modal-header .btn-close::before {
    content: "×";
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.modal-header .btn-close::after {
    display: none;
}

/* Asegurar que el modal se cierre correctamente */
.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1050;
}

/* ===== UTILIDADES ===== */
.text-primary {
    color: #007bff !important;
}

.text-black {
    color: #000000 !important;
}

.mb-4 {
    margin-bottom: 2rem !important;
}

.mt-4 {
    margin-top: 2rem !important;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* ===== DROPDOWN MENU ===== */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    color: #232323;
    transition: background-color 0.3s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

/* ===== MODAL ===== */
.modal-content {
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.modal-header {
    border: none;
    padding: 1rem;
    background-color: #f8f9fa;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
}

.modal-body {
    padding: 0;
}

#modalImage {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
}
