/* ==========================================================================
   CND Prevent — Estilos globales
   Complementa a Tailwind (layout/utilidades) con los componentes propios.
   ========================================================================== */

:root {
    --brand: #dc2626;
    --brand-dark: #b91c1c;
    --brand-soft: #fef2f2;
    --ink: #0f0f12;
    --ink-2: #18181b;
    --text: #3f3f46;
    --muted: #71717a;
    --line: #e4e4e7;
    --surface: #ffffff;
    --surface-2: #f8f8f9;

    --header-h: 5rem;
    --radius: 1.25rem;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --shadow-sm: 0 1px 2px rgba(15, 15, 18, 0.04), 0 1px 3px rgba(15, 15, 18, 0.06);
    --shadow-lg: 0 24px 48px -16px rgba(15, 15, 18, 0.18), 0 8px 16px -8px rgba(15, 15, 18, 0.08);
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* :root (y no "html") para ganarle en especificidad al reset de Tailwind,
   que se inyecta después de esta hoja */
:root {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.65;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    color: var(--ink);
    letter-spacing: -0.015em;
    line-height: 1.15;
    text-wrap: balance;
    margin: 0;
}

p {
    text-wrap: pretty;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    border-radius: 0.375rem;
}

::selection {
    background: var(--brand);
    color: #fff;
}

/* ---------- Layout ---------- */
.container-x {
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1.25rem;
}

@media (min-width: 640px) {
    .container-x {
        padding-inline: 1.75rem;
    }
}

@media (min-width: 1024px) {
    .container-x {
        padding-inline: 2rem;
    }
}

.section {
    padding-block: clamp(4rem, 8vw, 7rem);
}

/* ---------- Tipografía ---------- */
.title-xl {
    font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4.25rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.028em;
}

.title-lg {
    font-size: clamp(1.875rem, 1.35rem + 2.2vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.022em;
}

.title-md {
    font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
    font-weight: 700;
}

.lead {
    font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
    line-height: 1.7;
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand);
}

.eyebrow::before {
    content: '';
    width: 1.75rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.section-head {
    max-width: 48rem;
    margin-inline: auto;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
    text-align: center;
}

.section-head .eyebrow {
    margin-bottom: 1rem;
}

.section-head .lead {
    margin-top: 1.25rem;
}

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.9rem 1.6rem;
    border-radius: 0.875rem;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
    white-space: nowrap;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.3s var(--ease), background-color 0.3s var(--ease), box-shadow 0.3s var(--ease),
        border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.btn svg {
    width: 1.125rem;
    height: 1.125rem;
    transition: transform 0.3s var(--ease);
}

.btn:hover svg {
    transform: translateX(3px);
}

.btn-primary {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 10px 24px -10px rgba(220, 38, 38, 0.65);
}

.btn-primary:hover {
    background: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 16px 32px -12px rgba(220, 38, 38, 0.7);
}

.btn-outline-light {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(6px);
}

.btn-outline-light:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.65rem 1.15rem;
    font-size: 0.9rem;
    border-radius: 0.75rem;
}

.btn[disabled] {
    opacity: 0.7;
    cursor: progress;
    transform: none;
}

/* ---------- Header / navegación ---------- */
.site-header {
    height: var(--header-h);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}

.site-header.is-scrolled {
    background: rgba(255, 255, 255, 0.96);
    border-color: var(--line);
    box-shadow: 0 8px 24px -16px rgba(15, 15, 18, 0.25);
}

.nav-link {
    position: relative;
    display: inline-block;
    padding: 0.5rem 0.85rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #3f3f46;
    transition: color 0.25s var(--ease);
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.2rem;
    height: 2px;
    border-radius: 2px;
    background: var(--brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--ease);
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--brand);
}

.nav-link:hover::after,
.nav-link.is-active::after {
    transform: scaleX(1);
}

.menu-toggle span {
    display: block;
    width: 1.375rem;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform 0.35s var(--ease), opacity 0.2s;
}

