/* ================= ROAKFIT DESIGN SYSTEM ================= */
:root {
    --bg-matte-black: #ffffff;
    --accent-oak: #b58860;
    --text-primary: #1a1a1a;
    --text-highlight: #1a1a1a;
    --text-secondary: #666666;
    --font-titles: 'Poppins', sans-serif;
    --font-links: 'Poppins', sans-serif;
    --font-text: 'Questrial', sans-serif;
    --header-height: 165px;
    /* Variables Base PC */
    --logo-r-x: 0px;
    --logo-r-y: 0px;
    --logo-r-scale: 1.6;
    --text-x: 0px;
    --text-y: 0px;
    --text-scale: 1.6;
    --drawer-width: 450px;
    --menu-scale: 1.0;
    /* Variables Base Móvil */
    --logo-r-x-mobile: 0px;
    --logo-r-y-mobile: 0px;
    --logo-r-scale-mobile: 1.6;
    --text-x-mobile: 0px;
    --text-y-mobile: 0px;
    --text-scale-mobile: 1.6;
    --drawer-width-mobile: 75%;
    --menu-scale-mobile: 1.0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================= COMPORTAMIENTO DE APP NATIVA (BLOQUEO DE GESTOS WEB) ================= */
html,
body {
    background-color: #ffffff !important;
    margin: 0;
    padding: 0;
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

input,
textarea {
    -webkit-user-select: auto;
    user-select: auto;
}

img,
video {
    -webkit-touch-callout: none;
    pointer-events: none;
}

body {
    font-family: var(--font-text);
    color: #1a1a1a;
    overflow-x: hidden;
}

/* ================= EFECTO TEXTURA "REVISTA FÍSICA" (FILM GRAIN) ================= */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
    font-family: var(--font-titles);
    font-weight: 500;
    color: var(--text-highlight);
}

a {
    color: inherit;
}

.text-oak-wood {
    color: var(--accent-oak);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1.5px;
}

.text-muted {
    color: var(--text-secondary);
}

/* ================= HEADER ON-LOAD ANIMATIONS ================= */
@keyframes fadeSlideUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideUpMenu {
    0% { opacity: 0; transform: translateY(20px) scale(var(--menu-scale)); }
    100% { opacity: 1; transform: translateY(0) scale(var(--menu-scale)); }
}

@keyframes fadeSlideUpLogo {
    0% { opacity: 0; transform: translate(var(--logo-r-x), calc(var(--logo-r-y) + 20px)) scale(var(--logo-r-scale)); }
    100% { opacity: 1; transform: translate(var(--logo-r-x), var(--logo-r-y)) scale(var(--logo-r-scale)); }
}

@keyframes fadeSlideUpTitle {
    0% { opacity: 0; transform: translate(var(--text-x), calc(var(--text-y) + 20px)) scale(var(--text-scale)); }
    100% { opacity: 1; transform: translate(var(--text-x), var(--text-y)) scale(var(--text-scale)); }
}

/* ================= HEADER SIMÉTRICO CLEAN WHITE ================= */
.site-header,
.header-symmetrical-clean-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 25px 40px;
    box-shadow: none !important;
    z-index: 1000;
}

