:root {
    --color-primary: #EF425E;
    --color-primary-dark: #C9324B;
    --color-accent: #001F3F;
    
    --color-bg-light: #ffffff;
    --color-bg-alt: #f9f9f9;
    --color-footer-bg: #ffffff;
    --color-border: #eeeeee;
    
    --color-error: #d63031;
    --color-success: #27ae60;
    
    --color-text-dark: #001F3F;
    --color-text-muted: #666666;
    --color-text-on-primary: #ffffff;
    
    --header-height: 90px;
    --footer-height: 150px;
    --transition-speed: 0.3s;
}

/* --- 1. CONFIGURACIÓN BASE --- */
html, body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
}

.landing-wrapper {
    padding-top: 90px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.no-scroll-home {
    height: 100vh;
    overflow: hidden;
}

/* --- 2. CABECERA (HEADER) --- */
header {
    background-color: var(--color-bg-light);
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
}

.logo-img {
    height: 75px;
    transition: height var(--transition-speed) ease;
}

.custom-nav-link {
    color: var(--color-primary) !important;
    font-weight: 700;
    margin-left: 30px;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    transition: var(--transition-speed);
}

    .custom-nav-link:hover {
        color: var(--color-accent) !important;
    }

.custom-toggler {
    border: none !important;
    font-size: 2rem;
    color: var(--color-primary) !important;
}

    .custom-toggler:focus {
        box-shadow: none !important;
    }

/* --- 3. COMPONENTES DEL HOME --- */
.content-body {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.col-left {
    width: 25%;
    background-color: var(--color-accent);
    z-index: 5;
    position: relative;
}

.col-right {
    width: 75%;
}

.floating-box {
    position: absolute;
    top: 45%;
    left: 25%;
    transform: translate(-40%, -50%);
    z-index: 20;
    color: var(--color-primary);
    padding: 50px 70px;
    font-size: 2.3rem;
    font-weight: 700;
    box-shadow: 20px 20px 40px rgba(0,0,0,0.15);
    width: 600px;
    line-height: 1.1;
    background-color: rgba(229, 229, 229, 0.95);
    backdrop-filter: blur(5px);
}

#propertyCarousel, .carousel-inner, .carousel-item {
    height: 100%;
}

.object-fit-cover {
    object-fit: cover;
}

.svg-decorativo {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    opacity: 0.3;
    pointer-events: none;
}

/* --- 4. COMPONENTES DE SERVICIOS --- */
.services-page-new {
    width: 100%;
    background-color: var(--color-bg-light);
}

.services-hero-container {
    width: 100%;
    height: calc(100vh - 120px);
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

    .services-hero-container::after {
        content: "";
        position: absolute;
        left: 70%;
        top: 45%;
        width: 400px;
        height: 400px;
        background-color: var(--color-bg-alt);
        z-index: 1;
    }

.services-main-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 5px;
    line-height: 1.3;
    color: var(--color-primary);
    text-transform: uppercase;
}

.services-img-holder {
    position: relative;
    z-index: 5;
    width: 80%;
    max-width: 900px;
    height: 60vh;
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
}

    .services-img-holder img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.service-card-minimal {
    text-align: center;
    padding: 30px;
}

.divider-ruiz {
    width: 35px;
    height: 2px;
    background-color: var(--color-primary);
    margin: 15px auto;
}

.service-card-minimal h4 {
    letter-spacing: 3px;
    font-size: 1.1rem;
    color: var(--color-text-dark);
}

/* --- 5. COMPONENTES DE CONTACTO --- */
.contact-page-wrapper {
    width: 100%;
    height: calc(100vh - 240px);
    overflow: hidden;
}

.contact-img-side {
    width: 100%;
    height: 100%;
}

    .contact-img-side img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.contact-form-container {
    width: 80%;
    max-width: 450px;
}

.contact-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--color-primary);
}

.divider-ruiz-left {
    width: 40px;
    height: 3px;
    background-color: var(--color-primary);
    margin: 15px 0 25px 0;
}