.menu-toggle span + span {
    margin-top: 5px;
}

.menu-toggle[aria-expanded='true'] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded='true'] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded='true'] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    position: absolute;
    inset-inline: 0;
    top: var(--header-h);
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(15, 15, 18, 0.35);
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path 0.45s var(--ease), visibility 0s linear 0.45s;
}

.mobile-menu.is-open {
    clip-path: inset(0 0 0 0);
    visibility: visible;
    transition: clip-path 0.45s var(--ease), visibility 0s;
}

.mobile-menu a.mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.95rem 0;
    font-weight: 600;
    font-size: 1.0625rem;
    color: var(--ink);
    border-bottom: 1px solid #f1f1f3;
}

.mobile-menu a.mobile-link.is-active {
    color: var(--brand);
}

/* ---------- Hero ---------- */
.hero {
    background: var(--ink);
    color: #fff;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(100deg, rgba(10, 10, 12, 0.94) 0%, rgba(10, 10, 12, 0.82) 45%, rgba(10, 10, 12, 0.45) 100%),
        url('images/bg-fondo.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Parallax solo en escritorio: en iOS/Android "fixed" se ve pixelado o no funciona */
@media (min-width: 1024px) and (hover: hover) {
    .hero-bg {
        background-attachment: fixed;
    }
}

.hero-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(220, 38, 38, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(220, 38, 38, 0.07) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 70%);
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fecaca;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.hero-pill .dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #f87171;
    box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7);
    animation: pulse 2.2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.6);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(248, 113, 113, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0);
    }
}

.hero-media {
    position: relative;
    border-radius: 1.75rem;
    padding: 0.75rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}

.hero-media img {
    width: 100%;
    border-radius: 1.25rem;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.hero-badge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1.1rem;
    border-radius: 1rem;
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-lg);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ---------- Carrusel de clientes (marquee infinito) ---------- */
.marquee {
    position: relative;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 10%, #000 90%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 10%, #000 90%, transparent 100%);
}

.marquee-track {
    display: flex;
    width: max-content;
    margin: 0;
    padding: 0;
    list-style: none;
    will-change: transform;
    animation: marquee var(--marquee-duration, 40s) linear infinite;
}

.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track {
    animation-play-state: paused;
}

/* Ancho fijo por slot: el loop es exacto aunque las imágenes aún no hayan cargado */
.marquee-item {
    flex: 0 0 auto;
    width: 10rem;
    height: 4.5rem;
    padding-inline: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marquee-item img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    object-fit: contain;
    filter: grayscale(1);
    opacity: 0.65;
    transition: filter 0.4s var(--ease), opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.marquee-item:hover img {
    filter: grayscale(0);
    opacity: 1;
    transform: scale(1.06);
}

/* En pantallas táctiles no hay hover: mostrar logos a color */
@media (hover: none) {
    .marquee-item img {
        filter: none;
        opacity: 1;
    }
}

@media (min-width: 768px) {
    .marquee-item {
        width: 13rem;
        height: 5.5rem;
        padding-inline: 2rem;
    }
}

@keyframes marquee {
    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(-50%, 0, 0);
    }
}

/* ---------- Cards genéricas ---------- */
.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s var(--ease);
}

.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: #fecaca;
}

/* Línea roja superior que se dibuja al hacer hover */
.card-accent::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 1.5rem;
    right: 1.5rem;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s var(--ease);
}

.card-accent:hover::before {
    transform: scaleX(1);
}

.icon-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    color: var(--brand);
    background: var(--brand-soft);
    transition: background-color 0.4s var(--ease), color 0.4s var(--ease), transform 0.4s var(--ease);
}

.icon-box svg {
    width: 1.75rem;
    height: 1.75rem;
}

.card:hover .icon-box {
    background: var(--brand);
    color: #fff;
    transform: rotate(-4deg) scale(1.04);
}

.icon-box-solid {
    background: var(--brand);
    color: #fff;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand-dark);
    background: var(--brand-soft);
}

.check-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.7rem;
}

