/* =========================================
   VARIABLES Y CONFIGURACIÓN GENERAL
   ========================================= */
:root {
    --color-section-dark: #193C1A;
    --color-bg-light: #FEFEFE;
    --color-text-main: #174B1D;
    --color-accent-icon: #D7B644;
    --color-heading: #193C1A;
    --color-bg-dark: #0E2610;
}

@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/Merriweather-VariableFont_opsz,wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
}

@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/Merriweather-Italic-VariableFont_opsz,wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
}

body {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Merriweather', 'Segoe UI', Tahoma, Geneva, Verdana, serif;
    color: var(--color-text-main);
    background-color: var(--color-bg-dark);
    /* Changed from light to dark to fix header scroll gap */
    position: relative;
}

.main-content-wrapper {
    background-color: var(--color-bg-light);
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--color-heading);
}

.text-brand {
    color: var(--color-accent-icon);
}

.text-title {
    color: var(--color-section-dark);
}

.text-brand-link {
    color: var(--color-accent-icon);
}

.text-brand-link:hover {
    color: #936813;
}

.text-number {
    color: var(--color-section-dark)
}

.text-head-footer {
    color: var(--color-accent-icon);
}

.text-brand-accent {
    color: #F4D06F;
    /* Lighter gold for contrast on dark backgrounds */
}

/* =========================================
   BOTONES Y ELEMENTOS DE INTERFAZ
   ========================================= */
.bg-bot {
    background-color: #BA9031;
}

.bg-success-f {
    background-color: var(--color-section-dark);
}

.bg-success-s {
    background-color: #B08E43;
}

.bg-success-t {
    background-color: #B08E43;
}

.container .btn-brand {
    background-color: #ad934a;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244, 208, 111, 0.4);
    border: none;
}

.btn-brand:hover {
    background-color: #ccad59;
}

.btn-outline-brand {
    border: 2px solid var(--color-section-dark);
    color: var(--color-section-dark);
    padding: 10px 25px;
}

.btn-outline-brand:hover {
    background-color: var(--color-section-dark);
    color: white;
}

.btn-outline-success {
    border-color: var(--color-heading);
    color: var(--color-heading);
    margin-bottom: 5px;
}

.btn-outline-success:hover {
    background-color: var(--color-heading);
    color: white;
}

/* =========================================
   NAVEGACIÓN (NAVBAR)
   ========================================= */
.navbar-brand img {
    height: 50px;
}

.nav-link {
    font-weight: 500;
    color: var(--color-text-main) !important;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-section-dark) !important;
}

.navbar-dark .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link.active {
    color: var(--color-accent-icon) !important;
}

.bg-brand-dark {
    background-color: var(--color-bg-dark) !important;
}

.navbar {
    transition: transform 0.3s ease-in-out;
}

.navbar-hidden {
    transform: translateY(-100%);
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero-section {
    background: linear-gradient(rgba(25, 60, 26, 0.5), rgba(186, 144, 49, 0.5)), url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 150px 0;
    position: relative;
    overflow: hidden;
}

.hero-section .container {
    z-index: 1;
    position: relative;
}

.bg-picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    opacity: 1;
    filter: brightness(0.85) blur(1.5px);
    transform: scale(1.02);
}

.picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 80%;
    height: auto;
    object-fit: cover;
    z-index: 0;
    opacity: 1;
}

/* =========================================
   TARJETAS DE PROPIEDADES (LOTES)
   ========================================= */
.lot-card {
    border: none;
    box-shadow: 0 5px 15px rgba(186, 144, 49, 0.1);
    transition: transform 0.3s;
    background-color: #ffffff;
}

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

.lot-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.property-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    background-color: #ffffff;
    border: none;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(186, 144, 49, 0.15) !important;
}

.card-img-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.property-card:hover .card-img-wrapper img {
    transform: scale(1.1);
}

/* =========================================
   SECCIÓN NOSOTROS (ABOUT)
   ========================================= */
.about-img-wrapper {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    height: 400px;
    border: 1px solid var(--color-bg-light);
}

