/* ===================================
   DH BROKERS - RESPONSIVE CSS
   Optimizado para experiencia móvil tipo APP
   =================================== */

/* ===== TABLET (992px y menos) ===== */
@media (max-width: 992px) {
    /* Header */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--color-white);
        padding: 80px 30px 30px;
        box-shadow: -5px 0 30px rgba(0,0,0,0.1);
        transition: right 0.4s ease;
        z-index: 999;
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    .nav-list li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .nav-link {
        display: block;
        width: 100%;
        padding: 18px 0;
        color: var(--color-black) !important;
        text-shadow: none !important;
        font-size: 16px;
    }

    .nav-link::after {
        display: none;
    }

    .btn-header {
        width: 100%;
        margin-top: 10px;
        text-align: center;
        justify-content: center;
    }

    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .header.scrolled .hamburger span,
    .hamburger span {
        background: var(--color-black);
    }

    .header:not(.scrolled) .hamburger span {
        background: var(--color-white);
    }

    .logo img {
        height: 70px;
    }

    /* Overlay cuando el menú está abierto */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 998;
    }

    /* Hero Slider */
    .hero-slider {
        height: 70vh;
        min-height: 500px;
    }

    .slide-content {
        width: 90%;
        padding: 0 20px;
    }

    .slide-content-left,
    .slide-content-right {
        padding-left: 20px;
        padding-right: 20px;
        text-align: center;
    }

    .slide-title {
        font-size: 42px;
        line-height: 1.2;
    }

    .slide-subtitle {
        font-size: 18px;
    }

    /* Advantages Grid */
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    /* Cookie Banner */
    .cookie-banner-content,
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .cookie-buttons {
        width: 100%;
        flex-direction: column;
    }

    .cookie-buttons .btn {
        width: 100%;
    }
}

