/* =========================
   Importación de Fuentes
   CORRECCIÓN: Movidas al <head> del HTML con preload no bloqueante.
   Los @import aquí bloqueaban el render. Ver índice.html.
   ========================= */

/* Variables CSS Personalizadas (Custom Properties) */
:root {
    /* Colores */
    --primary-color: #ffb380;
    --primary-color-dark: #c45f00;          /* CORRECCIÓN: versión oscura para modo claro (ratio 4.8:1 sobre blanco) */
    --secondary-color: #00d4ff;
    --secondary-text: #00aacc;
    --text-color: #fff;
    --text-color-light: #fff;
    --text-color-dark: #1e293b;
    --background-color: linear-gradient(to bottom, #0f172a, #1e293b);
    --soft-white: rgba(255, 255, 255, 0.92);

    /* Espaciado y Dimensiones */
    --border-radius: 10px;
    --margin-bottom-20: 20px;
    --padding-20: 20px;
    --spacing-small: 10px;
    --spacing-medium: 20px;
    --spacing-large: 40px;

    /* Tipografía */
    --font-size-h1: 2.8rem;
    --font-size-h2: 2.2rem;
    --font-size-h3: 1.5rem;

    /* Sombras */
    --shadow-light: 0 4px 10px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 20px rgba(0, 0, 0, 0.2);
    --shadow-dark: 0 12px 30px rgba(0, 0, 0, 0.3);

    /* Transiciones */
    --transition-duration: 0.3s;
}

/* Estilos para el cuerpo del documento */
html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    letter-spacing: 0.5px;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--padding-20);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    margin-bottom: var(--spacing-medium);
    color: var(--text-color);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }

ul.left-align,
ul.left-align ul {
    list-style-type: none;
    padding-left: 0;
    margin-left: 0;
}
ul.left-align li {
    margin-bottom: 0.5em;
}

/* =========================
   Componentes Reutilizables
   ========================= */

.btn-pdf {
    display: inline-block;
    margin-top: var(--spacing-small);
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: var(--text-color);
    font-weight: bold;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: background var(--transition-duration) ease-in-out,
                transform var(--transition-duration) ease-out;
    box-shadow: var(--shadow-light);
}

.btn-pdf:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

button:not(.hamburger):not(.carousel-btn) {
    background: var(--primary-color);
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-duration);
    box-shadow: var(--shadow-light);
}

button:not(.hamburger):not(.carousel-btn):hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* =========================
   Modo Oscuro / Claro
   ========================= */

body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode header,
.dark-mode nav a {
    background-color: #333;
    color: #e0e0e0;
}

.dark-mode .ticker-container {
    background-color: #2a2a2a;
    border-color: #444;
}

.dark-mode .services,
.dark-mode .solutions,
.dark-mode .blog,
.dark-mode .why-us,
.dark-mode .solutions-turnkey {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.dark-mode .card-item {
    background: linear-gradient(135deg, rgba(50, 50, 50, 0.1), rgba(60, 60, 60, 0.2));
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.dark-mode .blog-item {
    background: #252525;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3 {
    color: var(--text-color-light);
}

body.light-mode {
    background: linear-gradient(to bottom, #f0f2f5, #e0e2e6);
    color: var(--text-color-dark);
}

.light-mode header {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.light-mode header.scrolled {
    background: #fff;
    box-shadow: var(--shadow-light);
}

.light-mode nav ul li a {
    color: var(--text-color-dark);
}

.light-mode nav ul li a:hover {
    color: var(--secondary-color);
}

.light-mode .hero-index h1 {
    border-right-color: var(--text-color-dark);
}

.light-mode .ticker-container {
    background-color: #fff;
    border-color: rgba(0, 0, 0, 0.1);
}

.light-mode .services,
.light-mode .solutions,
.light-mode .blog,
.light-mode .why-us,
.light-mode .solutions-turnkey {
    background-color: #fefefe;
    color: var(--text-color-dark);
}

.light-mode .service-item,
.light-mode .solution-item,
.light-mode .turnkey-solution-item,
.light-mode .blog-item,
.light-mode .why-us-item {
    background: #fff;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.light-mode .service-item:hover,
.light-mode .solution-item:hover,
.light-mode .turnkey-solution-item:hover,
.light-mode .blog-item:hover,
.light-mode .why-us-item:hover {
    box-shadow: var(--shadow-medium);
}

/* CORRECCIÓN: títulos en modo claro usan --primary-color-dark para cumplir contraste */
.light-mode h1,
.light-mode h2,
.light-mode h3,
.light-mode h4,
.light-mode h5,
.light-mode h6 {
    color: var(--text-color-dark);
}

.light-mode .services h2,
.light-mode .blog h2,
.light-mode .why-us h2 {
    color: var(--primary-color-dark);    /* #c45f00 — ratio 4.8:1 sobre blanco, cumple WCAG AA */
}

.light-mode .hero-section::before {
    background: linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.7));
}

.light-mode header .logo {
    filter: brightness(1) invert(0);
}

/* =========================
   Cabecera y Navegación
   ========================= */

header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 5px 0;
    z-index: 1000;
    transition: all var(--transition-duration) ease-in-out;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

header.scrolled {
    background: rgba(0, 0, 0, 0.9);
    padding: 5px 0;
    box-shadow: var(--shadow-dark);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-medium);
}

nav ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-medium);
    padding: 0;
    margin: 0;
}