.about-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.about-img-wrapper:hover img {
    transform: scale(1.02);
}

.team-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #ffffff;
    border-radius: 15px !important;
}

.team-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(186, 144, 49, 0.15) !important;
}

.team-img-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-bg-light);
}

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

/* =========================================
   SERVICIOS Y MAPA
   ========================================= */
.service-card {
    transition: transform 0.3s ease;
    background-color: #ffffff;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-accent-icon) !important;
}

.service-card i {
    color: var(--color-accent-icon);
}

.map-scroll-container {
    height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--color-bg-light);
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--color-section-dark) var(--color-bg-light);
}

.map-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.map-scroll-container::-webkit-scrollbar-track {
    background: var(--color-bg-light);
}

.map-scroll-container::-webkit-scrollbar-thumb {
    background-color: var(--color-section-dark);
    border-radius: 4px;
}

/* =========================================
   TESTIMONIOS
   ========================================= */
.testimonial-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(186, 144, 49, 0.1) !important;
}

.testimonial-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid var(--color-accent-icon);
    padding: 2px;
    background-color: #fff;
}

.role-text {
    color: var(--color-heading);
    font-weight: 600;
    font-size: 0.85rem;
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background-color: var(--color-bg-dark);
    color: var(--color-bg-light);
}

/* =========================================
   MODAL VIDEO & MEDIA
   ========================================= */
.modal-backdrop.show {
    opacity: 0.85;
    backdrop-filter: blur(8px);
}

#videoModal .modal-content {
    animation: modalAppear 0.4s ease-out;
    background: transparent;
    border: none;
}

.ratio-9x16 {
    --bs-aspect-ratio: 177.77%;
    position: relative !important;
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    /* Keeping original shadow as base, but relying on new glow class for the requested effect */
    box-shadow: 0 20px 40px rgba(186, 144, 49, 0.4);
}

.modal-video-glow {
    box-shadow: 0 0 40px rgba(244, 208, 111, 0.6) !important;
    /* Strong golden glow all around */
    border: 1px solid rgba(244, 208, 111, 0.3);
    /* Subtle border definition */
}

.ratio-4x5 {
    --bs-aspect-ratio: 125%;
    /* 4:5 aspect ratio (taller than wide) */
}

.ratio-9x16 .custom-close-btn {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    left: auto !important;
    z-index: 1055 !important;
    width: 40px;
    height: 40px;
    padding: 0;

    /* Aesthetics from custom-play-btn */
    background-color: rgba(14, 38, 16, 0.7) !important;
    /* Dark green with opacity */
    border: 2px solid #F4D06F;
    /* Gold accent */
    backdrop-filter: blur(4px);
    border-radius: 50%;

    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 1;
    transition: all 0.3s ease;

    /* Ensure the X icon (from bootstrap class btn-close) is visible */
    /* Usually btn-close uses a filter for color. */
    /* If we want gold X, we might need a custom mask or just use standard white. */
    /* Let's try standard white first as it contrasts well with dark green */
}

.ratio-9x16 .custom-close-btn:hover {
    background-color: rgba(14, 38, 16, 0.9) !important;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(244, 208, 111, 0.4);
}

#videoModal video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    outline: none;
}

.modal-vertical {
    max-width: 400px;
    margin: 1.75rem auto;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Video Play Button */
.video-container {
    position: relative;
    cursor: pointer;
}

.custom-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(14, 38, 16, 0.7);
    /* Dark green with opacity */
    border: 2px solid #F4D06F;
    /* Gold accent */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 30;
    /* SUPER HIGH - Above controls */
    backdrop-filter: blur(4px);
    box-shadow: 0 0 0 0 rgba(244, 208, 111, 0.7);
    animation: pulse-gold 2s infinite;
    cursor: pointer;
    /* Ensure pointer cursor */
    pointer-events: auto;
    /* Force clickable */
}

.custom-play-btn i {
    font-size: 2.5rem;
    color: #F4D06F;
    margin-left: 5px;
    /* Visual correction for play icon */
    transition: transform 0.3s ease;
}

