/*
=====================================================
  SISTEMA TIPOGRÁFICO UNIFICADO
  Impact Oil & Gas
  (Content from typography.css)
=====================================================
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@400;600;700;800;900&display=swap');

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

:root {
    /* Font families */
    --font-title: 'Montserrat', Arial, sans-serif;
    --font-body: 'Inter', Arial, sans-serif;

    /* Font weights */
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;
    --fw-black: 900;

    /* Font sizes */
    --fs-display-1: clamp(3.5rem, 6vw, 5rem);
    /* Increased min from 2.6rem to 3.5rem */
    --fs-display-2: clamp(2.8rem, 5vw, 3.7rem);
    /* Increased min from 2.1rem to 2.8rem */
    --fs-body-lg: 1.25rem;
    /* 20px */
    --fs-body-xl: clamp(1.5rem, 3vw, 2.25rem);
    /* 24px - 36px */
    --fs-md: 1rem;
    /* 16px */
    --fs-sm: 0.875rem;
    /* 14px */
    --fs-body-sm: clamp(0.75rem, 1.2vw, 0.875rem);
    /* 12px - 14px */
    --fs-xs: 0.75rem;
    /* 12px */

    /* Button sizes */
    --fs-btn-cta: 1.125rem;
    /* 18px */
    --fs-btn-regular: 1rem;
    /* 16px */
    --fs-btn-small: 0.875rem;
    /* 14px */

    /* Colors - Tipográficos */
    --color-text-primary: #0A0A0A;
    --color-text-secondary: #043f7b;
    --color-text-light: #fafafa;
    --color-text-muted: #6b7280;

    /* Global Colors (Merged from internal styles) */
    --color-primary: #043f7b;
    /* Using standard dark blue */
    --color-secondary: #0A0A0A;
    --color-primary-light: #0D698B;
    --color-dark-blue: #002D3E;

    /* Additional colors from index.html */
    --color-index-primary: #0d64a4;
    --color-index-secondary: #343431;
    --color-accent: #97bf13;
    --color-accent-light: #0483bd;
    --color-light: #f3f4f6;
    --color-white: #ffffff;
    --color-dark: #043f7b;
}

html {
    font-family: var(--font-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html,
body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
    box-sizing: border-box;
}

*,
::before,
::after {
    box-sizing: inherit;
}

/* Scrollbar override (from internal styles) */
#res-viewport::-webkit-scrollbar {
    display: none;
}

/* HERO PRINCIPAL */
.text-display-1 {
    font-family: var(--font-title);
    font-size: var(--fs-display-1);
    font-weight: var(--fw-extrabold);
    line-height: 1;
    letter-spacing: -0.025em;
}

/* TÍTULOS DE SECCIÓN */
.text-display-2 {
    font-family: var(--font-title);
    font-size: var(--fs-display-2);
    font-weight: var(--fw-black);
    line-height: 1.05;
    letter-spacing: -0.025em;
}

/* SUBTÍTULOS Y TÍTULOS DE SERVICIOS */
.text-title-lg {
    font-family: var(--font-title);
    font-size: var(--fs-body-lg);
    font-weight: var(--fw-bold);
    line-height: 1.2;
}

/* PÁRRAFOS PRINCIPALES */
.text-body-lg {
    font-family: var(--font-body);
    font-size: var(--fs-body-lg);
    font-weight: var(--fw-normal);
    line-height: 1.55;
}

/* PÁRRAFOS DESTACADOS RESPONSIVOS */
.text-body-xl {
    font-family: var(--font-body);
    font-size: var(--fs-body-xl);
    font-weight: var(--fw-normal);
    line-height: 1.3;
}

/* TEXTO SECUNDARIO */
.text-sm {
    font-family: var(--font-title);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.02em;
}

.text-sm-body {
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
}

/* ETIQUETAS DE SECCIÓN */
.text-body-sm {
    font-family: var(--font-title);
    font-size: var(--fs-body-sm);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.25em;
    line-height: 1.1;
    text-transform: uppercase;
}

/* TEXTO MUY PEQUEÑO */
.text-xs {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: var(--fw-normal);
    line-height: 1.2;
}

/* Navegación y botones */
.nav-text,
.btn-text {
    font-family: var(--font-title);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

/* Footer */
.footer-text {
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    word-break: break-word;
    /* Fix for long emails/links on mobile */
    overflow-wrap: break-word;
}

.footer-xs {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: var(--fw-normal);
}

/* Utilidades */
.antialiased {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.tracking-wide {
    letter-spacing: 0.05em;
}

/*
=====================================================
  Floating Navbar Styles
  (Content from navbar.css)
=====================================================
*/
.navbar-floating {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    background-color: transparent;
}

.navbar-floating.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Text color transitions */
.navbar-floating .nav-text {
    color: #fafafa;
    transition: color 0.3s ease;
}

.navbar-floating.scrolled .nav-text {
    color: #043f7b;
}

/* Logo transitions */
.navbar-floating .logo {
    transition: opacity 0.3s ease;
}

/* Dynamic logo switching */
.navbar-floating #logo-light {
    opacity: 1;
}

.navbar-floating #logo-dark {
    opacity: 0;
}