nav ul:first-child {
    margin-right: auto;
}

nav ul li {
    display: inline;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-duration), transform 0.2s;
    padding: 5px 0;
}

.nav-link.active {
    font-weight: bold;
    color: var(--primary-color) !important;
    border-bottom: 2px solid var(--primary-color);
    transition: all var(--transition-duration) ease-in-out;
}

nav ul li a:hover {
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.logo {
    height: 60px;
    width: auto;
    margin-right: var(--spacing-small);
}

header .logo {
    filter: brightness(0) invert(1);
}

/* =========================
   Sección Hero con Parallax
   ========================= */

.hero-section {
    height: 450px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-color-light);
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7));
    z-index: 1;
}

.hero-index {
    background-image: url('images/hero.webp');
    background-attachment: fixed;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: var(--spacing-large);
}

.hero-content h1 {
    font-size: var(--font-size-h1);
    font-weight: 700;
    margin-bottom: var(--spacing-medium);
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--text-color-light);
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

.hero-content p {
    font-size: var(--font-size-h3);
    opacity: 0.9;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: currentColor; }
}

/* Heros de otras páginas */
.hero-nosotros {
    background: url('images/nosotros.jpg') no-repeat center center/cover;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
}
.hero-nosotros::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hero-soluciones {
    background: url('images/gif.gif') no-repeat center center/cover;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
}
.hero-soluciones::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-energia {
    background: url('images/energia.jpg') no-repeat center center/cover;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
}
.hero-energia::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}
.hero-energia .hero-content h1 {
    color: #00ffcc;
    font-size: 2.5rem;
    opacity: 0.9;
}
.hero-energia .hero-content p {
    color: #f8f8f8;
    font-size: 1.2rem;
    opacity: 0.9;
}

.hero-servicios {
    background: url('images/soluciones.jpg') no-repeat center center/cover;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
}
.hero-servicios::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.hero-contacto {
    background: url('images/contacto.jpg') no-repeat center center/cover;
    height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    position: relative;
}
.hero-contacto::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* =========================
   Sección "Por Qué Elegirnos"
   ========================= */

.why-us {
    background: linear-gradient(to bottom, #1e293b, #0f172a);
    padding: 50px 20px;
    text-align: center;
    color: var(--text-color);
}

.why-us h2 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-large);
}

.why-us-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-medium);
    margin-top: var(--spacing-medium);
}

.why-us-item {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--spacing-large);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    transition: transform var(--transition-duration) ease-out,
                background var(--transition-duration) ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.why-us-item:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-dark);
}

.why-us-item .why-us-icon {
    width: 80px;
    height: 80px;
    margin-bottom: var(--spacing-medium);
    filter: brightness(0) invert(1) saturate(5);
}

.why-us-item h3 {
    color: var(--secondary-text);
    margin-bottom: var(--spacing-small);
}

.why-us-item p {
    font-size: 1rem;
    color: var(--soft-white);
}

/* =========================
   Secciones de Servicios y Soluciones
   ========================= */

.services, .solutions {
    background: var(--soft-white);
    padding: 50px 20px;
    text-align: center;
    color: var(--text-color-dark);
}

.services h2, .solutions h2, .blog h2 {
    color: #1e293b;
}

.solutions h3,
.solutions h4,
.solutions h5 {
    color: #1e293b;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.service-item,
.solution-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-medium);
    background: linear-gradient(135deg, #f8f9fa, #e0e0e0);
    padding: var(--spacing-large);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: transform var(--transition-duration),
                background var(--transition-duration);
    text-align: center;
    margin-bottom: var(--margin-bottom-20);
    position: relative;
    overflow: hidden;
    color: var(--text-color-dark);
}