/* ===== MÓVIL (768px y menos) ===== */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 15px;
    }

    /* Header Móvil */
    .header {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        position: absolute !important;
    }

    .header-content {
        padding: 12px 0;
    }

    .logo img {
        height: 60px;
    }

    /* Ocultar logo negro en móvil, solo mostrar el blanco */
    .logo .logo-dark,
    .logo img[src*="logo-negro"] {
        display: none !important;
    }

    .logo .logo-white,
    .logo img[src*="logo-blanco"] {
        display: block !important;
    }

    .nav-menu {
        width: 100%;
        right: -100%;
        padding: 70px 20px 30px;
    }

    /* Hero Slider */
    .hero-slider {
        height: 65vh;
        min-height: 450px;
        margin-top: 0;
    }

    .slide-content {
        width: 95%;
    }

    .slide-title {
        font-size: 32px;
        line-height: 1.25;
        margin-bottom: 15px;
    }

    .slide-subtitle {
        font-size: 16px;
        line-height: 1.4;
        margin-bottom: 20px;
    }

    .btn-large {
        padding: 15px 35px;
        font-size: 14px;
    }

    /* Cookie Banner - Optimizado Móvil */
    .cookie-banner {
        padding: 15px 0;
    }

    .cookie-content {
        padding: 0 15px;
    }

    .cookie-content p,
    .cookie-text p {
        font-size: 12px;
        line-height: 1.6;
    }

    .cookie-buttons {
        gap: 10px;
    }

    .cookie-buttons .btn {
        padding: 12px 20px;
        font-size: 13px;
    }

    /* Sections */
    .section {
        padding: 50px 0;
    }

    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 28px;
    }

    h3 {
        font-size: 22px;
    }

    /* Features / Advantage Cards */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-card {
        padding: 30px 20px;
    }

    .advantage-card {
        padding: 30px 20px;
    }

    .advantage-icon {
        font-size: 40px;
    }

    .advantage-card h3 {
        font-size: 18px;
    }

    .advantage-card p {
        font-size: 14px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px !important;
        text-align: center;
    }

    .footer-col {
        width: 100%;
        margin-bottom: 0 !important;
    }

    .footer-col h4 {
        margin-bottom: 8px !important;
    }

    .footer-links,
    .footer-contact {
        align-items: center;
        text-align: center;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .footer-links li,
    .footer-contact li {
        margin-bottom: 0 !important;
        padding: 1px 0 !important;
        line-height: 1.2 !important;
        text-align: center !important;
        display: block !important;
    }

    .footer-links a,
    .footer-contact a,
    .footer-contact span {
        padding: 1px 0 !important;
        line-height: 1.2 !important;
        text-align: center !important;
        display: inline-block !important;
    }

    .footer-contact li svg {
        display: none !important;
    }

    .footer-bottom,
    .footer-bottom .container {
        line-height: 1 !important;
    }

    .footer-bottom p {
        font-size: 11px;
        line-height: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .footer-bottom a {
        line-height: 1 !important;
        display: inline !important;
    }

    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group {
        margin-bottom: 20px;
    }

    /* Contact Grid */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .contact-info-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ===== MÓVIL PEQUEÑO (576px y menos) ===== */
@media (max-width: 576px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 12px;
    }

    /* Header Extra Compacto */
    .logo img {
        height: 50px;
    }

    .header-content {
        padding: 10px 0;
    }

    .hamburger {
        padding: 3px;
    }

    .hamburger span {
        width: 22px;
        height: 2.5px;
    }

    /* Hero Slider Móvil Optimizado */
    .hero-slider {
        height: 60vh;
        min-height: 400px;
    }

    .slide-content {
        width: 100%;
        padding: 0 15px;
    }

    .slide-title {
        font-size: 26px;
        line-height: 1.3;
        margin-bottom: 12px;
    }

    .slide-subtitle {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 18px;
    }

    .btn-large {
        padding: 14px 30px;
        font-size: 13px;
        width: 100%;
        max-width: 280px;
    }

    /* Cookie Banner Ultra Compacto */
    .cookie-banner {
        padding: 12px 0;
    }

    .cookie-content {
        padding: 0 12px;
        gap: 15px;
    }

    .cookie-content p {
        font-size: 11px;
        line-height: 1.7;
    }

    .cookie-buttons .btn {
        padding: 11px 18px;
        font-size: 12px;
    }

    /* Typography Móvil */
    h1 {
        font-size: 28px;
        line-height: 1.3;
    }

    h2 {
        font-size: 24px;
        line-height: 1.3;
    }

    h3 {
        font-size: 20px;
        line-height: 1.3;
    }

    p {
        font-size: 14px;
        line-height: 1.7;
    }

    /* Sections Compactas */
    .section {
        padding: 40px 0;
    }

    /* Feature Cards */
    .feature-card,
    .advantage-card {
        padding: 25px 18px;
    }

    .advantage-icon {
        font-size: 36px;
        margin-bottom: 15px;
    }

    .advantage-card h3 {
        font-size: 17px;
        margin-bottom: 12px;
    }

    .advantage-card p {
        font-size: 13px;
        line-height: 1.6;
    }

    /* Botones */
    .btn {
        padding: 11px 25px;
        font-size: 13px;
    }

    .btn-header {
        padding: 9px 20px;
        font-size: 12px;
    }

    /* Footer */
    .footer {
        padding: 40px 0 20px;
    }

    .footer-content {
        gap: 20px !important;
    }

    .footer-col {
        margin-bottom: 0 !important;
    }

    .footer-col h4 {
        font-size: 16px;
        margin-bottom: 8px !important;
    }

    .footer-links,
    .footer-contact {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .footer-links li,
    .footer-contact li {
        font-size: 13px;
        margin-bottom: 0 !important;
        padding: 1px 0 !important;
        line-height: 1.2 !important;
        text-align: center !important;
        display: block !important;
    }

    .footer-links a,
    .footer-contact a,
    .footer-contact span {
        padding: 1px 0 !important;
        line-height: 1.2 !important;
        text-align: center !important;
        display: inline-block !important;
    }

    .footer-contact li svg {
        display: none !important;
    }

    .footer-bottom,
    .footer-bottom .container {
        line-height: 1 !important;
    }

    .footer-bottom p {
        line-height: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 10px !important;
    }

    .footer-bottom a {
        line-height: 1 !important;
        display: inline !important;
    }

    .footer-bottom {
        padding: 20px 0;
        margin-top: 30px;
    }

    .footer-legal-links {
        font-size: 10px !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    .footer-legal-links a {
        margin-right: 6px !important;
    }

    /* Forms */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 14px;
        padding: 12px 15px;
    }

    .form-group label {
        font-size: 13px;
    }

    .checkbox-label span {
        font-size: 12px;
    }

    /* Newsletter */
    .newsletter-form {
        flex-direction: column;
        gap: 10px;
    }

    .newsletter-form input {
        width: 100%;
    }

    .newsletter-form button {
        width: 100%;
    }

    /* Process Steps */
    .process-steps {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .process-step {
        padding: 20px 18px;
    }

    .step-number {
        font-size: 28px;
        width: 50px;
        height: 50px;
    }

    /* AI Assistant Button */
    .ai-assistant-btn {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 15px;
    }

    .ai-assistant-btn svg {
        width: 24px;
        height: 24px;
    }

    .ai-assistant-chat {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    /* Contact Cards */
    .contact-info-card {
        padding: 20px 18px;
    }

    .contact-form-wrapper {
        padding: 25px 18px;
    }

    .contact-form-wrapper h2,
    .contact-info-wrapper h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .form-intro {
        font-size: 13px;
    }

    /* Social Buttons */
    .social-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .social-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    /* Hero Pages */
    .hero-nosotros,
    .hero-servicios,
    .hero-simulador,
    .hero-contacto,
    .page-hero,
    section.hero,
    .hero {
        height: 60vh !important;
        min-height: 60vh !important;
        max-height: 60vh !important;
        padding: 160px 20px 40px !important;
        padding-top: 160px !important;
        margin-top: 0;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .hero-title,
    section.hero h1,
    .hero h1,
    .page-hero h1 {
        font-size: 36px !important;
        line-height: 1.2 !important;
        margin-bottom: 8px !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        text-shadow: 3px 3px 6px rgba(0,0,0,0.5) !important;
        font-weight: 700 !important;
    }

    .hero-subtitle,
    section.hero .hero-subtitle,
    section.hero p,
    .hero p,
    .page-hero p {
        font-size: 20px !important;
        line-height: 1.25 !important;
        margin-bottom: 20px !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.5) !important;
        font-weight: 400 !important;
    }

    /* Service Features */
    .service-features {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .feature-item {
        padding: 20px 18px;
    }

    /* FAQ */
    .faq-item {
        padding: 20px 18px;
    }

    .faq-question {
        font-size: 15px;
        padding-right: 35px;
    }

    .faq-answer {
        font-size: 13px;
        padding-top: 12px;
    }

    /* Thank You Pages */
    .thank-you-section {
        padding: 50px 0;
    }

    .success-icon-large svg {
        width: 70px;
        height: 70px;
    }

    .thank-you-message {
        font-size: 14px;
        line-height: 1.7;
    }

    .thank-you-actions,
    .thank-you-contact {
        margin-top: 25px !important;
    }

    .contact-options {
        flex-direction: column;
        gap: 12px;
    }

    .contact-options .btn {
        width: 100%;
    }

    /* Simulator */
    .simulator-form {
        padding: 25px 18px;
    }

    .simulator-input-group {
        margin-bottom: 20px;
    }

    .simulator-result {
        padding: 25px 18px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .stat-card {
        padding: 25px 20px;
    }

    .stat-number {
        font-size: 36px;
    }

    .stat-label {
        font-size: 14px;
    }

    /* Tabs */
    .tabs {
        flex-direction: column;
        gap: 5px;
    }

    .tab {
        width: 100%;
        text-align: center;
        padding: 12px 15px;
        font-size: 13px;
    }

    /* Grid Layouts */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Info Modern Section */
    .info-modern-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .info-modern-image {
        height: 250px;
        border-radius: 8px 8px 0 0;
    }

    .info-modern-content {
        padding: 25px 20px;
        border-radius: 0 0 8px 8px;
    }

    .info-modern-content h2 {
        font-size: 22px;
    }

    /* CEO Section */
    .ceo-section {
        padding: 40px 0;
    }

    .ceo-container {
        flex-direction: column;
        gap: 25px;
    }

    .ceo-image {
        width: 100%;
        max-width: 100%;
    }

    .ceo-content h2 {
        font-size: 26px;
    }

    .ceo-role {
        font-size: 15px;
    }

    .credential-item {
        padding: 12px 15px;
    }

    .credential-item span {
        font-size: 13px;
    }

    /* Spacing Utilities */
    .mt-1 { margin-top: 10px; }
    .mt-2 { margin-top: 15px; }
    .mt-3 { margin-top: 20px; }
    .mt-4 { margin-top: 30px; }
    .mt-5 { margin-top: 40px; }

    .mb-1 { margin-bottom: 10px; }
    .mb-2 { margin-bottom: 15px; }
    .mb-3 { margin-bottom: 20px; }
    .mb-4 { margin-bottom: 30px; }
    .mb-5 { margin-bottom: 40px; }

    .pt-1 { padding-top: 10px; }
    .pt-2 { padding-top: 15px; }
    .pt-3 { padding-top: 20px; }
    .pt-4 { padding-top: 30px; }
    .pt-5 { padding-top: 40px; }

    .pb-1 { padding-bottom: 10px; }
    .pb-2 { padding-bottom: 15px; }
    .pb-3 { padding-bottom: 20px; }
    .pb-4 { padding-bottom: 30px; }
    .pb-5 { padding-bottom: 40px; }
}

/* ===== FIX ESPECÍFICOS MÓVIL ===== */

/* Prevenir zoom en inputs en iOS */
@media (max-width: 576px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Smooth scroll mejorado móvil */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Fix para navegadores móviles - altura viewport */
@media (max-width: 768px) {
    .hero-slider {
        height: calc(var(--vh, 1vh) * 65);
        min-height: 400px;
    }
}

/* Touch target mínimo de 44px para móvil (WCAG) */
@media (max-width: 768px) {
    a, button, .btn, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-link {
        min-height: 48px;
    }

    /* Agente IA - Botón móvil */
    .ai-assistant-btn,
    button.ai-assistant-btn,
    #ai-assistant-btn {
        width: 60px !important;
        height: 60px !important;
        min-height: 60px !important;
        min-width: 60px !important;
        bottom: 20px !important;
        right: 20px !important;
        background: #d8a200 !important;
        border-radius: 50% !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 999 !important;
        position: fixed !important;
        font-size: 0 !important;
    }

    /* Ocultar SVG y mostrar emoji en su lugar */
    .ai-assistant-btn svg,
    #ai-assistant-btn svg {
        display: none !important;
    }

    .ai-assistant-btn::before,
    #ai-assistant-btn::before {
        content: "💬" !important;
        font-size: 32px !important;
        line-height: 1 !important;
        display: block !important;
    }

    /* Agente IA - Modal pantalla completa */
    .ai-assistant-modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        z-index: 9999 !important;
    }

    .ai-assistant-header {
        border-radius: 0 !important;
    }

    .ai-assistant-input {
        border-radius: 0 !important;
    }
}