/* Cabecera deportiva: corte diagonal rojo/negro y borde blanco */
.header-symmetrical-clean-light {
    background: linear-gradient(105deg, #b21e27 35%, #1a1a1a 35.2%) !important;
    border-bottom: 3px solid #ffffff !important;
    margin: 0 !important;
    padding: 25px 40px !important;
    transition: all 0.5s ease-in-out !important;
}

.header-left-col a,
.header-center-col a {
    pointer-events: auto !important;
}

.header-center-col {
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-right-col {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.logo-r-png {
    height: 95px !important;
    width: auto !important;
    object-fit: contain !important;
    pointer-events: none;
    display: block;
    transform: translate(var(--logo-r-x), var(--logo-r-y)) scale(var(--logo-r-scale)) !important;
    mix-blend-mode: normal !important;
    filter: brightness(0) invert(1) !important;
    opacity: 0;
    animation: fadeSlideUpLogo 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#logo-3d-container.logo-r-png {
    width: 150px !important;
    height: 80px !important;
    min-width: 150px !important;
    min-height: 80px !important;
    filter: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    animation: none !important;
    display: flex !important;
}

#logo-3d-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none;
}

.title-roakfit-centered {
    height: 75px !important;
    width: auto !important;
    object-fit: contain !important;
    pointer-events: none;
    display: block;
    transform: translate(var(--text-x), var(--text-y)) scale(var(--text-scale)) !important;
    mix-blend-mode: normal !important;
    filter: brightness(0) invert(1) !important;
    opacity: 0;
    animation: fadeSlideUpTitle 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

/* ================= MENÚ ASIMÉTRICO (STAGGERED LINES) ================= */
.staggered-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px !important;
    padding: 5px !important;
    width: 35px !important;
    opacity: 0;
    transform: scale(var(--menu-scale)) !important;
    transform-origin: center center;
    animation: fadeSlideUpMenu 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.stag-line {
    display: block;
    height: 2px !important;
    background-color: #ffffff !important;
    border-radius: 2px;
    transition: transform 0.8s ease-out, width 0.8s ease-out !important;
}

.stag-line.line-1 {
    width: 85%;
    transform: translateX(-4px);
}

.stag-line.line-2 {
    width: 100%;
    transform: translateX(6px);
}

.stag-line.line-3 {
    width: 65%;
    transform: translateX(-12px);
}

.staggered-menu-btn:hover .stag-line,
.staggered-menu-btn:active .stag-line {
    transform: translateX(0);
    width: 100%;
}

/* ================= UNIVERSAL DRAWER ================= */
/* 1. OVERLAY (Desvanecimiento Suave) */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4) !important;
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease-out, visibility 0.4s ease-out !important;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* 2. DRAWER ACELERADO POR HARDWARE Y CURVA PREMIUM */
.universal-drawer {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    width: var(--drawer-width) !important;
    height: 100vh;
    background: rgba(249, 249, 249, 0.45) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    z-index: 2000;
    transition: transform 0.4s ease-out !important;
    padding: 80px 50px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.universal-drawer.open {
    transform: translateX(0);
}

/* 3. BOTÓN DE CERRAR CON ANIMACIÓN DE ENTRADA */
.close-drawer-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 45px;
    color: #1a1a1a;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
    transition: transform 0.8s ease-out, color 0.8s ease-out !important;
}

.universal-drawer.open .close-drawer-btn {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    transition-delay: 0.2s;
}

.universal-drawer.open .close-drawer-btn:hover,
.universal-drawer.open .close-drawer-btn:active {
    transform: rotate(180deg) scale(1.15) !important;
    color: #b58860 !important;
    cursor: pointer;
}

.drawer-nav-links {
    display: flex;
    flex-direction: column;
    gap: 85px;
    margin-top: 60px;
}

/* 4. EFECTO CASCADA (STAGGER) EN LOS ENLACES */
.drawer-nav-links a {
    color: #1a1a1a;
    text-decoration: none;
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: var(--font-links);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s;
}

.drawer-nav-links a:hover {
    color: #b58860;
}

.universal-drawer.open .drawer-nav-links a {
    opacity: 1;
    transform: translateY(0);
}

.universal-drawer.open .drawer-nav-links a:nth-child(1) { transition-delay: 0.15s; }
.universal-drawer.open .drawer-nav-links a:nth-child(2) { transition-delay: 0.22s; }
.universal-drawer.open .drawer-nav-links a:nth-child(3) { transition-delay: 0.29s; }
.universal-drawer.open .drawer-nav-links a:nth-child(4) { transition-delay: 0.36s; }

.drawer-lang-switcher {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.drawer-region-section {
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.universal-drawer.open .drawer-region-section {
    opacity: 1;
    transition-delay: 0.35s;
}

.universal-drawer.open .drawer-lang-switcher {
    opacity: 1;
    transition-delay: 0.4s;
}

.drawer-lang-switcher select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    font-family: var(--font-text);
}

.drawer-lang-switcher select option {
    background: #ffffff;
    color: #1a1a1a;
}

/* ================= LAYOUT & SECTIONS ================= */
main {
    padding-top: var(--header-height);
    background-color: transparent !important;
    background: none !important;
}

.main-container,
.wrapper {
    background-color: transparent !important;
    background: none !important;
}

section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 5vw;
}

.fade-section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
    width: 100%;
}

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

.hero {
    flex-direction: column;
    text-align: center;
    position: relative;
    background: transparent;
}

/* ================= AJUSTE DE FONDO HERO ================= */
.hero-fullscreen-bg {
    position: relative;
    width: 100%;
    min-height: calc(100vh - var(--header-height));
    /* Mantenemos el cover para que llene la pantalla... */
    background-size: cover !important;
    /* ...pero cambiamos la posición a 'top center' para priorizar la parte de arriba (las cabezas) y evitar recortes ahí */
    background-position: top center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    overflow: hidden;
}

.hero-content-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
}