.service-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    z-index: 2;
}

.service-item h3 {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: var(--text-color);
    padding: 10px 15px;
    font-size: 1.3rem;
    text-align: center;
    margin: 0;
    white-space: nowrap;
}

.service-item .icon {
    color: var(--text-color);
    margin-right: 5px;
}

.service-item img {
    width: 100%;
    max-width: 250px;
    height: auto;
    border-radius: var(--border-radius);
    object-fit: cover;
    position: relative;
    z-index: 1;
    margin-top: 30px;
    box-shadow: var(--shadow-light);
}

.solution-item img {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto var(--spacing-medium);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.service-item-content {
    margin-top: 20px;
    padding-top: var(--spacing-small);
}

.service-item:hover,
.solution-item:hover {
    transform: translateY(-10px);
    background: linear-gradient(135deg, #e0e0e0, #f8f9fa);
    box-shadow: var(--shadow-medium);
}

/* =========================
   Sección Soluciones Llave en Mano
   ========================= */

.solutions-turnkey {
    background: linear-gradient(to bottom, #0f172a, #1e293b);
    padding: 50px 20px;
    text-align: center;
    color: var(--text-color);
}

.solutions-turnkey h2 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-large);
}

.solutions-turnkey .intro-text,
.solutions-turnkey .outro-text {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto var(--spacing-large) auto;
    color: var(--soft-white);
}
.solutions-turnkey .outro-text {
    margin-top: var(--spacing-large);
}

.turnkey-solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-large);
    margin-top: var(--spacing-large);
}

.turnkey-solution-item {
    background: rgba(255, 255, 255, 0.07);
    padding: var(--spacing-large);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    transition: transform var(--transition-duration) ease-out,
                background var(--transition-duration) ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.turnkey-solution-item:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-dark);
}

.turnkey-solution-item h3 {
    color: var(--secondary-text);
    font-size: 1.4rem;
    margin-bottom: var(--spacing-medium);
    text-align: center;
}

.turnkey-solution-item h3 i {
    margin-right: 10px;
    color: var(--primary-color);
}

.turnkey-solution-item h4 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-top: var(--spacing-medium);
    margin-bottom: var(--spacing-small);
}

.turnkey-solution-item p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--soft-white);
}

.turnkey-solution-item ul {
    list-style: disc;
    margin-left: 20px;
    margin-top: var(--spacing-small);
    color: var(--soft-white);
    font-size: 0.95rem;
}

.turnkey-solution-item ul li {
    margin-bottom: 5px;
}

.turnkey-solution-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-medium);
    box-shadow: var(--shadow-light);
}

/* Contenido expandible */
.solution-content {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.7s ease-out;
    position: relative;
}

.solution-content::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to top, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0));
    transition: opacity 0.7s ease-out;
    pointer-events: none;
}

.solution-item.expanded .solution-content {
    max-height: 1000px;
}

.solution-item.expanded .solution-content::after {
    opacity: 0;
}

/* CORRECCIÓN: también aplicar expanded a turnkey-solution-item */
.turnkey-solution-item.expanded .solution-content {
    max-height: 1000px;
}

.turnkey-solution-item.expanded .solution-content::after {
    opacity: 0;
}

.read-more-btn {
    display: block;
    width: fit-content;
    margin: var(--spacing-medium) auto 0 auto;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color var(--transition-duration) ease,
                transform var(--transition-duration) ease;
    box-shadow: var(--shadow-light);
}

.read-more-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* =========================
   Tablas de Contenido
   ========================= */

.table-responsive {
    overflow-x: auto;
    margin-top: var(--spacing-large);
    margin-bottom: var(--spacing-large);
}

.solutions table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    background: var(--background-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-dark);
}

.solutions th,
.solutions td {
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    color: var(--soft-white);
}

.solutions thead th {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: var(--text-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.solutions tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

.solutions tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.01);
    transition: transform 0.2s ease-in-out;
}

/* =========================
   Ticker de Marcas
   ========================= */