.video-container:hover .custom-play-btn {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(14, 38, 16, 0.9);
    box-shadow: 0 0 20px rgba(244, 208, 111, 0.5);
}

.video-container:hover .custom-play-btn i {
    transform: scale(1.2);
    color: #fff;
}

.video-playing .custom-play-btn {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.8);
}

@keyframes pulse-gold {
    0% {
        transform: translate(-50%, -50%) scale(0.95);
        box-shadow: 0 0 0 0 rgba(244, 208, 111, 0.7);
    }

    70% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 20px rgba(244, 208, 111, 0);
    }

    100% {
        transform: translate(-50%, -50%) scale(0.95);
        box-shadow: 0 0 0 0 rgba(244, 208, 111, 0);
    }
}

.custom-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1050;
    width: 35px;
    height: 35px;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    opacity: 1;
    transition: all 0.3s ease;
    filter: invert(1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* =========================================
   CUSTOM VIDEO CONTROLS BAR
   ========================================= */
.custom-video-controls {
    position: absolute !important;
    /* Force override Bootstrap .ratio > * */
    top: auto !important;
    /* Force override Bootstrap top: 0 */
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    /* Force override Bootstrap height: 100% */
    max-height: 60px;
    /* Thinner constraint */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 8px 15px;
    /* Sleek padding */
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    display: flex;
    align-items: center;
    pointer-events: none;
    gap: 10px;
    /* Consistent spacing */
}

/* Visibility Logic */
.video-container:hover .custom-video-controls,
.video-playing .custom-video-controls {
    /* Only show on hover or when playing (logic handles 'video-playing' class) 
       Actually, if 'video-playing' is present, we want controls accessible.
       But if mouse is NOT over, maybe we want them hidden? 
       Usually hover is enough. 
    */
}

/* Specific rule: If the container is hovered, show controls and enable pointer events */
.video-container:hover .custom-video-controls {
    opacity: 1;
    pointer-events: auto;
}

/* But if we are paused, we want the BIG PLAY BUTTON to take precedence. */
/* The big play button is Z-index 10. Controls are Z-index 20. */
/* If controls cover the center (which they SHOULDN'T), they block the button. */
/* We will increase Play Button Z-Index to be safely above controls just in case of layout weirdness */

.btn-control {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
    font-size: 1.1rem;
    /* Slightly smaller icon */
    width: 24px;
    /* Smaller touch target visual */
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Context */
    z-index: 25;
    /* Ensure buttons are clickable if visible */
}

.btn-control:hover {
    color: #F4D06F;
    /* Brand gold */
    transform: scale(1.1);
}

/* Progress Bar Customization */
.progress-container {
    position: relative;
    height: 10px;
    /* Larger hit area, smaller visual */
    cursor: pointer;
    display: flex;
    align-items: center;
    z-index: 25;
}

.progress-bar-bg {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    /* Very thin, elegant */
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transform: translateY(-50%);
    pointer-events: none;
    /* Let clicks pass to input */
}

.progress-bar-fill {
    height: 100%;
    background-color: #F4D06F;
    /* Brand gold */
    border-radius: 10px;
    width: 0%;
    position: relative;
    box-shadow: 0 0 10px rgba(244, 208, 111, 0.3);
    /* Subtle glow */
}

/* Thumb/Knob logic via input range */
.seek-bar {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 20px;
    /* Reduced from 100% to avoid overlay issues */
    transform: translateY(-50%);
    opacity: 0;
    /* Hide default slider, we use it for logic */
    cursor: pointer;
    z-index: 30;
    /* Needs to be high to catch clicks on the bar */
    margin: 0;
}

/* We can add a visible knob on the fill if we want, or simple bar */
.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-container:hover .progress-bar-fill::after {
    opacity: 1;
}

.custom-close-btn:hover {
    background-color: var(--color-section-dark);
    transform: scale(1.1);
}

#modalTestimonio1 video,
#modalTestimonio2 video {
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background-color: #000;
}

