/* ============================================
   Multiservicios Merino — Custom Styles
   ============================================ */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: #D4A843;
    color: #1B4332;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FDF8F0;
}
::-webkit-scrollbar-thumb {
    background: #2D6A4F;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #1B4332;
}

/* ============================================
   Navigation
   ============================================ */
#navbar {
    transition: background-color 0.5s ease, box-shadow 0.5s ease, padding 0.5s ease;
}

#navbar.scrolled {
    background-color: rgba(27, 67, 50, 0.97);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #D4A843;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile menu */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background-color: #D4A843;
    transition: width 0.3s ease;
}

.mobile-link:hover::after {
    width: 100%;
}

/* Hamburger animation */
.menu-line {
    transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
    background-color: #1B4332;
}

#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#menuBtn.active .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    width: 6px;
    background-color: #1B4332;
}

#mobileMenu.open ~ #menuBtn .menu-line,
#menuBtn.active .menu-line {
    /* handled by .active class */
}

/* ============================================
   Hero Animations
   ============================================ */
.hero-anim {
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-anim.animated {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hero-anim:nth-child(1) { transition-delay: 0.1s; }
.hero-anim:nth-child(2) { transition-delay: 0.3s; }
.hero-anim:nth-child(3) { transition-delay: 0.5s; }
.hero-anim:nth-child(4) { transition-delay: 0.7s; }

.hero-img {
    transition: opacity 1s ease, transform 1s ease;
}

.hero-img.animated {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   Reveal Animations
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ============================================
   Service Cards
   ============================================ */
.service-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(27, 67, 50, 0.2);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 0;
    background-color: #D4A843;
    transition: height 0.4s ease;
}

.service-card:hover::before {
    height: 100%;
}

/* ============================================
   Property Cards
   ============================================ */
.property-card {
    transition: transform 0.4s ease;
}

.property-card:hover {
    transform: translateY(-4px);
}

.property-card img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================
   Form Styles
   ============================================ */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6560' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ============================================
   Decorative Divider
   ============================================ */
.divider-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.divider-ornament::before,
.divider-ornament::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #D4A843, transparent);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .hero-anim {
        opacity: 1;
        transform: translateY(0);
    }

    .hero-img {
        opacity: 1;
        transform: scale(1);
    }

    .service-card {
        padding: 2rem 1.5rem;
    }

    .property-card img {
        height: 240px;
    }
}

@media (max-width: 640px) {
    #navbar {
        background-color: transparent;
    }

    #navbar.scrolled {
        background-color: rgba(27, 67, 50, 0.97);
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    #navbar,
    #mobileMenu {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    section {
        page-break-inside: avoid;
    }
}