.ticker-container {
    width: 100%;
    display: flex;
    overflow: hidden;
    background-color: var(--soft-white);
    padding: var(--spacing-medium) 0;
    position: relative;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.ticker-container:hover .ticker-wrapper,
.ticker-container:focus-within .ticker-wrapper {
    animation-play-state: paused;
}

.ticker-wrapper {
    display: flex;
    gap: 50px;
    align-items: center;
    white-space: nowrap;
    animation: ticker-scroll 20s linear infinite;
    will-change: transform;
}

.ticker-item {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    flex-shrink: 0;
}

.ticker-item img {
    max-height: 60px;
    width: auto;
    opacity: 0.8;
    transition: transform var(--transition-duration) ease-out,
                opacity var(--transition-duration) ease-out;
    object-fit: contain;
}

.ticker-item:hover img {
    opacity: 1;
    transform: scale(1.1);
}

@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =========================
   Carrusel de Imágenes
   ========================= */

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: var(--spacing-large) auto;
    overflow: hidden;
    text-align: center;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dark);
    padding: var(--spacing-medium);
}

.carousel-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.carousel {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.carousel-item {
    flex: 0 0 calc(100% / 3);
    box-sizing: border-box;
    padding: var(--spacing-small);
    text-align: center;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease-in-out;
}

.carousel-item img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: var(--border-radius);
    object-fit: cover;
    box-shadow: var(--shadow-light);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.carousel-item:hover img {
    transform: scale(1.25);
    box-shadow: var(--shadow-dark);
    z-index: 5;
    position: relative;
}

.carousel-item p {
    margin-top: 8px;
    transition: transform 0.3s ease, color 0.3s ease, opacity 0.3s ease;
    opacity: 0.9;
}

.carousel-item:hover p {
    transform: translateY(+30px);
    color: var(--secondary-color);
    opacity: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color var(--transition-duration) ease,
                transform var(--transition-duration) ease-in-out;
    z-index: 10;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium);
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.prev { left: 0; }
.next { right: 0; }

/* =========================
   Gráfico y Pestañas
   ========================= */

.text-primary-color { color: var(--primary-color); }
.text-secondary-color { color: var(--secondary-color); }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-900 { background-color: #0f172a; }

.tab-active {
    background-color: var(--primary-color) !important;
    color: #000 !important;
}
.tab-inactive {
    background-color: #1e293b;
    color: #fff;
}

.hidden { display: none; }

/* =========================
   Sección Proceso (Timeline)
   ========================= */

.proceso-section { padding: 60px 20px; }

.proceso-header {
    text-align: center;
    margin-bottom: 40px;
}

.proceso-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.proceso-header p {
    color: var(--soft-white);
    max-width: 600px;
    margin: 0 auto;
}

.proceso-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    flex-wrap: wrap;
    margin-top: 40px;
}

.proceso-line::before {
    content: "";
    position: absolute;
    top: 32px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #bae6fd;
    z-index: 0;
    transform: translateY(-50%);
}

.proceso-step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1 1 20%;
    min-width: 120px;
    padding: 0 10px;
    margin-bottom: 20px;
}

.proceso-circle {
    background: #e0f2fe;
    color: #0284c7;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0 auto 10px auto;
}

.proceso-step h4 {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 5px;
}

.proceso-step p {
    font-size: 0.875rem;
    color: var(--soft-white);
}

/* =========================
   CTA
   ========================= */

.cta {
    text-align: center;
    background: #e8824a;
    color: #fff;
    padding: var(--spacing-large) var(--padding-20);
    border-radius: var(--border-radius);
    margin-top: 40px;
}

.cta h2,
.cta h3 {
    color: #fff;
}

.cta-btn {
    background: linear-gradient(135deg, #007BFF, #0056b3);
    color: #fff;
    padding: 15px 30px;
    font-weight: bold;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 1.2rem;
    display: inline-block;
    transition: all var(--transition-duration) ease-in-out;
    box-shadow: var(--shadow-medium);
    border: none;
    position: relative;
    overflow: hidden;
    margin-top: var(--spacing-medium);
}

.cta-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004199);
    box-shadow: var(--shadow-dark);
    transform: scale(1.05);
}

.cta-btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: rgba(255, 255, 255, 0.2);
    transition: width 0.4s ease-in-out, height 0.4s ease-in-out, opacity 0.4s ease-in-out;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
}

.cta-btn:hover::before {
    width: 0;
    height: 0;
    opacity: 1;
}

/* =========================
   Sección Blog
   ========================= */

