/* ===== CORRECCIÓN DEFINITIVA - Scroll Horizontal ===== */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

#contenido {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* CORREGIR CALENDARIO */
.calendario-forzado-inner {
    height: auto !important;
    min-height: 700px;
}

.calendly-inline-widget {
    min-width: 100% !important;
    width: 100% !important;
}

/* FORZAR que todos los elementos respeten el ancho */
* {
    max-width: 100%;
}

/* Contenedores específicos que pueden causar problemas */
.container, .container-sm, .container-lg {
    width: 100%;
    max-width: 100%;
}

/* Imágenes y medios */
img, video, iframe, canvas {
    max-width: 100%;
    height: auto;
}

/* ===== ESTILOS GLOBALES - Automatic IA ===== */
/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables CSS globales */
:root {
    --primary-black: #000000;
    --primary-white: #ffffff;
    --accent-yellow: #ffde59;
    --accent-blue: #00c3ff;
    --accent-dark-blue: #0074cc;
    --accent-gold: #d4af37;
    --text-gray: #bfbfbf;
    --text-light-gray: #e6e6e6;
    --text-dark-gray: #a9a9a9;
    --card-bg: rgba(26, 26, 26, 0.95);
    --modal-bg: rgba(26, 26, 26, 0.95);
    --overlay-bg: rgba(0, 0, 0, 0.9);
}

/* Configuración base del body */
body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--primary-black);
    color: var(--primary-white);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Tipografía global */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.8rem;
}

p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Efectos de partículas y líneas azules - GLOBAL */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    background-color: rgba(0, 195, 255, 0.5);
    border-radius: 50%;
    pointer-events: none;
}

.blue-line {
    position: absolute;
    background: linear-gradient(to right, transparent, rgba(0, 195, 255, 0.7), transparent);
    height: 1px;
    transform-origin: left center;
    pointer-events: none;
}

/* Utilidades de color */
.text-yellow {
    color: var(--accent-yellow);
}

.text-blue {
    color: var(--accent-blue);
}

.text-white {
    color: var(--primary-white);
}

.text-gray {
    color: var(--text-gray);
}

/* Utilidades de fondo */
.bg-dark {
    background-color: var(--primary-black);
}

.bg-card {
    background-color: var(--card-bg);
}

/* Efectos de sombra y glow */
.shadow-glow-yellow {
    box-shadow: 0 0 20px rgba(255, 222, 89, 0.5);
}

.shadow-glow-blue {
    box-shadow: 0 0 20px rgba(0, 195, 255, 0.5);
}

.text-glow-yellow {
    text-shadow: 0 0 15px rgba(255, 222, 89, 0.8);
}

.text-glow-blue {
    text-shadow: 0 0 15px rgba(0, 195, 255, 0.7);
}

/* Gradientes */
.gradient-yellow {
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-gold));
}

.gradient-blue {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-dark-blue));
}

.gradient-text-yellow-blue {
    background: linear-gradient(45deg, var(--accent-yellow), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Botones globales */
.btn {
    display: inline-block;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-yellow), var(--accent-gold));
    color: var(--primary-black);
    box-shadow: 0 0 20px rgba(255, 222, 89, 0.7);
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 222, 89, 0.9);
    letter-spacing: 2px;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-dark-blue));
    color: var(--primary-white);
    box-shadow: 0 0 20px rgba(0, 195, 255, 0.5);
}

.btn-secondary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 195, 255, 0.7);
}

/* Contenedores globales */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-lg {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Utilidades de espaciado */
.section-padding {
    padding: 80px 0;
}

.section-padding-sm {
    padding: 40px 0;
}

.section-padding-lg {
    padding: 120px 0;
}

/* Utilidades de texto */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* Utilidades de flexbox */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    flex-direction: column;
}

/* Utilidades de grid */
.grid {
    display: grid;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ===== SECCIÓN DE SERVICIOS - Cajas Interactivas ===== */
.contenedor-servicios, 
.caja-servicio, 
.tarjeta-servicio {
    max-width: 100%;
    overflow: hidden;
}

/* Para cajas que necesitan scroll vertical */
.caja-interactiva {
    max-width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Estilos específicos para servicios */
.contenedor-servicios {
    display: grid;
    gap: 30px;
    padding: 40px 0;
}

.caja-servicio {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 195, 255, 0.1);
}

.caja-servicio:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 195, 255, 0.2);
    border-color: rgba(0, 195, 255, 0.3);
}

.tarjeta-servicio {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.9), rgba(0, 195, 255, 0.1));
    border-radius: 12px;
    padding: 25px;
    height: 100%;
    transition: all 0.3s ease;
}

.tarjeta-servicio:hover {
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95), rgba(0, 195, 255, 0.15));
    box-shadow: 0 5px 20px rgba(0, 195, 255, 0.3);
}

/* Animaciones globales */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Clases de animación */
.animate-fadeIn {
    animation: fadeIn 0.6s ease-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-bounce {
    animation: bounce 1.5s infinite;
}

/* Estados de hover globales */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-glow:hover {
    box-shadow: 0 10px 30px rgba(255, 222, 89, 0.3);
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-black);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-yellow);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* Selección de texto */
::selection {
    background: var(--accent-yellow);
    color: var(--primary-black);
}

