:root {
    --bg-dark: #0a0a0c;
    --bg-panel: #14151a;
    --text-main: #f0f0f2;
    --text-muted: #9ba1a6;
    --accent: #f5b041;
    /* Safety Yellow/Orange */
    --accent-hover: #f39c12;
    --glass-bg: rgba(20, 21, 26, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: transparent;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 5%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-main);
}

.btn-primary {
    background: var(--accent);
    color: #000 !important;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(245, 176, 65, 0.2);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 176, 65, 0.4);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    padding: 8rem 5% 4rem;
    position: relative;
    background-image:
        linear-gradient(to right, rgba(10, 10, 12, 0.95) 0%, rgba(10, 10, 12, 0.7) 100%),
        url('./assets/hero-bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    align-items: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 50%, rgba(245, 176, 65, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 2;
    margin-top: -20vh; /* Subió aún más */
}

.hero-content h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 500px;
}

.stats {
    display: flex;
    gap: 3rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Glassmorphism Form */
.hero-form-container {
    position: relative;
    z-index: 10;
    perspective: 1000px;
}

.booking-form {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
    /* REMOVED overflow: hidden if it existed, just to be sure */
}

.booking-form:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
}

.booking-form h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.booking-form h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.input-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input,
.input-group select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 0.9rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(245, 176, 65, 0.1);
}

.autocomplete-container {
    position: relative;
    /* Evitar que modifique el flujo del input group original */
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999;
    /* Ensure it's above everything including Leaflet */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
    display: none;
}

.suggestion-item {
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(245, 176, 65, 0.1);
    color: var(--accent);
}

::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}

.estimate-container {
    background: rgba(245, 176, 65, 0.1);
    border: 1px solid rgba(245, 176, 65, 0.3);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.estimate-container h4 {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.estimate-container p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-top-map {
    width: 100%;
    height: 200px;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 20;
    position: relative;
}

/* Ajuste estilo Leaflet en modo oscuro */
.leaflet-container {
    background-color: var(--bg-panel);
    font-family: 'Outfit', sans-serif;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--bg-panel) !important;
    color: var(--text-main) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8) !important;
}

.leaflet-popup-close-button {
    color: var(--text-muted) !important;
}

.leaflet-popup-close-button:hover {
    color: var(--text-main) !important;
}

.map-expanded {
    position: fixed !important;
    top: 10vh !important;
    left: 10vw !important;
    width: 80vw !important;
    height: 80vh !important;
    z-index: 99999 !important;
    margin: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8) !important;
    border: 1px solid var(--accent) !important;
}

/* Fondo oscuro cuando el mapa se expande */
body.map-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 99998;
    pointer-events: none;
}

body.map-open .hero-form-container {
    perspective: none !important;
    z-index: 99999;
}

body.map-open .booking-form {
    transform: none !important;
    transition: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform-style: flat !important;
}

.leaflet-popup-content .btn-location {
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    padding: 5px 10px;
    margin: 3px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.leaflet-popup-content .btn-location:hover {
    background: var(--accent-hover);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.btn-submit {
    width: 100%;
    background: var(--accent);
    color: #000;
    border: none;
    padding: 1.2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%) rotate(35deg) scale(0);
    transition: transform 0.5s ease;
}

.btn-submit:hover {
    background: var(--accent-hover);
}

.btn-submit:hover::after {
    transform: translate(-50%, -50%) rotate(35deg) scale(1);
}

.btn-submit.loading {
    color: transparent;
}

.btn-submit.loading::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
    text-align: center;
}

.form-message.success {
    display: block;
    background: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

/* Services */
.services {
    padding: 8rem 5%;
    background: var(--bg-dark);
}

.section-title {
    text-align: center;
    margin-bottom: 5rem;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 2rem;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card .icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 1rem;
    background: rgba(245, 176, 65, 0.1);
    border-radius: 50%;
}

.service-card h4 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Footer */
footer {
    background: var(--bg-panel);
    padding: 4rem 5% 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 300px;
}

.footer-links h4 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

.footer-links p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* Animations */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 8rem;
    }

    .hero-content {
        margin-top: 0; /* Corrige el texto montado en el logo */
    }

    .hero-content h1 {
        font-size: 3.2rem;
    }

    .hero-content p {
        margin: 0 auto 3rem;
    }

    .stats {
        justify-content: center;
        margin-bottom: 3rem;
    }

    .services {
        padding: 5rem 5%;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 1rem 5%;
    }

    .logo {
        font-size: 1.4rem;
    }

    .nav-links {
        display: none;
    }

    .hero {
        padding-top: 7rem;
        padding-bottom: 2rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .stat-num {
        font-size: 1.8rem;
    }

    .stats {
        gap: 1.5rem;
    }

    .booking-form {
        padding: 1.5rem;
    }

    .booking-form h3 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .input-group {
        margin-bottom: 1rem;
    }

    .footer-content {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 2rem;
    }

    .footer-brand p {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 0.95rem;
    }

    .booking-form {
        padding: 1.2rem;
    }

    .input-group input, 
    .input-group select {
        padding: 0.8rem;
    }
    
    .btn-primary {
        padding: 0.6rem 1.2rem;
    }
}