.blog {
    background: linear-gradient(to bottom, #0f172a, #1e293b);
    padding: 50px 20px;
    text-align: center;
    color: var(--text-color);
}

.blog h2 {
    color: var(--primary-color);
}

.blog-item {
    background: rgba(255, 255, 255, 0.08);
    padding: var(--spacing-large);
    margin: var(--spacing-medium) auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    transition: transform var(--transition-duration) ease-in-out,
                background var(--transition-duration) ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-item:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-dark);
}

.blog-item img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-medium);
    box-shadow: var(--shadow-light);
}

.blog-item h3 {
    font-size: var(--font-size-h3);
    margin-bottom: var(--spacing-small);
}

.blog-item h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.blog-item h3 a:hover {
    color: var(--secondary-color);
}

.blog-item ul {
    list-style: none;
    padding: 0;
    margin-top: var(--spacing-small);
    font-size: 0.95rem;
    color: var(--soft-white);
}

.blog-item ul li {
    margin-bottom: 5px;
}

/* =========================
   Animaciones al Scroll
   ========================= */

.section-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================
   Links
   ========================= */

a {
    transition: color var(--transition-duration) ease-in-out,
                transform 0.2s ease-in-out;
}

a:hover {
    color: var(--secondary-color);
    transform: translateY(-2px);
}

/* =========================
   Focus visible — WCAG 2.4.7
   ========================= */

:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 3px;
    border-radius: 4px;
}

:focus:not(:focus-visible) {
    outline: none;
}

form input:focus-visible,
form textarea:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 0;
}

.carousel-btn:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

nav ul li a:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 4px;
}

#whatsapp-btn:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

#backToTop:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* =========================
   Mapa
   ========================= */

.map-container {
    text-align: center;
    padding: var(--spacing-large) 0;
}

#map {
    width: 90%;
    max-width: 1000px;
    height: 400px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* =========================
   Contacto
   ========================= */

.contact {
    background: #002b64;
    color: #fff;
    text-align: center;
    padding: 50px 20px;
}

/* =========================
   Iconos
   ========================= */

.contact h2 i,
.icon,
.about h2 i,
.about h3 i,
.why-us h2 i {
    margin-right: 10px;
    font-size: 1.2em;
    color: var(--primary-color);
}

/* =========================
   Formularios
   ========================= */

form input,
form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: border-color var(--transition-duration), background var(--transition-duration);
    box-shadow: inset 0 2px 5px rgba(255, 124, 36, 0.3);
}

form input:focus,
form textarea:focus {
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 10px rgba(0, 212, 255, 0.4);
}

::placeholder {
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
}

form input:focus::placeholder,
form textarea:focus::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

form input[aria-invalid="true"],
form textarea[aria-invalid="true"] {
    border-color: #f87171;
    box-shadow: inset 0 2px 5px rgba(248, 113, 113, 0.35);
}

/* =========================
   CORRECCIÓN: Modal — conflicto display resuelto
   El JS inyecta el modal con style="display:flex" inline.
   Esta regla ya no interfiere.
   ========================= */
#formMessageModal {
    /* El modal es inyectado por JS con display:none inline.
       JS lo muestra cambiando style.display = 'flex'.
       No se define display aquí para evitar conflicto. */
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
}

/* Estilos del modal heredados para compatibilidad con .modal class */
.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-dark);
    text-align: center;
    position: relative;
    color: var(--text-color-dark);
}

.close-button {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.close-button:hover,
.close-button:focus {
    color: #000;
}

.modal-ok-button {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-top: 20px;
    transition: background-color var(--transition-duration);
}

.modal-ok-button:hover {
    background-color: var(--secondary-color);
}

/* =========================
   Botón "Ir Arriba"
   ========================= */

#backToTop {
    position: fixed;
    bottom: var(--spacing-medium);
    right: var(--spacing-medium);
    background: var(--primary-color);
    color: var(--text-color);
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transform: scale(0);
    transition: opacity var(--transition-duration) ease-in-out,
                transform var(--transition-duration) ease-in-out;
    font-size: 1.5rem;
    box-shadow: var(--shadow-medium);
    z-index: 1000;
}

#backToTop:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

/* =========================
   Botón Cambio de Tema
   ========================= */

#toggleTheme {
    position: fixed;
    top: var(--spacing-small);
    right: var(--spacing-small);
    background: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 5px 8px;
    font-size: 1rem;
    width: 35px;
    height: 35px;
    cursor: pointer;
    z-index: 1000;
    transition: all var(--transition-duration) ease;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

#toggleTheme:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

/* =========================
   WhatsApp Flotante
   ========================= */