.check-list li {
    position: relative;
    padding-left: 1.75rem;
    font-size: 0.9375rem;
    line-height: 1.55;
}

.check-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 0.65rem no-repeat;
}

/* ---------- Servicios ---------- */
.service-number {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 1.5px #e4e4e7;
    transition: -webkit-text-stroke-color 0.4s var(--ease);
}

.card:hover .service-number {
    -webkit-text-stroke-color: #fca5a5;
}

.quality-band {
    position: relative;
    overflow: hidden;
    border-radius: 1.75rem;
    background: radial-gradient(120% 140% at 0% 0%, #27272a 0%, var(--ink) 55%);
    color: #d4d4d8;
}

.quality-band::after {
    content: '';
    position: absolute;
    right: -6rem;
    top: -6rem;
    width: 20rem;
    height: 20rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.35), transparent 70%);
    pointer-events: none;
}

/* ---------- Certificaciones (flip cards) ---------- */
.flip-card {
    perspective: 1400px;
    height: 23rem;
    cursor: pointer;
    outline: none;
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s var(--ease);
}

@media (hover: hover) {
    .flip-card:hover .flip-inner {
        transform: rotateY(180deg);
    }
}

.flip-card.is-flipped .flip-inner {
    transform: rotateY(180deg);
}

.flip-card:focus-visible .flip-inner {
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--brand);
    border-radius: var(--radius);
}

.flip-face {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow-sm);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.flip-back {
    transform: rotateY(180deg);
    box-shadow: var(--shadow-lg);
}

.brand-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 7.5rem;
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--banner, var(--brand));
}

.brand-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 55%),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 12px);
}

.chip {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #3f3f46;
    background: #f4f4f5;
    border: 1px solid #ececef;
}

.flip-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand);
}

.flip-hint svg {
    width: 1rem;
    height: 1rem;
}

/* ---------- Productos ---------- */
.logo-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 7rem;
    padding: 1.25rem;
}

.logo-tile img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.45s var(--ease);
}

.logo-tile:hover img {
    transform: scale(1.06);
}

@media (min-width: 768px) {
    .logo-tile {
        height: 8.5rem;
        padding: 1.75rem;
    }
}

/* ---------- Contacto / formularios ---------- */
.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(248, 113, 113, 0.4);
    transform: translateX(6px);
}

.field-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.field {
    width: 100%;
    padding: 0.85rem 1rem;
    font: inherit;
    font-size: 1rem;
    /* 16px evita el zoom automático de iOS */
    border-radius: 0.75rem;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background-color 0.25s var(--ease);
}

.field::placeholder {
    color: #a1a1aa;
}

.field:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

.field-dark {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.field-dark:focus {
    background: rgba(255, 255, 255, 0.07);
}

.field[aria-invalid='true'] {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

textarea.field {
    resize: vertical;
    min-height: 8rem;
}

.form-status {
    display: none;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
}

.form-status.is-visible {
    display: flex;
}

.form-status[data-state='loading'] {
    background: rgba(250, 204, 21, 0.12);
    color: #fde68a;
    border: 1px solid rgba(250, 204, 21, 0.3);
}

.form-status[data-state='success'] {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.form-status[data-state='error'] {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.spinner {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Footer ---------- */
.footer-link {
    color: #a1a1aa;
    transition: color 0.25s var(--ease);
}

.footer-link:hover {
    color: #fff;
}

/* ---------- Animaciones de aparición (scroll reveal) ---------- */
.js [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: var(--delay, 0ms);
}

.js [data-reveal='left'] {
    transform: translateX(-28px);
}

.js [data-reveal='right'] {
    transform: translateX(28px);
}

.js [data-reveal='zoom'] {
    transform: scale(0.96);
}

.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* ---------- Accesibilidad: movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .js [data-reveal] {
        opacity: 1;
        transform: none;
    }

    .marquee-track {
        animation: none;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .marquee {
        -webkit-mask-image: none;
        mask-image: none;
    }
}