::-moz-selection {
    background: var(--accent-yellow);
    color: var(--primary-black);
}

/* Focus states para accesibilidad */
button:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--accent-yellow);
    outline-offset: 2px;
}

/* Loading spinner global */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-gray);
    border-radius: 50%;
    border-top-color: var(--accent-yellow);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== RESPONSIVE DESIGN - Breakpoints globales ===== */

/* Tablets */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 2.8rem;
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    /* Servicios en tablets */
    .contenedor-servicios {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .caja-servicio,
    .tarjeta-servicio {
        padding: 20px;
    }
}

/* Tablets pequeñas y móviles grandes */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .section-padding {
        padding: 60px 0;
    }
    
    .section-padding-lg {
        padding: 80px 0;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* Servicios en tablets pequeñas */
    .contenedor-servicios {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .caja-servicio,
    .tarjeta-servicio {
        padding: 15px;
    }
    
    /* Corrección calendario en tablets */
    .calendario-forzado-inner {
        min-height: 800px !important;
        height: auto !important;
    }
    
    .calendly-inline-widget {
        min-width: 100% !important;
    }
}

/* Móviles - Correcciones específicas */
@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .container, 
    .container-sm, 
    .container-lg {
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
    }
    
    .section-padding {
        padding: 40px 0;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
        letter-spacing: 1px;
    }
    
    /* Forzar que todo quede dentro */
    img, video, iframe, canvas {
        max-width: 100%;
        height: auto;
    }
    
    /* Prevenir desbordamiento en grids */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Servicios en móviles */
    .contenedor-servicios {
        gap: 10px;
        padding: 20px 0;
    }
    
    .caja-servicio,
    .tarjeta-servicio {
        padding: 15px 10px;
        margin: 0 5px;
    }
    
    .caja-interactiva {
        max-height: 300px;
        padding-right: 5px;
    }
    
    /* Scrollbar más delgada en móviles */
    ::-webkit-scrollbar {
        width: 4px;
    }
    
    /* Corrección calendario en móviles */
    .calendario-forzado-inner {
        min-height: 900px !important;
        height: auto !important;
    }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
    .container, 
    .container-sm, 
    .container-lg {
        padding: 0 10px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .caja-servicio,
    .tarjeta-servicio {
        padding: 12px 8px;
    }
    
    .calendario-forzado-inner {
        min-height: 950px !important;
    }
}

/* Utilidades de visibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    #particles-container {
        display: none;
    }
    
    .caja-servicio,
    .tarjeta-servicio {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    .calendario-forzado-inner {
        display: none !important;
    }
}

/* ===== PARTÍCULAS GLOBALES ===== */
#global-particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.global-particle {
    position: absolute;
    background-color: rgba(0, 195, 255, 0.3);
    border-radius: 50%;
    pointer-events: none;
}

.global-blue-line {
    position: absolute;
    background: linear-gradient(to right, transparent, rgba(0, 195, 255, 0.5), transparent);
    height: 1px;
    transform-origin: left center;
    pointer-events: none;
}

/* ===== CORRECCIÓN DEFINITIVA - ELIMINAR SCROLL HORIZONTAL ===== */
/* Forzar que TODO respete el ancho de la pantalla */
* {
    max-width: 100vw !important;
    box-sizing: border-box !important;
}

html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
}

#contenido {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Eliminar cualquier ancho fijo que cause problemas */
.container, 
.container-sm, 
.container-lg,
.service-card,
.modal-content,
.instagram-post,
.calendario-forzado-wrapper,
.calendario-forzado-inner {
    width: 100% !important;
    max-width: 100% !important;
}

/* Específico para el elemento de 400px que encontramos */
[style*="width: 400px"],
[width="400"] {
    width: 100% !important;
    max-width: 100% !important;
}

/* Corrección EXTREMA para móviles */
@media (max-width: 768px) {
    * {
        max-width: 100vw !important;
    }
    
    body {
        transform: none !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    /* Forzar viewport completo */
    .container, 
    .container-sm, 
    .container-lg {
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 0 15px !important;
        margin: 0 auto !important;
    }
    
    /* Correcciones adicionales para móvil */
    .service-card,
    .modal-content,
    .instagram-post {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Asegurar que iframes y embeds sean responsivos */
    iframe, 
    embed, 
    object {
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* Corrección para pantallas muy pequeñas */
@media (max-width: 360px) {
    html, body {
        min-width: 320px !important;
        overflow-x: hidden !important;
    }
    
    .container, 
    .container-sm, 
    .container-lg {
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 0 10px !important;
    }
}

/* Prevenir scroll horizontal en todos los elementos */
div, section, article, header, footer, main, aside, nav {
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Corrección específica para elementos que podrían tener width fijo */
[style*="width:"],
[width] {
    max-width: 100% !important;
}

/* Asegurar que las imágenes y medios no causen overflow */
img, video, canvas, svg {
    max-width: 100% !important;
    height: auto !important;
}

/* Corrección final - eliminar cualquier transform que cause desplazamiento */
body.fixed-body {
    position: relative !important;
    left: 0 !important;
    transform: none !important;
}