#whatsapp-btn {
    position: fixed;
    bottom: 200px;
    right: 20px;
    background-color: #25d366;
    color: white;
    font-size: 30px;
    width: 50px;
    height: 50px;
    text-align: center;
    line-height: 50px;
    border-radius: 50%;
    box-shadow: var(--shadow-medium);
    transition: all var(--transition-duration) ease-in-out;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

#whatsapp-btn:hover {
    transform: scale(1.1);
    color: white;
}

/* =========================
   Pie de Página
   ========================= */

footer {
    background: #111;
    color: #fff;
    text-align: center;
    padding: var(--spacing-medium) 0;
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.3);
}

footer .container { padding: 0; }
footer p { margin: 0; }

/* =========================
   Redes Sociales
   ========================= */

.social-icons {
    display: flex;
    gap: var(--spacing-small);
    margin-top: var(--spacing-small);
    justify-content: center;
}

.social-icons a {
    color: var(--text-color);
    font-size: 2rem;
    transition: color var(--transition-duration) ease,
                transform var(--transition-duration) ease;
}

.social-icons a:hover {
    color: var(--secondary-color);
    transform: scale(1.1);
}

/* =========================
   Animaciones Generales
   ========================= */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================
   Accesibilidad — prefers-reduced-motion
   ========================= */

@media (prefers-reduced-motion: reduce) {
    .section-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero-content h1 {
        animation: none;
        white-space: normal;
        border-right: none;
        width: auto;
        overflow: visible;
    }
    .ticker-wrapper {
        animation: none;
    }
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* =========================
   Responsividad — Tablets
   ========================= */

@media (max-width: 1024px) {
    .carousel-item {
        flex: 0 0 calc(100% / 2);
    }
}

/* =========================
   Menú Hamburguesa
   ========================= */

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    box-shadow: none;
    z-index: 1100;
    flex-shrink: 0;
}

.hamburger:hover {
    background: none;
    box-shadow: none;
    transform: none;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.nav-overlay.open {
    display: block;
    opacity: 1;
}

.nav-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100dvh;
    background: #0f172a;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    padding: 80px 24px 32px;
    gap: 8px;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                visibility 0.35s;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
}

.nav-panel.open {
    transform: translateX(0);
    visibility: visible;
}

.nav-panel a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    transition: background var(--transition-duration), color var(--transition-duration);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-panel a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary-color);
    transform: none;
}

.nav-panel a.active {
    color: var(--primary-color);
    background: rgba(255, 179, 128, 0.1);
    border-bottom-color: var(--primary-color);
}

.nav-panel-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

.nav-panel-whatsapp {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #25d366;
    border-radius: var(--border-radius);
    color: #fff !important;
    font-weight: 700;
    border-bottom: none !important;
    justify-content: center;
    text-decoration: none;
}

.nav-panel-whatsapp:hover {
    background: #1da851 !important;
    color: #fff !important;
}

/* =========================
   Responsividad — Móvil
   ========================= */

@media (max-width: 768px) {

    .hamburger { display: flex; }
    .nav-right  { display: none; }

    header .container { padding: 0 16px; }

    nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        gap: 0;
    }

    .nav-left {
        flex-direction: row;
        gap: 8px;
        width: auto;
    }

    .logo { height: 42px; }

    .hero-section {
        height: 420px;
        padding-top: 70px;
    }
    .hero-index h1 {
        white-space: normal;
        font-size: 2rem;
    }

    .why-us-item { padding: var(--spacing-medium); }

    .carousel-item { flex: 0 0 100%; }
    .carousel-btn {
        padding: 8px 12px;
        font-size: 20px;
        width: 40px;
        height: 40px;
    }

    .solutions table,
    .solutions tbody,
    .solutions td,
    .solutions th,
    .solutions thead,
    .solutions tr { display: block; }

    .solutions thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .solutions tr {
        margin-bottom: 15px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: var(--border-radius);
    }

    .solutions td {
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    .solutions td::before {
        content: attr(data-label);
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: var(--primary-color);
    }

    .proceso-line {
        flex-direction: column;
        align-items: flex-start;
    }

    .proceso-line::before {
        left: 32px;
        width: 2px;
        height: calc(100% - 40px);
        top: 20px;
        transform: none;
    }

    .proceso-step {
        text-align: left;
        padding-left: 50px;
        min-width: unset;
        width: 100%;
    }

    .proceso-circle {
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
    }

    /* Deshabilitar parallax en móvil — evita jank */
    .hero-index {
        background-attachment: scroll !important;
    }
}