.navbar-floating.scrolled #logo-light {
    opacity: 0;
}

.navbar-floating.scrolled #logo-dark {
    opacity: 1;
}

/* CTA Button transitions */
.navbar-floating .cta-button {
    border-color: rgba(250, 250, 250, 0.7);
    color: #fafafa;
    transition: all 0.3s ease;
}

.navbar-floating .cta-button:hover {
    border-color: #fafafa;
    background-color: #fafafa;
    color: #043f7b;
}

.navbar-floating.scrolled .cta-button {
    border-color: rgba(4, 63, 123, 0.3);
    color: #043f7b;
}

.navbar-floating.scrolled .cta-button:hover {
    border-color: #043f7b;
    background-color: #043f7b;
    color: #fafafa;
}

/* Mobile menu button transitions */
.navbar-floating .mobile-toggle {
    color: #fafafa;
    transition: color 0.3s ease;
}

.navbar-floating.scrolled .mobile-toggle {
    color: #043f7b;
}

/* 
   EXPLICIT TOGGLE VISIBILITY RULES
   Ensures the button is visible on mobile regardless of Tailwind utility loading state.
*/
.mobile-toggle {
    display: none;
    /* Default hidden on desktop */
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        /* Push to right if needed, but flex-justify handles it */
        z-index: 1001;
    }
}

/* Contact Button Dual State Styling */

/* TRANSPARENT NAVBAR STATE (initial) */
.navbar-floating .btn-header-contact {
    border: 1px solid #fafafa;
    background: transparent;
    color: #fafafa;
    transition: all 0.3s ease;
}

.navbar-floating .btn-header-contact:hover {
    background: #fafafa;
    color: #043f7b;
    border: 1px solid #fafafa;
}

.navbar-floating .btn-header-contact svg {
    color: #fafafa;
    transition: color 0.3s ease;
}

.navbar-floating .btn-header-contact:hover svg {
    color: #043f7b;
}

/* WHITE NAVBAR STATE (scrolled) */
.navbar-floating.scrolled .btn-header-contact {
    border: 1px solid #043f7b;
    background: transparent;
    color: #043f7b;
}

.navbar-floating.scrolled .btn-header-contact:hover {
    background: #043f7b;
    color: #fafafa;
    border: 1px solid #043f7b;
}

.navbar-floating.scrolled .btn-header-contact svg {
    color: #043f7b;
}

.navbar-floating.scrolled .btn-header-contact:hover svg {
    color: #fafafa;
}

/* Dynamic Navigation Underline Styling */

.nav-active {
    position: relative;
}

.nav-active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    border-radius: 9999px;
    transition: background-color 0.3s ease;
}

/* TRANSPARENT NAVBAR STATE - White underline */
.navbar-floating .nav-active::after {
    background-color: #fafafa;
}

/* WHITE NAVBAR STATE - Blue underline */
.navbar-floating.scrolled .nav-active::after {
    background-color: #043f7b;
}

/* Dropdown button styling to match nav-text behavior */
.navbar-floating .dropdown-trigger {
    color: #fafafa;
    transition: color 0.3s ease;
}

.navbar-floating.scrolled .dropdown-trigger {
    color: #043f7b;
}

/* Dropdown arrow color transitions */
.navbar-floating .dropdown-trigger svg {
    color: #fafafa;
    transition: color 0.3s ease;
}

.navbar-floating.scrolled .dropdown-trigger svg {
    color: #043f7b;
}

/* Body should have no padding - navbar floats over content */
body {
    padding-top: 0;
}

/*
=====================================================
  Custom button styles
  (Content from custom-buttons.css)
=====================================================
*/

/* Base reset for all custom buttons */
.btn-primary-cta,
.btn-secondary-cta,
.btn-project,
.btn-header-contact {
    font-family: var(--font-body);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 9999px;
    text-decoration: none;
    cursor: pointer;
}

/* TYPE 1: Primary CTA */
.btn-primary-cta {
    font-weight: var(--fw-semibold);
    font-size: var(--fs-btn-cta);
    padding: 4px 32px;
    border: 1px solid #269fd7;
    background: transparent;
    color: var(--color-text-light);
}

.btn-primary-cta:hover {
    background: var(--color-text-light);
    color: var(--color-text-secondary);
    border-color: var(--color-text-light);
}