.contact-subtitle {
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.ruiz-input {
    border: none !important;
    border-bottom: 1px solid #ccc !important;
    border-radius: 0 !important;
    padding: 10px 5px !important;
    font-size: 0.85rem !important;
    letter-spacing: 1px;
    color: #333;
    transition: border-color var(--transition-speed);
}

    .ruiz-input:focus {
        box-shadow: none !important;
        border-bottom: 1px solid var(--color-primary) !important;
    }

.btn-ruiz-submit {
    background-color: var(--color-primary);
    color: white;
    border-radius: 0;
    padding: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-top: 20px;
    transition: 0.4s;
}

    .btn-ruiz-submit:hover {
        background-color: var(--color-primary-dark);
        color: var(--color-bg-light);
    }

/* --- 6. ELEMENTOS VISUALES / FOOTER IMAGE --- */
.full-width-image {
    width: 100%;
    height: 60vh;
    overflow: hidden;
}

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

footer {
    height: var(--footer-height);
    background-color: var(--color-footer-bg);
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
}


.footer-section i {
    color: var(--color-accent);
    transition: var(--transition-speed);
}

.social-icons i {
    transition: transform var(--transition-speed) ease, color var(--transition-speed);
    display: inline-block;
}

    .social-icons i:hover {
        color: var(--color-accent) !important;
        transform: translateY(-3px);
    }

.custom-footer i {
    color: var(--color-primary) !important;
}

.footer-section.border-start.border-end {
    border-color: var(--color-border) !important;
}

/* --- 7. COMPONENTES DE OBRAS --- */
.obras-hero-wrapper {
    width: 100%;
    height: 85vh;
    padding: 20px 0;
}

.obras-hero-main {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
}

.obras-title-box {
    background-color: white;
    padding: 45px 70px;
    margin-left: -20px;
    box-shadow: 15px 15px 40px rgba(0,0,0,0.15);
    z-index: 10;
}

.obras-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 8px;
    line-height: 1.2;
    color: var(--color-primary);
    margin: 0;
}

.obras-selector-container {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    max-width: 450px;
    height: 100px;
    z-index: 20;
}

.selector-btn {
    flex: 1;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-primary);
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 0.85rem;
    position: relative;
    transition: var(--transition-speed);
}

    .selector-btn.active {
        background-color: var(--color-primary);
        color: white;
    }

.indicator-icon {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 1.2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(5px);
    }

    60% {
        transform: translateY(3px);
    }
}

.obra-card {
    cursor: pointer;
    position: relative;
    background-color: #f8f8f8;
    overflow: hidden;
}

.obra-img-container {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
    display: block;
}

    .obra-img-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
        backface-visibility: hidden;
    }

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

.obra-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform var(--transition-speed) ease;
    border-top: 1px solid #eee;
}

.obra-text h5 {
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--color-primary);
    text-transform: uppercase;
}

.obra-text small {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    letter-spacing: 1px;
}

.obra-plus {
    width: 35px;
    height: 35px;
    background-color: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
}

/* --- 8. MODAL FULL WIDTH --- */
.ruiz-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ruiz-modal-content {
    width: 100%;
    height: 100%;
    background: white;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.modal-close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #333;
    z-index: 2010;
    transition: var(--transition-speed);
}

    .modal-close-btn:hover {
        color: #ff0000;
    }

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    padding: 20px;
    font-size: 2rem;
    transition: var(--transition-speed);
}

    .nav-btn:hover {
        background: rgba(255,255,255,0.2);
    }

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

.modal-main-img {
    max-height: 85vh;
    object-fit: contain;
}

.modal-counter {
    position: absolute;
    bottom: 30px;
    color: white;
    letter-spacing: 2px;
    font-size: 0.9rem;
}

.modal-description-column {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg-light);
    padding: 0 !important;
}

.modal-scroll-content {
    flex: 1;
    overflow-y: auto;
    padding: 60px 50px;
}

    .modal-scroll-content::-webkit-scrollbar {
        width: 6px;
    }

    .modal-scroll-content::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .modal-scroll-content::-webkit-scrollbar-thumb {
        background: var(--color-primary);
        border-radius: 10px;
    }

        .modal-scroll-content::-webkit-scrollbar-thumb:hover {
            background: var(--color-primary-dark);
        }

.modal-header-fixed {
    padding: 40px 50px 0 50px;
    background: white;
    z-index: 5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- 9. CARRUSEL E INTERACCIÓN --- */
#propertyCarousel {
    user-select: none;
    -webkit-user-drag: none;
}

    #propertyCarousel img {
        pointer-events: none;
    }

    #propertyCarousel .carousel-control-prev,
    #propertyCarousel .carousel-control-next {
        display: none;
    }

.carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
}

.carousel-indicators .active {
    background-color: #ffffff;
}

/* --- 10. VALIDACIÓN Y ERRORES --- */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

