/* ============================================
   MOBILE STYLES - DH Brokers
   Solo se aplica en pantallas móviles (max-width: 768px)
   NO afecta al diseño desktop
   ============================================ */

/* SOLO MÓVIL - No afecta desktop */
@media screen and (max-width: 768px) {

    /* ====================
       RESET Y BASE
       ==================== */
    * {
        box-sizing: border-box;
    }

    body {
        overflow-x: hidden;
        width: 100%;
        font-size: 16px;
    }

    .container {
        padding: 0 20px;
        max-width: 100%;
    }

    /* ====================
       HEADER Y NAVEGACIÓN
       ==================== */
    .header {
        padding: 15px 0 !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        width: 100% !important;
    }

    .header .container {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding: 0 20px !important;
    }

    .header-content {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Ocultar nav desktop */
    .header nav:not(.nav-menu) {
        display: none !important;
    }

    .logo {
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        margin-right: auto !important;
        flex-shrink: 0 !important;
        order: 1 !important;
    }

    .logo img {
        max-width: 90px !important;
        height: auto !important;
        display: block !important;
    }

    /* Menú hamburguesa */
    .hamburger {
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-around !important;
        align-items: center !important;
        position: relative !important;
        top: 0 !important;
        right: 0 !important;
        width: 45px !important;
        height: 45px !important;
        background: #d8a200 !important;
        border: none !important;
        border-radius: 5px !important;
        cursor: pointer !important;
        z-index: 10001 !important;
        flex-shrink: 0 !important;
        order: 2 !important;
        padding: 8px !important;
        margin-left: auto !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
        touch-action: manipulation !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }

    .hamburger span {
        display: block !important;
        width: 28px !important;
        height: 3px !important;
        background: white !important;
        margin: 0 !important;
        transition: 0.3s !important;
        border-radius: 2px !important;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Navegación móvil */
    .nav-menu {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 280px !important;
        height: 100vh !important;
        background: white !important;
        box-shadow: -2px 0 10px rgba(0,0,0,0.3) !important;
        transition: right 0.3s ease !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        padding-top: 80px !important;
    }

    .nav-menu.active {
        right: 0 !important;
    }

    nav ul {
        flex-direction: column;
        padding: 0;
        margin: 0;
    }

    nav ul li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }

    nav ul li a {
        display: block;
        padding: 18px 20px;
        font-size: 16px;
        color: #333;
        text-align: left;
    }

    nav ul li a:hover {
        background: #f5f5f5;
        color: #d8a200;
    }

    /* ====================
       HERO SLIDER - PANTALLA COMPLETA
       ==================== */
    .hero-slider {
        height: 100vh;
        min-height: 100vh;
        width: 100vw;
        margin: 0;
        padding: 0;
        position: relative;
        overflow: hidden;
    }

    .hero-slider .slide {
        height: 100vh;
        width: 100vw;
        background-size: cover;
        background-position: center;
    }

    .hero-slider .slide-overlay {
        background: rgba(0, 0, 0, 0.2) !important;
    }

    .hero-slider .slide-content {
        padding: 0 30px;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100%;
    }

    .hero-slider .slide-title {
        font-size: 32px;
        line-height: 1.2;
        margin-bottom: 20px;
        text-align: center;
    }

    .hero-slider .slide-subtitle {
        font-size: 18px;
        margin-bottom: 30px;
        text-align: center;
    }

    .hero-slider .btn-primary {
        padding: 16px 40px;
        font-size: 18px;
        width: auto;
        max-width: 90%;
    }

    /* Ocultar flechas en móvil (usamos swipe) */
    .hero-slider .slider-btn {
        display: none;
    }

    /* Dots del slider */
    .hero-slider .slider-dots {
        bottom: 30px;
        z-index: 100;
    }

    .hero-slider .dot {
        width: 10px;
        height: 10px;
        margin: 0 6px;
    }

    /* ====================
       HERO SECTION (otras páginas)
       ALTURA Y DISEÑO ESTANDARIZADO
       ==================== */
    section.hero,
    .hero {
        min-height: 60vh !important;
        max-height: 60vh !important;
        height: 60vh !important;
        padding: 160px 20px 40px !important;
        padding-top: 160px !important;
        text-align: center !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
        position: relative !important;
    }

    section.hero .container,
    .hero .container,
    .hero > .container {
        width: 100% !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    section.hero h1,
    .hero h1,
    .hero > .container 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;
    }

    section.hero .hero-subtitle,
    section.hero p,
    .hero-subtitle,
    .hero p,
    .hero > .container 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;
    }

    /* Ocultar logo duplicado en contacto */
    .hero .logo,
    .hero img[src*="logo"] {
        display: none !important;
    }

    .hero .btn-primary {
        padding: 14px 30px;
        font-size: 16px;
        width: 100%;
        max-width: 280px;
    }

    /* ====================
       SECCIONES GENERALES
       ==================== */
    section {
        padding: 30px 0;
    }

    /* Reducir espacio entre secciones específicas */
    .qode-showcase-row + section,
    section.products-section {
        padding-top: 20px;
    }

    h2 {
        font-size: 24px;
        text-align: center;
        margin-bottom: 25px;
    }

    h3 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    p {
        font-size: 15px;
        line-height: 1.6;
    }

    /* ====================
       GRIDS A 1 COLUMNA
       ==================== */
    .products-grid,
    .services-grid,
    .team-grid,
    .features-grid,
    .service-features {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .product-card,
    .service-card,
    .team-member,
    .feature-item {
        width: 100%;
        margin-bottom: 20px;
    }

    /* ====================
       TARJETAS DE PRODUCTOS
       ==================== */
    .product-card {
        padding: 25px;
    }

    .product-icon svg {
        width: 50px;
        height: 50px;
    }

    .product-title {
        font-size: 20px;
        margin: 15px 0 10px;
    }

    .product-description {
        font-size: 14px;
        line-height: 1.5;
    }

    .product-features li {
        font-size: 14px;
        padding: 8px 0;
    }

    /* ====================
       SHOWCASE/QODE ITEMS
       ==================== */
    .qode-showcase-row {
        flex-direction: column;
    }

    .qode-item-showcase {
        flex-direction: column;
        align-items: center;
    }

    .qode-item-image {
        width: 100%;
        max-width: 250px;
        margin: 0 auto 40px;
        padding-bottom: 30px;
    }

    .qode-item-image img {
        width: 100%;
        height: auto;
    }

    .qode-holder-left,
    .qode-holder-right {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }

    .qode-item-line {
        display: none;
    }

    .qode-item {
        width: 100%;
        margin-bottom: 20px;
        text-align: center;
        position: static;
        transform: none;
    }

    .qode-item-icon i {
        font-size: 40px;
    }

    .qode-showcase-title {
        font-size: 18px;
    }

    .qode-showcase-text {
        font-size: 14px;
    }

    /* ====================
       EQUIPO / NOSOTROS
       ==================== */
    .ceo-section {
        flex-direction: column;
        text-align: center;
    }

    .ceo-image {
        width: 100%;
        max-width: 250px;
        margin: 0 auto 25px;
    }

    .ceo-content {
        width: 100%;
        padding: 0;
    }

    .ceo-credentials {
        flex-direction: column;
        gap: 15px;
    }

    /* ====================
       FORMULARIOS
       ==================== */
    .contact-form,
    .simulator-form {
        padding: 25px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 20px;
    }

    .form-row .form-group {
        width: 100%;
    }

    input,
    textarea,
    select {
        font-size: 16px;
        padding: 12px;
    }

    button,
    .btn {
        font-size: 16px;
        padding: 14px 30px;
        width: 100%;
    }

    /* ====================
       SIMULADOR
       ==================== */
    .simulator-step h2 {
        font-size: 22px;
    }

    .step-intro {
        font-size: 14px;
    }

    .simulator-controls {
        flex-direction: column;
        gap: 15px;
    }

    .simulator-controls button {
        width: 100%;
    }

    .result-card {
        padding: 20px;
    }

    .result-main {
        font-size: 28px;
    }

    /* ====================
       TABLAS
       ==================== */
    table {
        font-size: 14px;
    }

    td, th {
        padding: 10px 8px;
    }

    /* ====================
       FOOTER
       ==================== */
    .footer {
        padding: 30px 0;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 25px;
    }

    .footer-section {
        width: 100%;
        margin-bottom: 20px;
        text-align: center;
    }

    .footer-section h3 {
        margin-bottom: 12px;
    }

    .footer-section ul li {
        margin-bottom: 2px;
        line-height: 1.4;
    }

    .footer-section p {
        line-height: 1.4;
        margin-bottom: 2px;
    }

    /* Footer: Menú de navegación - más junto */
    .footer-links,
    .footer-section ul {
        text-align: center !important;
    }

    .footer-links li,
    .footer-section ul li {
        margin-bottom: 2px !important;
        line-height: 1.4 !important;
    }

    .footer-links a,
    .footer-section ul li a {
        display: block !important;
        padding: 3px 0 !important;
        line-height: 1.4 !important;
    }

    /* Footer: Contacto - centrado y junto */
    .footer-contact,
    .footer-section .footer-contact {
        text-align: center !important;
        align-items: center !important;
    }

    .footer-contact li,
    .footer-section .footer-contact li {
        margin-bottom: 2px !important;
        line-height: 1.4 !important;
        text-align: center !important;
    }

    .footer-contact a,
    .footer-contact p,
    .footer-section .footer-contact a,
    .footer-section .footer-contact p {
        display: block !important;
        padding: 3px 0 !important;
        line-height: 1.4 !important;
        text-align: center !important;
    }

    /* Logo del footer centrado */
    .footer-logo {
        text-align: center;
        margin: 0 auto 15px;
    }

    .footer-logo img {
        max-width: 150px;
        margin: 0 auto;
    }

    .footer-certification {
        padding: 15px 0;
    }

    .footer-certification > .container > div {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }

    .footer-certification img {
        height: 16px;
    }

    .footer-certification span {
        font-size: 11px;
        text-align: center;
        line-height: 1.3;
    }

    .footer-bottom p {
        font-size: 10px;
        line-height: 1.1;
        margin-bottom: 3px;
    }

    /* ====================
       BOTÓN FLOTANTE
       ==================== */
    .ai-assistant-btn {
        width: 55px !important;
        height: 55px !important;
        bottom: 15px !important;
        right: 15px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    .ai-assistant-btn svg,
    .ai-assistant-btn i,
    .ai-assistant-btn img {
        width: 28px !important;
        height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
    }

    /* ====================
       UTILIDADES
       ==================== */
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    /* Evitar scroll horizontal */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Espaciado entre secciones */
    section + section {
        margin-top: 0;
    }

    /* Botones táctiles más grandes */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }

    /* ====================
       AJUSTES ESPECÍFICOS POR PÁGINA
       ==================== */

    /* SIMULADOR: Ocultar círculos de pasos 1,2,3,4 */
    .step-number {
        display: none !important;
    }

    /* SIMULADOR: Ajustar grid de pasos */
    .steps-grid {
        display: block !important;
    }

    .step-item {
        width: 100% !important;
        margin-bottom: 15px !important;
        text-align: left !important;
    }

    /* SIMULADOR: Ocultar números de paso en móvil */
    .step-number {
        display: none !important;
    }

    /* SIMULADOR: Misma altura que otras páginas */
    #simulador .hero,
    body[class*="simulador"] .hero {
        min-height: 60vh !important;
        height: 60vh !important;
    }

    /* ====================
       AGENTE IA - CHAT MÓVIL
       ==================== */

    /* Botón del chat - Icono blanco en fondo dorado */
    .ai-assistant-btn,
    button.ai-assistant-btn,
    #ai-assistant-btn {
        width: 60px !important;
        height: 60px !important;
        bottom: 20px !important;
        right: 20px !important;
        background: #d8a200 !important;
        background-color: #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;
        border: none !important;
        cursor: pointer !important;
        padding: 0 !important;
    }

    .ai-assistant-btn svg,
    button.ai-assistant-btn svg,
    #ai-assistant-btn svg {
        width: 28px !important;
        height: 28px !important;
        color: #ffffff !important;
        stroke: #ffffff !important;
        stroke-width: 2 !important;
        fill: none !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .ai-assistant-btn svg path,
    button.ai-assistant-btn svg path,
    #ai-assistant-btn svg path {
        stroke: #ffffff !important;
        fill: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Modal completo - Pantalla completa en móvil */
    .ai-assistant-modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        z-index: 9999 !important;
    }

    .ai-assistant-modal.active {
        display: flex !important;
    }

    .ai-assistant-header {
        padding: 20px !important;
        border-radius: 0 !important;
    }

    .ai-assistant-chat {
        flex: 1 !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: auto !important;
    }

    .ai-assistant-input {
        padding: 20px !important;
        border-radius: 0 !important;
    }
}

/* ============================================
   FIN MOBILE STYLES
   ============================================ */