/* TYPE 2: Secondary CTA */
.btn-secondary-cta {
    font-weight: var(--fw-semibold);
    font-size: var(--fs-btn-cta);
    padding: 4px 32px;
    border: 1px solid var(--color-text-secondary);
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-secondary-cta:hover {
    background: var(--color-text-secondary);
    color: var(--color-text-light);
}

/* TYPE 3: Project button */
.btn-project {
    font-weight: var(--fw-semibold);
    font-size: var(--fs-btn-regular);
    padding: 4px 24px;
    border: 1px solid #269fd7;
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-project:hover {
    background: var(--color-text-secondary);
    color: #ffffff;
}

/* TYPE 4: Header Contact button */
.btn-header-contact {
    font-weight: var(--fw-medium);
    font-size: var(--fs-btn-small);
    padding: 4px 20px;
    border: 1px solid rgba(250, 250, 250, .7);
    background: transparent;
    color: var(--color-text-light);
}

.btn-header-contact:hover {
    border-color: var(--color-text-light);
    background: var(--color-text-light);
    color: var(--color-text-secondary);
}


/*
=====================================================
  Global Animations and Utils
  (Content from internal <style> blocks)
=====================================================
*/

/* Animaciones Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
    will-change: opacity, transform;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Force visibility in services section on mobile to avoid 'blank' content */
@media (max-width: 1023px) {
    #servicios-unificados .scroll-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Stagger delays */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

/* 
=====================================================
  CRITICAL: Z-INDEX & DROPDOWN FIXES
  Ensures Navbar and Dropdowns are always on top
=====================================================
*/
.navbar-floating {
    z-index: 10000 !important;
}

/* Navigation Dropdowns */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: #fafafa;
    border: 1px solid var(--color-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10001 !important;
    margin-top: 8px;
    pointer-events: auto !important;
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid rgba(4, 63, 123, 0.1);
}

.dropdown-item:hover {
    background: rgba(4, 63, 123, 0.05);
}

.dropdown-item-has-submenu {
    position: relative;
}

.dropdown-item-with-arrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
}

.dropdown-item-with-arrow:not(:last-child) {
    border-bottom: 1px solid rgba(4, 63, 123, 0.1);
}

.dropdown-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 200px;
    background: #fafafa;
    border: 1px solid var(--color-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    margin-left: 8px;
}

.dropdown-subitem {
    display: block;
    padding: 10px 16px;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 13px;
}

.dropdown-subitem:not(:last-child) {
    border-bottom: 1px solid rgba(4, 63, 123, 0.1);
}

.dropdown-subitem:hover {
    background: rgba(4, 63, 123, 0.05);
}

/* Ensure triggers are clickable */
.dropdown-trigger {
    position: relative;
    z-index: 10002;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
}

/* 
=====================================================
  ANIMATION SYSTEM UNIFICATION
=====================================================
*/

.title-animate {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
    max-width: 100vw;
    /* Prevent horizontal overflow during animation */
}

.title-animate.left {
    transform: translateX(-30px);
    /* Reduced for mobile safety */
}

.title-animate.right {
    transform: translateX(30px);
    /* Reduced for mobile safety */
}

@media (min-width: 768px) {
    .title-animate.left {
        transform: translateX(-50px);
    }

    .title-animate.right {
        transform: translateX(50px);
    }
}

.title-animate.visible,
.title-animate.animate-in {
    opacity: 1 !important;
    transform: translate(0, 0) !important;
}

/* 
=====================================================
  INTERNAL HERO SYSTEM (Nosotros, Servicios, Proyectos)
=====================================================
*/
.hero-internal {
    height: 48vh !important;
    min-height: 450px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding-top: 50px;
}

@media (max-width: 1024px) {
    .hero-internal {
        height: 42vh !important;
        min-height: 380px !important;
    }
}

@media (max-width: 768px) {
    .hero-internal {
        height: 38vh !important;
        min-height: 320px !important;
        padding-top: 15px;
    }

    .hero-internal h1 {
        font-size: 3rem !important;
        /* Increased from 2.1rem (~48px) */
        line-height: 1.1 !important;
    }
}

/* 
=====================================================
  ESSENCE TABS (Nosotros Page)
================================================System.out
*/
.essence-btn {
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: white;
    color: #043f7b;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.essence-btn.active {
    background: #043f7b;
    color: white;
    border-color: #043f7b;
}

.essence-btn.active svg {
    color: white;
    transform: translateX(4px);
}

.tab-pane {
    transition: all 0.5s ease;
}

.tab-pane.hidden {
    display: none;
    opacity: 0;
    transform: translateY(10px);
}

.animate-fade-in {
    animation: fadeInTab 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 1024px) {
    .sticky-sidebar {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: 6rem !important;
        align-self: start;
        z-index: 40;
    }
}