.machine-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    width: 100%;
}

.main-machine-img {
    max-width: 100%;
    max-height: 70vh;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0px 20px 30px rgba(0, 0, 0, 0.5));
    pointer-events: none;
}

.hero-fullscreen-bg .btn-hero {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.7);
}

/* Botón Premium ROAKFIT - Cotización */
.btn-premium-quote {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 35px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #ffffff !important;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.7);
    text-decoration: none !important;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    pointer-events: auto;
}

.btn-premium-quote:hover {
    background-color: #cc0000;
    border-color: #cc0000;
    color: #ffffff !important;
    box-shadow: 0 5px 15px rgba(204, 0, 0, 0.4);
    transform: translateY(-2px);
}

.hero-fullscreen-bg .btn-premium-quote {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
}

.hero-fullscreen-bg .btn-premium-quote:hover {
    transform: translateX(-50%) translateY(-2px);
}

.hero-fullscreen-bg .btn-hero:hover {
    color: #ffffff;
    border-color: #b58860 !important;
}

.hero img,
.hero video {
    width: auto;
    max-width: 100%;
    max-height: 75vh;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 0;
}

.hero .btn-hero {
    position: absolute;
    bottom: 120px;
    background-color: transparent;
    color: #1a1a1a;
    padding: 12px 32px;
    border-radius: 30px;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.35);
    font-family: var(--font-text);
    font-weight: 600;
    font-size: 16px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.hero .btn-hero:hover {
    transform: scale(1.03);
    border-color: #b58860 !important;
    color: #1a1a1a;
    box-shadow: 0 5px 15px rgba(181, 136, 96, 0.2);
}

.section-performance {
    background: transparent;
}

.section-performance .text-content h2 {
    color: var(--text-highlight);
}

.section-performance .text-content p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.split-section {
    display: flex;
    gap: 50px;
    align-items: center;
}

.split-section > div {
    flex: 1;
}

.split-section img,
.split-section video {
    width: 100%;
    object-fit: cover;
    display: block;
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 0;
}

.text-content {
    padding: 40px;
}

.btn {
    display: inline-block;
    padding: 12px 40px;
    border-radius: 5px;
    text-decoration: none;
    margin-bottom: 10px;
    width: 200px;
    text-align: center;
    font-family: var(--font-titles);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.btn-black {
    background-color: var(--accent-oak);
    color: #ffffff;
    border: 1px solid var(--accent-oak);
}

.btn-black:hover {
    background-color: transparent;
}

.btn-outline {
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--accent-oak);
    color: var(--accent-oak);
}

.offer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    text-align: center;
    padding: 0 50px;
}

.offer-item svg {
    stroke: var(--accent-oak);
}

.offer-item p {
    color: var(--text-secondary);
}

.review-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 900;
}

/* ================= FOOTER ================= */
footer {
    padding: 40px 50px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: transparent;
}

footer a {
    color: var(--text-primary);
    text-decoration: none;
}

footer a:hover {
    color: var(--accent-oak);
}

/* ================= FLASH MESSAGES ================= */
.flash-message {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    font-family: var(--font-text);
}

.flash-success {
    background-color: rgba(40, 167, 69, 0.12);
    color: #6fcf97;
    border: 1px solid rgba(40, 167, 69, 0.35);
}

.flash-error {
    background-color: rgba(220, 53, 69, 0.12);
    color: #ff8a8a;
    border: 1px solid rgba(220, 53, 69, 0.35);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    :root {
        --header-height: 85px;
    }

    section {
        padding: 60px 20px;
        min-height: auto;
    }

    .hero-fullscreen-bg {
        min-height: calc(100vh - var(--header-height));
        background-attachment: scroll !important;
        padding: 30px 15px;
    }

    .main-machine-img {
        max-height: 55vh;
    }

    .hero .btn-hero,
    .hero-fullscreen-bg .btn-hero,
    .hero-fullscreen-bg .btn-premium-quote {
        bottom: 80px;
        left: 20px;
        right: 20px;
        width: auto;
        transform: none;
    }

    .hero-fullscreen-bg .btn-premium-quote:hover {
        transform: translateY(-2px);
    }

    .split-section {
        flex-direction: column;
        gap: 30px;
    }

    .split-section > div:not(.text-content) {
        order: 1;
    }

    .split-section .text-content {
        order: 2;
        padding: 20px 0;
    }

    .offer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0;
    }

    .btn {
        width: 100%;
        max-width: 100%;
    }

    footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
        padding: 40px 20px;
    }

    footer > div {
        text-align: center !important;
    }
}