/* =========================================
   RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 768px) {

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .hero-section {
        padding: 60px 0;
        text-align: center;
    }

    .bg-picture,
    .picture {
        width: 100%;
        max-width: 100vw;
        height: 130%;
        transform: none !important;
        left: 0;
    }

    .picture {
        position: relative;
        width: 80%;
        max-width: 80%;
        margin: 0 auto 20px auto;
        opacity: 0.6;
    }

    .about-img-wrapper {
        height: 250px;
        margin-bottom: 20px;
    }

    .btn-brand,
    .btn-outline-brand {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }

    .map-scroll-container {
        height: 350px;
    }

    .team-card {
        margin-bottom: 20px;
    }

    .navbar-brand img {
        height: 40px;
    }
}

/* =========================================
   MODAL DE CONTACTO
   ========================================= */
.bg-brand-light {
    background-color: #f8f6f3;
    /* Variante muy clara del color de fondo */
    border-bottom: 2px solid rgba(186, 144, 49, 0.1);
}

.text-title-dark {
    color: var(--color-section-dark);
}

.btn-contact-option {
    border: 1px solid rgba(186, 144, 49, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: #fff;
    position: relative;
    overflow: hidden;
}

.btn-contact-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(186, 144, 49, 0.1);
    border-color: var(--color-accent-icon);
}

.icon-square-bg {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.bg-telegram-light {
    background-color: rgba(0, 136, 204, 0.1);
}

.text-telegram {
    color: #0088cc;
}

.bg-whatsapp-light {
    background-color: rgba(37, 211, 102, 0.1);
}

.text-whatsapp {
    color: #25d366;
}

.btn-contact-option:hover .icon-square-bg {
    transform: scale(1.1);
}

.telegram-option:hover .bg-telegram-light {
    background-color: #0088cc;
}

.telegram-option:hover .text-telegram {
    color: white !important;
}

.whatsapp-option:hover .bg-whatsapp-light {
    background-color: #25d366;
}

.whatsapp-option:hover .text-whatsapp {
    color: white !important;
}

.arrow-icon {
    transition: transform 0.3s ease;
}

.btn-contact-option:hover .arrow-icon {
    transform: translateX(5px);
    color: var(--color-accent-icon) !important;
}

/* =========================================
   PRELOADER
   ========================================= */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fdfbf9;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

.loader-content {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-logo {
    width: 85px;
    height: auto;
    z-index: 2;
    animation: logoBreathe 2.5s ease-in-out infinite;
}

.loader-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--color-section-dark);
    border-right-color: rgba(186, 144, 49, 0.3);
    z-index: 1;
    animation: spin 1.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.loader-circle::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-bottom-color: var(--color-accent-icon);
    border-left-color: rgba(207, 147, 93, 0.3);
    opacity: 0.8;
    animation: spinReverse 2.2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes spinReverse {
    0% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@keyframes logoBreathe {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(100%);
    }

    50% {
        transform: scale(1.05);
        filter: brightness(110%);
    }
}

body.loaded {
    overflow: auto;
    /* Restaurar scroll */
}

body.loading {
    overflow: hidden;
    /* Bloquear scroll mientras carga */
}

.loaded #preloader {
    opacity: 0;
    visibility: hidden;
}

/* =========================================
   SOLUCIÓN MODAL MENU MÓVIL (SIDE DRAWER)
   ========================================= */
