@media (max-width: 1200px) {
    /*PROPIEDADES*/
    .propiedades-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-field-group {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-advanced-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .propiedad-layout {
        grid-template-columns: 1fr;
    }
    
    .propiedad-sidebar {
        max-width: 600px;
        margin: 0 auto;
    }

    .servicios-grid-five {
        grid-template-columns: repeat(2, 1fr);
        max-width: 800px;
    }
    
    .servicios-grid-five .servicio-card:nth-child(4),
    .servicios-grid-five .servicio-card:nth-child(5) {
        grid-column: auto;
    }
    
    .servicios-grid-five .servicio-card:nth-child(5) {
        grid-column: 1 / -1;
        max-width: 380px;
        margin: 0 auto;
    }
}

@media (max-width: 1100px) {
    .navbar-tagline {
        display: none;
    }
}

@media (max-width: 1024px) {
    .navbar-menu {
        gap: 1.5rem;
    }
    
    .navbar-actions {
        gap: 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }

    .search-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .search-button {
        grid-column: 1 / -1;
    }
    
    .expertos-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .experto-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .experto-sidebar {
        position: static;
    }

    .vision-grid,
    .valores-grid,
    .sostenibilidad-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .impacto-grid {
        grid-template-columns: 1fr;
    }

    .estadisticas-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dropdown-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .dropdown-featured {
        grid-column: 1 / -1;
    }
}

/* Tablet */
@media (max-width: 968px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }
    
    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar-open .admin-sidebar {
        transform: translateX(0);
    }
    
    .admin-content {
        margin-left: 0;
    }

    .blog-post-card.featured {
        grid-template-columns: 1fr;
    }
    
    .blog-post-card.featured .blog-post-image {
        height: 300px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }

    .service-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .service-sidebar {
        position: static;
    }
    
    .timeline {
        padding-left: 2rem;
    }
    
    .timeline-marker {
        left: -2.5rem;
    }
    
    .process-steps {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   MOBILE — max-width: 768px
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --spacing-md: 1.5rem;
        --spacing-lg: 2.5rem;
        --spacing-xl: 3rem;
    }

    /* ── Navbar ── */
    .navbar {
        background: rgba(255, 255, 255, 0.98);
        border-bottom: 1px solid var(--border-color);
        position: relative;
        z-index: 1000;
    }

    .navbar .container {
        padding: 0 1rem;
        height: 70px;
    }

    /* Ocultar elementos que no caben */
    .navbar-tagline {
        display: none !important;
    }

    .navbar-indicator {
        display: none !important;
    }

    /* Mostrar hamburguesa */
    .navbar-toggle {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 5px !important;
        width: 40px !important;
        height: 40px !important;
        padding: 6px !important;
        background: transparent !important;
        border: none !important;
        cursor: pointer !important;
        z-index: 10002 !important;
        position: relative !important;
        flex-shrink: 0 !important;
    }

    .navbar-toggle span {
        display: block !important;
        width: 24px !important;
        height: 2px !important;
        background: var(--text-primary, #1e293b) !important;
        border-radius: 2px !important;
        transition: all 0.3s ease !important;
        transform-origin: center !important;
    }

    /* Animación X */
    .navbar-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg) !important;
    }
    .navbar-toggle.active span:nth-child(2) {
        opacity: 0 !important;
        transform: scaleX(0) !important;
    }
    .navbar-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg) !important;
    }

    /* ── Overlay ── */
    .navbar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 10000;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }

    .navbar-overlay.active {
        display: block;
    }

    /* ── Drawer lateral ──
       El truco: usamos translate en vez de left,
       y lo sacamos del flujo con position:fixed desde el body
    ── */
    .navbar-menu {
        /* Reset de estilos desktop */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 78vw !important;
        max-width: 300px !important;
        height: 100% !important;
        min-height: 100vh !important;
        background: #ffffff !important;
        flex-direction: column !important;
        padding: 0 !important;
        gap: 0 !important;
        margin: 0 !important;
        list-style: none !important;
        box-shadow: 6px 0 32px rgba(0, 0, 0, 0.25) !important;
        z-index: 10001 !important;
        overflow-y: auto !important;
        display: flex !important;
        /* Empieza oculto fuera de pantalla a la izquierda */
        transform: translateX(-100%) !important;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    /* Cuando está activo, entra a pantalla */
    .navbar-menu.active {
        transform: translateX(0) !important;
    }

    /* Cabecera azul del drawer */
    .navbar-menu::before {
        content: 'MENÚ';
        display: flex !important;
        align-items: center !important;
        padding: 0 1.5rem !important;
        background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
        color: rgba(255, 255, 255, 0.8) !important;
        font-family: 'Montserrat', sans-serif !important;
        font-size: 0.65rem !important;
        font-weight: 700 !important;
        letter-spacing: 2.5px !important;
        text-transform: uppercase !important;
        height: 70px !important;
        min-height: 70px !important;
        flex-shrink: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Items */
    .navbar-menu li {
        width: 100% !important;
        border-bottom: 1px solid #f1f5f9 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .navbar-menu li a {
        display: flex !important;
        align-items: center !important;
        padding: 1.1rem 1.5rem !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        color: #1e293b !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
        border-left: 3px solid transparent !important;
    }

    .navbar-menu li a:hover,
    .navbar-menu li a.active {
        color: #2563eb !important;
        background: #eff6ff !important;
        border-left-color: #2563eb !important;
        padding-left: 1.75rem !important;
    }

    .navbar-menu a::after {
        display: none !important;
    }

    /* Ajustes de otros elementos */
    .navbar-lang-text {
        font-size: 13px;
    }

    .navbar-brand .logo {
        filter: none;
    }

    .navbar-lang-text .lang-option.active {
        color: var(--text-primary);
    }

    .navbar-lang-text .separator {
        color: var(--border-color);
    }

    /* ── Hero ── */
    .hero {
        min-height: 500px;
    }

    .hero-slider {
        height: 50vh;
        min-height: 400px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-indicators {
        left: 20px;
    }

    .hero-navigation {
        bottom: 20px;
    }

    .hero-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .hero-label {
        font-size: 0.75rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }

    .hero-slide-bg {
        transform: scale(1) !important;
    }

    .hero-slide.active .hero-slide-bg {
        transform: scale(1.02) !important;
    }
    
    .btn {
        width: 100%;
    }

    .hero-dual-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
    
    /* Servicios */
    .servicios-grid {
        grid-template-columns: 1fr;
    }

    .servicios,
    .blog-home {
        padding: 60px 0;
    }

    /* Expertos */
    .expertos-hero h1 {
        font-size: 36px;
    }
    
    .search-grid {
        grid-template-columns: 1fr;
    }
    
    .expertos-grid {
        grid-template-columns: 1fr;
    }
    
    .experto-card-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .experto-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .experto-header-info h1 {
        font-size: 28px;
    }
    
    .experto-header-info .especialidad,
    .experto-header-info .ubicacion {
        justify-content: center;
    }
    
    /* Blog */
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Admin */
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }

    .blog-post-image {
        height: 220px;
    }
    
    .blog-post-content {
        padding: 1.5rem;
    }
    
    .blog-post-content h2 {
        font-size: 1.5rem;
    }
    
    .blog-post-content h3 {
        font-size: 1.125rem;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .contact-info-cards {
        gap: 1rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .map-container iframe {
        height: 350px;
    }

    .hero,
    .service-hero,
    .cta,
    .service-cta {
        background-attachment: scroll;
    }

    .service-hero {
        padding: 3rem 0 2rem;
    }
    
    .approach-cards {
        grid-template-columns: 1fr;
    }
    
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .two-column-grid {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: 2rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .cta h2 {
        font-size: 2rem;
    }
    
    .cta p {
        font-size: 1.125rem;
    }

    /*404*/
    .error-404-container { padding: 40px 30px; }
    .error-404-logo { width: 140px; margin-bottom: 30px; }
    .error-404-code { font-size: 72px; }
    .error-404-title { font-size: 24px; }
    .error-404-message { font-size: 16px; }
    .error-404-buttons { flex-direction: column; }
    .error-404-btn { width: 100%; justify-content: center; }

    /*PROPIEDADES*/
    .propiedades-hero { padding: 60px 0 40px; }
    .propiedades-hero h1 { font-size: 2rem; }
    .propiedades-hero .service-lead { font-size: 1rem; }
    .search-form-advanced { padding: 1.5rem; }
    .search-field-group { grid-template-columns: 1fr; gap: 1rem; }
    .search-advanced-grid { grid-template-columns: 1fr; gap: 1rem; }
    .search-actions { flex-direction: column; }
    .btn-search, .search-actions .btn { width: 100%; justify-content: center; }
    .results-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .results-sort { width: 100%; }
    .results-sort select { flex: 1; }
    .propiedades-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .propiedad-details { grid-template-columns: repeat(2, 1fr); }
    .propiedad-footer { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .propiedad-footer .btn { width: 100%; text-align: center; }
    .cta-content h2 { font-size: 1.5rem; }
    .cta-content p { font-size: 1rem; }

    .gallery-primary { height: 400px; }
    .gallery-thumbnails { grid-template-columns: repeat(2, 1fr); }
    .thumbnail { height: 120px; }
    .gallery-controls { padding: 0 1rem; }
    .gallery-nav { width: 40px; height: 40px; }
    .gallery-badge { top: 1rem; left: 1rem; font-size: 0.75rem; padding: 0.375rem 0.875rem; }
    .propiedad-main { padding: 1.5rem; }
    .propiedad-header-info { flex-direction: column; gap: 1.5rem; }
    .propiedad-price-box { width: 100%; min-width: auto; }
    .propiedad-title { font-size: 1.5rem; }
    .propiedad-features { grid-template-columns: 1fr; gap: 1rem; }
    .caracteristicas-grid { grid-template-columns: 1fr; }
    .detalle-row { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .contact-card, .share-card { padding: 1.5rem; }

    /*NOSOTROS*/
    .nosotros-hero { padding: 4rem 0; }
    .nosotros-hero h1 { font-size: 2rem; }

    .nosotros-tabs {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: max-content;
        min-width: 100%;
    }

    .nosotros-tab {
        padding: 1rem 1.1rem;
        font-size: 0.72rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .nosotros-tab.active { border-left-color: #0891b2; }

    .nosotros-tabs-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nosotros-tabs-section::-webkit-scrollbar { display: none; }

    .section-title { font-size: 2rem; }
    .estadisticas-grid { grid-template-columns: 1fr; gap: 2rem; }

    .mision-content h2,
    .valores-texto h2,
    .sostenibilidad-contenido h2 {
        font-size: 1.75rem;
    }

    .lideres-tabs { flex-direction: column; }
    .lider-tab { width: 100%; }

    /* Dropdown Mobile */
    .dropdown-mega {
        width: 100vw;
        left: 0;
        transform: none;
        position: fixed;
        top: 60px;
    }
    
    .dropdown-container { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem; }
    .dropdown-footer { flex-direction: column; gap: 1rem; text-align: center; padding: 1.5rem; }

    .economic-indicators-bar { padding: 0.75rem 0; display: none !important; }
    .indicators-wrapper { gap: 1rem; font-size: 0.8rem; }
    .indicator-date { width: 100%; text-align: center; margin-top: 0.25rem; }

    .vision-grid { grid-template-columns: 1fr; gap: 2rem; }

    .servicios-grid-five { grid-template-columns: 1fr; }
    .servicio-card-preview { padding: 2rem 1.5rem 1.5rem; min-height: auto; }
    .servicio-expanded-content { padding: 0 1.5rem 2rem 1.5rem; }
    .servicio-card h3 { min-height: auto; }
    .servicios-grid-five .servicio-card:nth-child(5) { grid-column: auto; max-width: none; }
    .servicio-actions { flex-direction: column; }
    .servicio-actions .btn { width: 100%; text-align: center; }
    .servicio-detail-list li span { padding-left: 0.5rem; }
    .servicio-subsection ul li { font-size: 0.85rem; padding-left: 1.5rem; }
    .servicio-cta-footer { padding-top: 1rem; }
    .btn-block { padding: 0.875rem 1.5rem; }
    .servicio-highlight { padding: 0.875rem; font-size: 0.9rem; }
    .servicio-benefits { gap: 0.4rem; }
    .servicio-benefits li { font-size: 0.85rem; padding-left: 1.5rem; }

    .contacto-modal-content { width: 95%; max-height: 95vh; }
    .contacto-modal-header { padding: 2.5rem 1.5rem 1.5rem; }
    .contacto-modal-form { padding: 1.5rem; }
    .contacto-modal-footer { flex-direction: column; }
    .btn-modal { width: 100%; }

    .back-to-top { display: none !important; }

    .whatsapp-float {
        bottom: 20px !important;
        right: 20px !important;
        left: auto !important;
        width: 60px;
        height: 60px;
    }
    
    .whatsapp-float svg { width: 32px; height: 32px; }
    .whatsapp-float::after { display: none; }

    .impacto-grid { grid-template-columns: 1fr !important; max-width: 100% !important; gap: 2rem !important; }
    .impacto-card { border-radius: 12px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
    .impacto-imagen { height: 220px; }
    .impacto-imagen img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
    .impacto-contenido { padding: 1.5rem; }
    .impacto-contenido h3 { font-size: 1.4rem; margin-bottom: 0.75rem; }
    .impacto-contenido p { font-size: 0.95rem; line-height: 1.7; }

    .section-title { font-size: 1.8rem !important; margin-bottom: 2rem !important; padding: 0 1rem; }

    .hss-prev,
    .hss-next {
        display: none !important;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    .hero-slider { height: 500px; }
    .hero-title { font-size: 1.75rem; }
    .hero-navigation { display: none; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn { width: 100%; }
    .section-header h2 { font-size: 1.75rem; }
    .servicio-card, .blog-card { padding: 1.5rem; }
    .blog-meta { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .blog-post-content h2 { font-size: 1.25rem; }
    .contact-form-section h2,
    .contact-info-section h2,
    .contact-map-section h2 { font-size: 1.5rem; }
    .contact-icon { font-size: 2rem; }
    .social-link { width: 45px; height: 45px; }
    .benefits-grid { grid-template-columns: 1fr; }
    .study-card { padding: 1.5rem; }
    .error-404-logo { width: 120px; }
    .error-404-code { font-size: 60px; }
    .error-404-title { font-size: 20px; }
    .propiedad-image { height: 200px; }
    .propiedad-details { grid-template-columns: 1fr; }
    .propiedades-cta { padding: 3rem 0; }
    .gallery-primary { height: 300px; }
    .thumbnail { height: 100px; }
    .propiedad-section h2 { font-size: 1.25rem; }
    .share-buttons { flex-direction: column; }
    .nosotros-hero h1 { font-size: 1.5rem; }
    .vision-content h2 { font-size: 1.5rem; }
    .estadistica-numero { font-size: 1.5rem; }
    .nosotros-cta-final h2 { font-size: 1.5rem; }
    .whatsapp-float { width: 55px; height: 55px; bottom: 15px; right: 85px; }
    .whatsapp-float svg { width: 28px; height: 28px; }
    .nosotros-tab { padding: 0.9rem 0.9rem; font-size: 0.68rem; }
    .impacto-imagen { height: 180px; }
    .impacto-contenido { padding: 1.25rem; }
    .impacto-contenido h3 { font-size: 1.25rem; }
}

/* ── Utilidades globales ── */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.5);
}

.field-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

input.error,
textarea.error {
    border-color: var(--error);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.image-preview {
    margin-top: 1rem;
    max-width: 300px;
}

.image-preview img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.char-counter {
    text-align: right;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

@media print {
    .navbar, .footer, .back-to-top, .admin-sidebar, .btn { display: none !important; }
    body { font-size: 12pt; }
    a { text-decoration: underline; }
    .gallery-controls, .contact-card, .share-card, .gallery-nav { display: none; }
    .gallery-primary { height: auto; }
    .propiedad-layout { grid-template-columns: 1fr; }
}

@keyframes fadeInBackground {
    from { opacity: 0; transform: scale(1.1); }
    to   { opacity: 1; transform: scale(1); }
}

.hero::before,
.service-hero::before {
    animation: fadeInBackground 0.8s ease-out;
}