/* ================= INTERFAZ MÓVIL CON LOGO Y TÍTULO MÁS GRANDES ================= */
@media (max-width: 768px) {
    @keyframes fadeSlideUpLogoMobile {
        0% { opacity: 0; transform: translate(var(--logo-r-x-mobile), calc(var(--logo-r-y-mobile) + 20px)) scale(var(--logo-r-scale-mobile)); }
        100% { opacity: 1; transform: translate(var(--logo-r-x-mobile), var(--logo-r-y-mobile)) scale(var(--logo-r-scale-mobile)); }
    }

    @keyframes fadeSlideUpTitleMobile {
        0% { opacity: 0; transform: translate(var(--text-x-mobile), calc(var(--text-y-mobile) + 20px)) scale(var(--text-scale-mobile)); }
        100% { opacity: 1; transform: translate(var(--text-x-mobile), var(--text-y-mobile)) scale(var(--text-scale-mobile)); }
    }

    @keyframes fadeSlideUpMenuMobile {
        0% { opacity: 0; transform: translateY(20px) scale(var(--menu-scale-mobile)); }
        100% { opacity: 1; transform: translateY(0) scale(var(--menu-scale-mobile)); }
    }

    /* 1. ASEGURAR QUE LA CABECERA NO CREZCA */
    .header-symmetrical-clean-light {
        align-items: center !important;
        padding: 5px 15px !important;
        justify-items: center !important;
        grid-template-columns: 1fr 1.5fr 1fr !important;
        gap: 5px !important;
    }

    /* 2. LOGO 'R' CON ALAS: Más grande y centrado en la zona roja */
    .logo-r-png {
        height: 35px !important;
        transform: translate(var(--logo-r-x-mobile), var(--logo-r-y-mobile)) scale(var(--logo-r-scale-mobile)) !important;
        margin: 0 auto !important;
        display: block !important;
        width: auto !important;
        object-fit: contain !important;
        animation: fadeSlideUpLogoMobile 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    #logo-3d-container.logo-r-png {
        width: 120px !important;
        height: 60px !important;
        min-width: 120px !important;
        min-height: 60px !important;
        opacity: 1 !important;
        animation: none !important;
        display: flex !important;
    }

    /* 3. TÍTULO 'ROAKFIT': Más grande y centrado en la zona negra */
    .title-roakfit-centered {
        height: 30px !important;
        transform: translate(var(--text-x-mobile), var(--text-y-mobile)) scale(var(--text-scale-mobile)) !important;
        margin: 0 auto !important;
        display: block !important;
        max-width: none !important;
        width: auto !important;
        object-fit: contain !important;
        animation: fadeSlideUpTitleMobile 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
    }

    .staggered-menu-btn {
        margin-left: auto;
        width: 38px !important;
        gap: 6px !important;
        padding: 5px !important;
        transform: scale(var(--menu-scale-mobile)) !important;
        transform-origin: center center;
        animation: fadeSlideUpMenuMobile 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    }

    .stag-line {
        height: 2.5px !important;
    }

    img,
    video {
        max-width: 100%;
        height: auto;
    }

    .hero-image-container,
    .project-image-container {
        width: 100%;
        overflow: hidden;
    }

    /* ================= AJUSTES DEL DRAWER PARA MÓVIL ================= */
    .universal-drawer {
        width: var(--drawer-width-mobile) !important;
        padding: 50px 20px !important;
        transition: transform 0.4s ease-out !important;
    }

    .drawer-overlay {
        transition: opacity 0.4s ease-out, visibility 0.4s ease-out !important;
    }

    .close-drawer-btn {
        font-size: 32px !important;
        top: 15px !important;
        right: 20px !important;
        transition: transform 0.8s ease-out, color 0.8s ease-out !important;
    }

    .drawer-nav-links {
        margin-top: 50px !important;
        gap: 50px !important;
        align-items: center !important;
    }

    .drawer-nav-links a {
        font-size: 18px !important;
        text-align: center !important;
    }
}