@media (max-width: 991px) {

    /* 1. Navbar Toggler (Botón hamburguesa) */
    .navbar-toggler {
        z-index: 1060 !important;
        position: relative;
        border: none !important;
        outline: none !important;
    }

    .navbar-brand {
        z-index: 1055;
    }

    /* 2. El Contenedor DRAWER (Panel Lateral) */
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: 0;
        width: 75%;
        /* Un poco más estrecho */
        max-width: 280px;
        height: 100vh !important;
        background-color: var(--color-bg-dark);
        z-index: 1059;

        /* 3. El Contenedor DRAWER (Panel Lateral) */
        .navbar-collapse {
            position: fixed;
            top: 0;
            right: 0;
            width: 75%;
            /* Un poco más estrecho */
            max-width: 280px;
            height: 100vh !important;
            background-color: var(--color-bg-dark);
            z-index: 1059;

            /* FORCE DISPLAY to ensure transition works */
            display: flex !important;
            flex-direction: column;
            justify-content: flex-start;
            align-items: flex-start;
            text-align: left;
            padding-top: 80px;
            padding-left: 25px;
            padding-right: 25px;

            /* ESTADO INICIAL: OCULTO */
            transform: translateX(100%);
            visibility: hidden;
            /* Oculto pero renderizado para animación */

            /* ANIMACIÓN SIMÉTRICA */
            transition: transform 0.3s ease-in-out, visibility 0.3s;

            box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
            max-height: none !important;
            opacity: 1;
        }

        /* 3. ESTADO VISIBLE (Triggered by .show OR .drawer-open) */
        .navbar-collapse.show,
        .navbar-collapse.drawer-open,
        .navbar-collapse.collapsing {
            transform: translateX(0);
            visibility: visible;
        }

        /* 4. Fix Animación Bootstrap */
        .navbar-collapse.collapsing {
            /* Mantener visible durante transición */
            position: fixed;
            top: 0;
            right: 0;
            z-index: 1059;
            display: flex !important;

            /* Override Bootstrap's height transition */
            transition: transform 0.3s ease-in-out, visibility 0.3s;
            transform: translateX(0);
            visibility: visible;
        }

        flex-direction: column;
        padding-top: 80px;
        padding-left: 25px;
        padding-right: 25px;

        transition: transform 0.3s ease-in-out;
        /* IMPORTANTE: Si está colapsando PERO tiene la clase drawer-open, queremos que se vea */
        /* Pero .collapsing se usa para abrir Y cerrar. */
        /* Al abrir: JS pone drawer-open. CSS -> translateX(0). Bootstrap pone .collapsing. */
        /* Necesitamos que .collapsing NO sobrescriba con translateX(100%) si drawer-open está presente. */
    }

    .navbar-collapse.collapsing.drawer-open {
        transform: translateX(0) !important;
    }

    /* Solo cuando cierra (se quita drawer-open), .collapsing debe tener 100% */
    .navbar-collapse.collapsing:not(.drawer-open) {
        transform: translateX(100%);
    }

    /* 5. Estilo de enlaces */
    .navbar-nav {
        width: 100%;
        gap: 20px;
        align-items: flex-start;
    }

    /* Líneas separadoras más sutiles */
    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 10px;

        /* Animación de items un poco más rápida */
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s ease;
        transition-delay: 0s;
    }

    .navbar-collapse.show .nav-item {
        opacity: 1;
        transform: translateX(0);
    }

    /* Delays reducidos para sensación snappy */
    .navbar-collapse.show .nav-item:nth-child(1) {
        transition-delay: 0.1s;
    }

    .navbar-collapse.show .nav-item:nth-child(2) {
        transition-delay: 0.15s;
    }

    .navbar-collapse.show .nav-item:nth-child(3) {
        transition-delay: 0.2s;
    }

    .navbar-collapse.show .nav-item:nth-child(4) {
        transition-delay: 0.25s;
    }

    .navbar-collapse.show .nav-item:nth-child(5) {
        transition-delay: 0.3s;
    }

    /* FUENTE REDUCIDA (40% menos aprox de 1.2rem -> 0.85rem) */
    .nav-link {
        font-size: 0.85rem;
        color: #fff !important;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        /* Más espaciado para elegancia */
    }

    .nav-link:hover,
    .nav-link.active {
        color: #F4D06F !important;
        padding-left: 8px;
        transition: 0.2s;
    }

    /* BOTÓN CONTACTO DESTACADO (Highlight) */
    .nav-item .btn-brand {
        width: 100%;
        margin-top: 15px;
        text-align: center;
        /* Estilo más agresivo/visible */
        background-color: #F4D06F;
        color: #0E2610;
        /* Texto oscuro para contraste */
        font-weight: 800;
        /* Negrita */
        box-shadow: 0 4px 15px rgba(244, 208, 111, 0.4);
        /* Glow dorado */
        border: none;
        padding: 12px;
        font-size: 0.9rem;
    }

    .nav-item .btn-brand:active {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(244, 208, 111, 0.2);
    }
}