.ruiz-error {
    color: var(--color-error);
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-top: 5px;
    display: block;
    font-weight: 700;
}

.invalid {
    border-bottom: 2px solid var(--color-error) !important;
    background-color: rgba(231, 76, 60, 0.05) !important;
}

.validation-message {
    animation: fadeInError 0.3s ease-in;
}

@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

.invalid::placeholder {
    color: var(--color-error);
    opacity: 0.7;
}

.modified.valid:not(form) {
    border-bottom: 2px solid var(--color-success) !important;
    transition: border-color 0.3s ease;
}

.invalid:not(form) {
    border-bottom: 2px solid var(--color-error) !important;
}

/* --- 11. MEDIA QUERIES (ADAPTACIÓN) --- */

@media (min-width: 992px) {
    .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }

    .navbar-toggler {
        display: none;
    }

    .navbar-nav {
        align-items: center;
    }
}

@media (min-width: 992px) and (max-width: 1200px) {
    header {
        min-height: 70px !important;
        padding: 5px 0;
    }

    .logo-img {
        height: 55px !important;
    }

    .custom-nav-link {
        margin-left: 15px;
        font-size: 0.8rem;
    }

    .floating-box {
        width: 350px;
        padding: 30px 40px;
        font-size: 1.3rem;
        left: 24.5%;
    }
}

@media (max-width: 991.98px) {
    header {
        min-height: 60px !important;
    }

    .logo-img {
        height: 45px;
    }

    .navbar-collapse {
        background: white;
        padding: 20px;
        border-radius: 0 0 10px 10px;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    }

    .navbar-nav {
        padding: 20px 0;
    }

    .custom-nav-link {
        margin: 10px 0 !important;
        border-bottom: 1px solid var(--color-border);
        padding-bottom: 10px;
    }
    
    .nav-item:last-child .custom-nav-link {
        border-bottom: none;
    }

    .landing-wrapper {
        height: auto;
        padding-top: 45px;
        overflow-y: auto;
        display: block;
    }

    .no-scroll-home {
        height: auto;
        overflow: visible;
    }

    .content-body {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .col-right {
        width: 100%;
        height: 73vh;
        order: 1;
    }

    .floating-box {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        padding: 25px 15px;
        font-size: 1.5rem;
        text-align: center;
        order: 2;
        box-shadow: none;
    }

    .col-left {
        width: 100%;
        height: 60px;
        order: 3;
        display: flex;
        align-items: center;
    }

    .svg-decorativo {
        width: 150px;
        opacity: 0.15;
        left: 10px;
    }

    footer {
        height: auto;
        padding: 40px 25px;
        order: 4;
        display: block;
    }

    .services-hero-container {
        height: auto;
        padding: 60px 0;
    }

    .services-main-title {
        text-align: center;
        margin-bottom: 30px;
    }

    .services-hero-container::after {
        display: none;
    }

    .services-img-holder {
        width: 100%;
        height: 40vh;
    }

    .ruiz-modal-content {
        overflow-y: auto;
    }

    .col-md-8 {
        height: 50vh !important;
    }

    .col-md-4 {
        height: auto !important;
        padding: 30px !important;
    }
}

@media (max-width: 768px) {
    .services-cover::after {
        width: 200px;
        height: 200px;
        bottom: 80px;
    }

    .services-img {
        max-width: 90%;
    }

    .contact-page-wrapper {
        height: auto;
        overflow: visible;
    }

    .contact-form-container {
        padding: 50px 20px;
    }

    .obras-hero-wrapper {
        height: 70vh;
        padding: 10px 0;
    }

    .obras-hero-main {
        align-items: flex-start;
        padding-top: 15%;
    }

    .obras-title-box {
        padding: 20px 30px;
        margin-left: 0;
        width: 80%;
        box-shadow: 10px 10px 20px rgba(0,0,0,0.1);
    }

    .obras-title {
        font-size: 1.4rem;
        letter-spacing: 4px;
    }

    .obras-selector-container {
        position: absolute;
        bottom: 0;
        right: 0;
        left: auto;
        width: 100%;
        max-width: 280px;
        height: 70px;
    }

    .selector-btn {
        padding: 10px;
        font-size: 0.7rem;
    }

    .indicator-icon {
        bottom: 5px;
        right: 8px;
        font-size: 0.9rem;
    }

    .obra-img-container {
        height: 280px;
    }

    .obra-info-overlay {
        padding: 15px;
    }
}