/* =========================================
   GALERÍA ALTAVISTA (SCROLL & LIGHTBOX)
   ========================================= */
.gallery-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 20px 5px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll iOS */
    scrollbar-width: none;
    /* Firefox */
    cursor: grab;
    scroll-behavior: smooth;
    /* Important for JS auto-scroll */
}

.gallery-scroll-container:active {
    cursor: grabbing;
}

.gallery-scroll-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.gallery-card {
    flex: 0 0 85%;
    /* Móvil: ocupa casi toda la pantalla */
    scroll-snap-align: center;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    cursor: pointer;
    /* Indica que es clicable */
}

@media (min-width: 768px) {
    .gallery-card {
        flex: 0 0 400px;
        /* Anchos fijos en desktop para mejor control */
    }
}

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

.gallery-img {
    width: 100%;
    height: 350px;
    /* Altura fija para uniformidad */
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

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

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 20px;
    color: white;
    pointer-events: none;
    /* Dejar pasar el click a la card */
}

/* Hero Texto Shadow específico */
.hero-title-shadow {
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}


/* =========================================
   LIGHTBOX MEJORADO (GOLDEN GLOW)
   ========================================= */
.lightbox-container {
    position: relative;
    display: inline-block;
    border-radius: 15px;
    overflow: hidden;
    background-color: #000;
}

/* Reutilizamos .modal-video-glow y .custom-close-btn pero aseguramos contexto */
.lightbox-container .custom-close-btn {
    /* Mismas reglas que en video */
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    z-index: 1055 !important;
    width: 40px;
    height: 40px;
    background-color: rgba(14, 38, 16, 0.7) !important;
    border: 2px solid #F4D06F;
    backdrop-filter: blur(4px);
    border-radius: 50%;
    opacity: 1;
    filter: none;
    /* Quitamos invert si lo hubiera heredado */
}

.lightbox-container .custom-close-btn:hover {
    background-color: rgba(14, 38, 16, 0.9) !important;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(244, 208, 111, 0.4);
}

.lightbox-caption-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 30px 20px 20px;
    text-align: left;
    pointer-events: none;
}

#lightboxCaption {
    color: #F4D06F;
    /* Dorado solicitado */
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* =========================================
   AJUSTE MODAL CONTACTO (MÓVIL)
   Reducción del ancho al 95% en dispositivos móviles
   ========================================= */
@media (max-width: 768px) {
    #contactModal .modal-dialog {
        max-width: 95% !important;
        margin: 1rem auto;
    }
}

/* =========================================
   FIX DESPLAZAMIENTO MODAL (MÓVIL)
   Evita que el contenido "salte" o aparezca una línea blanca
   a la derecha al abrir cualquier modal en móviles.
   Forzamos padding-right: 0 en body y elementos fijos.
   ========================================= */
@media (max-width: 991px) {

    body.modal-open,
    .model-open .navbar,
    .navbar.sticky-top,
    .fixed-top,
    .fixed-bottom {
        padding-right: 0 !important;
        overflow: hidden !important;
    }
}

/* =========================================
   SELECTOR DE DESARROLLO (SERVICES - ALTAVISTA)
   ========================================= */
.development-selector .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 12px 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Shine effect for active button */
.development-selector .btn-brand::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    100% {
        left: 200%;
        opacity: 0;
    }
}

.development-selector .btn i {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.development-selector .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(173, 147, 74, 0.2);
    /* Using brand color in shadow */
}

.development-selector .btn:hover i {
    transform: scale(1.2) rotate(8deg);
}

.development-selector .btn.active i,
.development-selector .btn-brand i {
    transform: scale(1.1);
}

/* Loading overlay transition */
#loadingOverlay {
    backdrop-filter: blur(2px);
}