/* FUENTES HELVETICA NOW TEXT */
@font-face {
    font-family: 'Helvetica Now Text';
    src: url('Tipografía/Copia%20de%20HelveticaNowText-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Helvetica Now Text';
    src: url('Tipografía/Copia%20de%20HelveticaNowText-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Helvetica Now Text';
    src: url('Tipografía/Copia%20de%20HelveticaNowText-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Helvetica Now Text';
    src: url('Tipografía/Copia%20de%20HelveticaNowText-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Helvetica Now Text';
    src: url('Tipografía/Copia%20de%20HelveticaNowText-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}

/* RESET Y VARIABLES */
:root {
    --c-green: #9EB65B;
    --c-dark-green: #194734;
    --c-bg-light: #F8F9F8;
    --c-white: #FFFFFF;
    --c-text-gray: #666666;
    --font-main: 'Helvetica Now Text', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--c-white);
    color: var(--c-dark-green);
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
}

/* TIPOGRAFIA COMUN */
.badge {
    color: var(--c-green);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.title-main {
    font-size: 48px;
    font-weight: 400;
    line-height: 1.1;
    color: var(--c-dark-green);
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.title-main strong {
    font-weight: 700;
}

.text-green-dark {
    color: var(--c-dark-green);
}

/* =========================================
   1. HERO SECTION
   ========================================= */
.hero-section {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    overflow: visible;
}

.hero-backgrounds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: -2;
}

.bg-panel {
    flex: 1;
    background-size: cover;
    background-position: center;
    background-color: #2c2c2c;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #000000 -21.64%, rgba(0, 0, 0, 0.6) 40.82%, rgba(0, 0, 0, 0.2) 93.33%);
    z-index: 1;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1300px;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 40px;
    z-index: 2500;
    /* Extremely high to never be covered */
    transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        top 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        background-color 0.4s, box-shadow 0.4s;
    overflow: hidden;
    /* Prevents visual overflow during width animation */
}

.navbar.scrolled {
    top: 20px;
    width: 420px;
    background-color: rgba(14, 38, 20, 0.85);
    /* Dark green glass */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.navbar.scrolled .nav-links {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.navbar.scrolled .nav-logo {
    left: 40px;
    transform: translateY(-50%);
}

.navbar.scrolled .hamburger {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
}

.nav-links {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 30px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.left-links {
    left: 40px;
}

.right-links {
    right: 40px;
}

.nav-links a {
    color: var(--c-white);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: 0.3s;
    white-space: nowrap;
    /* Prevent text wrapping during transition */
}

.nav-links a:hover {
    opacity: 0.7;
}

.nav-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-logo img {
    height: 30px;
    filter: brightness(0) invert(1);
}

.btn-nav-contacto {
    background-color: var(--c-white);
    color: var(--c-dark-green) !important;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 700 !important;
}

/* Center Title */
.hero-center-title {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 12;
    width: 100%;
    pointer-events: none;
    transition: opacity 0.3s;
}

.hero-center-title h1 {
    color: var(--c-white);
    font-size: 72px;
    /* Was 90px */
    font-weight: 800;
    letter-spacing: -2px;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hero-center-title h1 .font-light {
    font-weight: 300;
}

.anim-mask {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
    padding: 15px 5px;
    margin: -15px -5px;
}

.anim-text {
    display: inline-block;
    transform: translateY(110%);
    /* Oculto por defecto hasta que actúe GSAP */
}

/* Bottom Content */
.hero-bottom-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    /* clamp(min, valor-ideal-en-vh, max)
       18vh ≈ 175px en 970px de alto (75px overlap + 100px visual) */
    padding: 0 5% clamp(130px, 18vh, 220px);
    z-index: 20;
}

.hero-subtitle {
    color: var(--c-green);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.hero-desc {
    color: var(--c-white);
    font-size: 20px;
    /* Was 24px */
    font-weight: 300;
    line-height: 1.4;
    max-width: 500px;
}

.hero-bottom-right {
    margin-bottom: 40px;
}

.btn-conoce-trabajamos {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background-color: var(--c-white);
    color: var(--c-dark-green);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: 16px 32px;
    border-radius: 40px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transition: 0.3s;
}

.btn-conoce-trabajamos:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.25);
}

.arrow-down-right {
    color: var(--c-dark-green);
}

/* =========================================
   2. SOBRE NOSOTROS
   ========================================= */
.sobre-nosotros {
    padding: 100px 0 120px;
    background-color: var(--c-white);
    border-radius: 80px 80px 0 0;
    position: relative;
    z-index: 20;
    margin-top: -75px;
}

.grids-2 {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
}

.sn-text-light {
    font-size: 20px;
    line-height: 1.6;
    font-weight: 400;
    color: var(--c-dark-green);
    max-width: 450px;
}

.sn-right {
    padding-top: 50px;
}

.sn-text-bold {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.6;
    margin-bottom: 50px;
    color: var(--c-dark-green);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
    font-weight: 600;
    color: var(--c-dark-green);
}

.check-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* =========================================
   3. ESPECIALIDADES TÉCNICAS
   ========================================= */
.especialidades {
    padding: 60px 0 280px;
    background-color: var(--c-white);
}

.header-especialidades {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
}

.es-right p {
    font-size: 16px;
    color: var(--c-text-gray);
    text-align: right;
    margin-bottom: 20px;
}

.grid-especialidades {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.card-imagen-principal {
    grid-column: 1 / 3;
    display: flex;
    align-items: flex-start;
}

.card-imagen-principal img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 30px;
}

/* =========================================
   3. ESPECIALIDADES TÉCNICAS
   ========================================= */
.especialidades {
    padding: 60px 0 280px;
    background-color: var(--c-white);
    position: relative;
    z-index: 10;
}

.header-especialidades {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
}

.es-right p {
    font-size: 16px;
    color: var(--c-text-gray);
    text-align: right;
    margin-bottom: 20px;
}

.grid-especialidades {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.card-imagen-principal {
    grid-column: 1 / 3;
    display: flex;
    align-items: stretch;
}

.card-imagen-principal img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 30px;
}

.cards-top-right {
    grid-column: 3 / 5;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: auto;
    gap: 20px;
    align-items: stretch;
}

.cards-top-right .card-esp {
    height: auto;
    min-height: unset;
}

.cards-bottom-row {
    grid-column: 1 / 5;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: stretch;
}

.cards-bottom-row .card-esp {
    height: auto;
    min-height: unset;
}

.card-esp {
    background-color: var(--c-bg-light);
    padding: 25px 25px;
    /* Reduced to compress the cards and minimize empty vertical space */
    border-radius: 30px;
    transition: all 0.3s ease;
    height: 100%;
    cursor: grab;
}

.card-esp:active {
    cursor: grabbing;
}

.card-esp:hover {
    background-color: #EFEFEF;
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-large {
    height: 100%;
}

.card-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 20px;
}

.card-esp h3 {
    font-family: var(--font-main);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0%;
    margin-bottom: 12px;
    color: var(--c-dark-green);
}

.card-esp p {
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0%;
    color: var(--c-text-gray);
}

/* =========================================
   4. SECTORES ESTRATÉGICOS
   ========================================= */
.sectores {
    position: relative;
    background-color: var(--c-dark-green);
    padding: 0 0 120px 0;
    margin: 0;
    color: var(--c-white);
    overflow-x: clip;
    z-index: 15;
}

.sectores-tab-bg {
    position: absolute;
    top: -10px;
    left: -10%;
    width: 60%;
    height: 190px;
    background-color: var(--c-white);
    transform: skewX(-25deg);
    border-bottom-right-radius: 40px;
    z-index: 1;
}

.iso-background {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    z-index: 1;
    display: flex;
    align-items: center;
}

.iso-background img {
    height: 130%;
    max-height: 1200px;
    object-fit: contain;
    transform: translateX(25%);
}

.title-sectores {
    font-size: 42px;
    font-weight: 400;
    color: var(--c-dark-green);
    position: relative;
    z-index: 2;
    padding-top: 60px;
    margin-bottom: 120px;
    letter-spacing: -1px;
}

.title-sectores strong {
    font-weight: 700;
}

.sectores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: relative;
    z-index: 2;
}

.sector-col {
    display: flex;
    flex-direction: column;
    gap: 60px;
    padding: 0 40px;
}

.sector-col:first-child {
    padding-left: 0;
}

.sector-col:last-child {
    padding-right: 0;
}

.sector-col:not(:last-child) {
    border-right: 1px solid rgba(158, 182, 91, 0.5);
}

.sector-item h3 {
    font-family: var(--font-main);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--c-white);
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(14, 38, 20, 0.8);
    /* Dark green shadow for readability over the light A */
}

.sector-item p {
    font-family: var(--font-main);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 10px rgba(14, 38, 20, 0.8);
    /* Dark green shadow for readability over the light A */
}

/* =========================================
   5. POR QUÉ ELEGIRNOS
   ========================================= */
.elegirnos {
    padding: 280px 0 120px;
    background-color: var(--c-white);
    position: relative;
    z-index: 10;
    border-radius: 0 0 80px 80px;
}

.elegirnos-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

.elegirnos-col-title {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-right: 20px;
}

.elegirnos-col-title .badge {
    color: var(--c-green);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 10px;
}

.elegirnos-col-title .title-main {
    font-size: 64px;
    line-height: 0.9;
    letter-spacing: -2px;
}

.card-elegirnos {
    grid-column: span 2;
    background-color: var(--c-bg-light);
    padding: 40px 30px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 25px;
    transition: 0.3s;
    cursor: grab;
}

.card-elegirnos:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.5;
    background-color: #e4eed6 !important;
    /* A light green color */
    transform: scale(0.98);
}

.sortable-swap-highlight {
    box-shadow: 0 0 0 4px #9eb65b !important;
    /* var(--c-green) */
}

.card-elegirnos:nth-child(4),
.card-elegirnos:nth-child(5) {
    grid-column: span 3;
}

.card-elegirnos:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-el-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.card-el-content {
    display: flex;
    flex-direction: column;
}

.card-elegirnos h3 {
    font-family: var(--font-main);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--c-dark-green);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.card-elegirnos p {
    font-family: var(--font-main);
    font-size: 15px;
    color: var(--c-text-gray);
    line-height: 1.5;
}

.cta-mid {
    text-align: center;
    margin-top: 80px;
}

.cta-mid p {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--c-dark-green);
    font-weight: 400;
}

.btn-dark {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background-color: var(--c-dark-green);
    color: var(--c-white);
    text-decoration: none;
    padding: 16px 45px;
    border-radius: 50px;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 18px;
    transition: 0.3s;
}

.btn-dark:hover {
    background-color: #113324;
    transform: scale(1.05);
}

.btn-arrow {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* =========================================
   6. FOOTER / CONTACTO
   ========================================= */
.footer-section {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1;
    background-color: var(--c-dark-green);
    padding-top: 160px;
    color: var(--c-white);
    margin-top: 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    padding-bottom: 60px;
    position: relative;
    z-index: 2;
}

.footer-left h2 {
    font-size: 54px;
    font-weight: 300;
    line-height: 1.1;
    margin-bottom: 25px;
    letter-spacing: -1px;
}

.footer-left h2 strong {
    font-weight: 700;
}

.footer-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    line-height: 1.5;
}

.contact-info h3 {
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 400;
}

.contact-info p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: #9EB65B;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.social-icon:hover {
    background-color: var(--c-white);
}

/* Formulario */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.form-group.w-100 {
    flex: 100%;
}

.form-group label {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
}

.form-group input,
.form-group select,
.form-group textarea {
    background-color: #123828;
    border: none;
    padding: 14px 20px;
    border-radius: 8px;
    color: var(--c-white);
    font-size: 15px;
    font-family: var(--font-main);
    outline: none;
    transition: background-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    background-color: #0f2c1f;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.btn-submit {
    background-color: #9EB65B;
    color: var(--c-dark-green);
    font-weight: 700;
    border: none;
    padding: 16px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    align-self: flex-start;
}

.btn-submit:hover {
    background-color: var(--c-white);
}

/* Honeypot anti-bot: completamente invisible */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    tab-size: 0;
}

/* Feedback del formulario */
.form-feedback {
    font-size: 13px;
    font-weight: 600;
    padding: 0;
    border-radius: 8px;
    min-height: 0;
    transition: all 0.3s ease;
}

.form-feedback--success {
    color: #9EB65B;
    padding: 12px 16px;
    background-color: rgba(158, 182, 91, 0.12);
}

.form-feedback--error {
    color: #ff6b6b;
    padding: 12px 16px;
    background-color: rgba(255, 107, 107, 0.1);
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "▼";
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.form-group select {
    width: 100%;
    appearance: none;
    cursor: pointer;
}

/* FOOTER BLACK BOTTOM */
.footer-black {
    position: relative;
    z-index: 10;
    /* Must be higher than .footer-section (z-index 1) to scroll over it */
    background-color: #060606;
    padding: 40px 0 30px;
}

.fb-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.fb-logo {
    height: 40px;
    object-fit: contain;
    margin-bottom: 30px;
}

.fb-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.8;
}

.fb-col h4 {
    font-size: 10px;
    font-weight: 700;
    color: #9EB65B;
    margin-bottom: 25px;
    letter-spacing: 1.5px;
}

.fb-col a {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 10px;
    margin-bottom: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.fb-col a:hover {
    color: var(--c-white);
}

.fb-col p {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
}

.fb-col:nth-child(4) {
    text-align: right;
}

.fb-icons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.fb-icons svg {
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: 0.3s;
}

.fb-icons svg:hover {
    color: var(--c-white);
}

.fb-bottom-row {
    display: flex;
    justify-content: space-between;
}

.fb-bottom-row p {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.3);
}

.human-link {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: 0.3s;
}

.human-link:hover {
    color: var(--c-white);
}

/* =========================================
   WA FLOAT — WHATSAPP FLOTANTE
   ========================================= */
.wa-float {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 3000;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
    text-decoration: none;
}

.wa-float:hover {
    transform: scale(1.12);
    box-shadow: 0 12px 32px rgba(37, 211, 102, 0.6);
}

.wa-float:hover .wa-tooltip {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.wa-icon {
    width: 30px;
    height: 30px;
    position: relative;
    z-index: 1;
}

/* Anillo de pulso */
.wa-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: #25D366;
    animation: wa-pulse 2.2s ease-out infinite;
}

@keyframes wa-pulse {
    0%   { transform: scale(1); opacity: 0.6; }
    70%  { transform: scale(1.7); opacity: 0; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* Tooltip */
.wa-tooltip {
    position: absolute;
    right: 72px;
    background-color: #1a1a1a;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    font-family: var(--font-main);
}

.wa-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right: none;
    border-left-color: #1a1a1a;
}

@media (max-width: 768px) {
    .wa-float {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
    }

    .wa-icon {
        width: 26px;
        height: 26px;
    }

    .wa-tooltip {
        display: none;
    }
}

/* =========================================
   7. ANIMATIONS
   ========================================= */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   8. RESPONSIVE DESIGN
   ========================================= */

/* NOTEBOOKS & SMALL DESKTOPS (Max 1200px) */
@media (max-width: 1200px) {
    .title-main {
        font-size: 40px;
    }

    .hero-center-title h1 {
        font-size: 60px;
    }

    .hero-bottom-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
    }

    .grids-2 {
        gap: 40px;
    }

    .stat-item h3 {
        font-size: 36px;
    }

    .grid-especialidades {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .card-imagen-principal {
        grid-column: 1 / 3;
    }

    .cards-top-right {
        grid-column: 1 / 3;
        gap: 15px;
    }

    .cards-bottom-row {
        grid-column: 1 / 3;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .sectores-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }

    .sector-col:last-child {
        grid-column: span 2;
        border-top: 1px solid rgba(158, 182, 91, 0.5);
        padding-top: 40px;
    }

    .sector-col:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid rgba(158, 182, 91, 0.5);
        padding-bottom: 40px;
    }

    .elegirnos-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .elegirnos-col-title {
        grid-column: span 2;
    }

    .card-elegirnos {
        grid-column: span 1 !important;
    }

    .fb-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* TABLETS (Max 992px) */
@media (max-width: 992px) {

    .bg-panel {
        background-image: url('images/ingenieria industrial.webp') !important;
        background-position: center center;
    }

    .sn-right-curve,
    .sn-fillet,
    .footer-right-curve,
    .footer-fillet {
        display: none;
    }

    .sobre-nosotros {
        padding: 60px 0;
        margin-top: 0;
        top: 0;
    }

    .grids-2 {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .footer-section {
        padding-top: 80px;
    }

    /* Hero bottom content — tablet (sin overlap, 12vh ≈ 100px en 830px) */
    .hero-bottom-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0 5% clamp(80px, 12vh, 130px);
        z-index: 20;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .hero-bottom-right {
        margin-bottom: 0;
    }
}

/* MOBILE (Max 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    .hero-center-title h1 {
        font-size: 42px;
    }

    /* Hero bottom content — mobile (sin overlap, clamp escala con altura) */
    .hero-bottom-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0 20px clamp(70px, 11vh, 120px);
        z-index: 20;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .hero-subtitle {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .hero-desc {
        font-size: 16px;
        max-width: 100%;
    }

    .hero-bottom-right {
        margin-bottom: 0;
    }

    .btn-conoce-trabajamos {
        font-size: 13px;
        padding: 12px 22px;
        gap: 10px;
    }

    .title-main {
        font-size: 32px;
    }

    .title-sectores {
        font-size: 32px;
    }

    .header-especialidades {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .es-right p {
        text-align: left;
    }

    .grid-especialidades {
        grid-template-columns: 1fr;
    }

    .card-imagen-principal {
        grid-column: 1 / 2;
    }

    .cards-top-right {
        grid-column: 1 / 2;
        grid-template-columns: 1fr;
    }

    .cards-col-middle {
        grid-template-columns: 1fr;
    }

    .cards-bottom-row {
        grid-column: 1 / 2;
        grid-template-columns: 1fr;
    }

    .sectores-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .sector-col {
        padding: 0;
        gap: 0;
        border-right: none !important;
        border-bottom: none !important;
        border-top: none !important;
        padding-bottom: 0 !important;
        padding-top: 0 !important;
    }

    .sector-item {
        padding: 30px 0;
        border-bottom: 1px solid rgba(158, 182, 91, 0.3);
    }

    .sector-col:last-child .sector-item:last-child {
        border-bottom: none;
    }

    .sector-col:last-child {
        grid-column: span 1;
    }

    .sectores-tab-bg {
        width: 110%;
        /* Much wider to ensure the text doesn't spill into dark green */
        height: 160px;
        /* Taller to fit two lines of text if it wraps */
        transform: skewX(-10deg);
        /* Less aggressive angle on mobile */
        left: -5%;
    }

    .iso-background {
        align-items: flex-end;
        /* Align the A to the bottom */
        padding-bottom: 50px;
    }

    .iso-background img {
        opacity: 1;
        height: 70%;
        /* Made it much smaller */
        max-height: 500px;
        transform: translateX(10%);

    }

    /* Mute background on mobile */

    .elegirnos-col-title {
        grid-column: span 1;
    }

    .elegirnos-col-title .title-main {
        font-size: 42px;
    }

    .elegirnos-grid {
        grid-template-columns: 1fr;
    }

    /* FOOTER MOBILE SIZING (COMPACT FORM) */
    .footer-section {
        padding-top: 20px;
    }

    .footer-grid {
        gap: 20px;
        padding-bottom: 20px;
    }

    .footer-left h2 {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .footer-desc {
        font-size: 13px;
        margin-bottom: 15px;
        line-height: 1.3;
    }

    .form-group label {
        margin-bottom: 6px;
        font-size: 11px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px 12px;
        font-size: 13px;
    }

    .form-group textarea {
        min-height: 50px;
    }

    .form-row {
        gap: 8px;
    }

    .btn-submit {
        padding: 10px 20px;
        width: 100%;
        margin-top: 0px;
        font-size: 13px;
    }

    .card-elegirnos {
        grid-column: span 1 !important;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .form-row {
        flex-direction: column;
        gap: 20px;
    }

    .fb-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px 20px;
    }

    .fb-col-1,
    .fb-col-4 {
        grid-column: 1 / 3;
    }

    .fb-desc br {
        display: none;
    }

    .fb-col {
        text-align: left !important;
    }

    .fb-icons {
        justify-content: flex-start;
    }

    .fb-bottom-row {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* =========================================
   9. MOBILE MENU & HAMBURGER
   ========================================= */

.hamburger {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--c-white);
    border-radius: 3px;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center;
}

/* Hamburger X Animation */
.hamburger.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    top: 20px;
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    overflow-y: auto;
    background: rgba(14, 38, 20, 0.85);
    /* Dark green glass, slightly more opaque */
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    z-index: 2400;
    /* Behind navbar (2500) so the main logo and hamburger stay on top */
    /* Must be higher than navbar (2500) */
    display: flex;
    flex-direction: column;
    padding: 110px 30px 30px 30px;
    /* Top padding to clear the navbar whether scrolled or not */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px) scale(0.98);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.mobile-menu.active {
    min-width: 351px !important;
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Modal Inner Styles */
.mm-header {
    display: none !important;
    /* Globally hidden - menu is integrated with navbar */
}

/* On Desktop, make the dropdown stretch out from behind the navbar */
@media (min-width: 993px) {
    .mobile-menu {
        left: 50%;
        top: 20px;
        /* Same as navbar */
        transform: translateX(-50%);
        right: auto;
        bottom: auto;
        width: 420px;
        /* Matched to the new navbar.scrolled width */
        max-height: calc(100vh - 40px);
        z-index: 2400;
        /* Placed exactly behind the navbar (2500) */

        /* The Stretch Animation */
        clip-path: inset(0 0 100% 0 round 40px);
        opacity: 1;
        /* Keep fully opaque to prevent fading during stretch */
        visibility: hidden;
        transition: clip-path 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
    }

    .mobile-menu.active {
        transform: translateX(-50%);
        clip-path: inset(0 0 0 0 round 40px);
        visibility: visible;
    }
}

.mm-logo {
    height: 25px;
    filter: brightness(0) invert(1);
}

.mobile-menu-close {
    color: var(--c-white);
    cursor: pointer;
    opacity: 0.7;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.mm-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 30px;
}

.mm-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 5px;
    font-weight: 700;
}

.mobile-link {
    color: var(--c-white);
    text-decoration: none;
    font-size: 32px;
    /* Reduced from 42px */
    font-weight: 400;
    line-height: 1.2;
    transition: 0.3s;
    letter-spacing: -0.5px;
    display: inline-block;
}

.mobile-link:hover {
    color: var(--c-light-green);
    transform: translateX(10px);
}

.mm-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

.mm-footer-col p {
    color: var(--c-white);
    font-size: 15px;
    line-height: 1.5;
    margin-top: 10px;
}

@media (max-width: 992px) {

    /* Mobile Menu - Same as Desktop, integrated with navbar */
    .mobile-menu {
        left: 50%;
        top: 20px;
        transform: translateX(-50%);
        right: auto;
        bottom: auto;
        width: 350px;
        /* Match navbar.scrolled width on mobile */
        max-height: calc(100vh - 40px);
        z-index: 2400;
        /* Placed exactly behind the navbar (2500) */

        /* The Stretch Animation */
        clip-path: inset(0 0 100% 0 round 40px);
        opacity: 1;
        /* Keep fully opaque to prevent fading during stretch */
        visibility: hidden;
        transition: clip-path 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
    }

    .mobile-menu.active {
        transform: translateX(-50%);
        clip-path: inset(0 0 0 0 round 40px);
        visibility: visible;
    }

    .navbar.scrolled {
        width: 350px;
        /* Narrower on mobile */
    }

    .navbar .nav-links {
        display: none;
    }

    .hamburger {
        opacity: 1;
        pointer-events: auto;
    }

    .nav-logo {
        left: 40px;
        transform: translateY(-50%);
    }

    /* Disable Footer Curtain Effect on Mobile */
    .footer-section {
        position: relative !important;
        padding-top: 60px;
    }

    .footer-spacer {
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute;
        /* So it doesn't affect document flow but can still be an anchor target */
        bottom: 0;
    }

    /* --- STICKY STACKING CARDS EFFECT (MOBILE) --- */

    /* 1. Especialidades Stacking */
    .cards-top-right,
    .cards-bottom-row {
        display: contents;
        /* Flattens grid for sticky stacking */
    }

    /* Target specific cards in their exact DOM order */
    .card-elegirnos {
        min-height: 340px;
    }

    .card-esp,
    .cards-top-right .card-esp,
    .cards-bottom-row .card-esp {
        height: 260px !important;
        min-height: unset !important;
        max-height: 260px !important;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        cursor: default !important;
    }

    .cards-top-right .card-esp:nth-child(1) {
        position: sticky;
        top: 100px;
        z-index: 10 !important;
    }

    .cards-top-right .card-esp:nth-child(2) {
        position: sticky;
        top: 115px;
        z-index: 20 !important;
    }

    .cards-top-right .card-esp:nth-child(3) {
        position: sticky;
        top: 130px;
        z-index: 30 !important;
    }

    .cards-top-right .card-esp:nth-child(4) {
        position: sticky;
        top: 145px;
        z-index: 40 !important;
    }

    .cards-bottom-row .card-esp:nth-child(1) {
        position: sticky;
        top: 160px;
        z-index: 50 !important;
    }

    .cards-bottom-row .card-esp:nth-child(2) {
        position: sticky;
        top: 175px;
        z-index: 60 !important;
    }

    .cards-bottom-row .card-esp:nth-child(3) {
        position: sticky;
        top: 190px;
        z-index: 70 !important;
    }

    /* 2. Por Qué Elegirnos Stacking */
    .card-elegirnos:nth-child(2) {
        position: sticky;
        top: 100px;
        z-index: 2;
    }

    .card-elegirnos:nth-child(3) {
        position: sticky;
        top: 115px;
        z-index: 3;
    }

    .card-elegirnos:nth-child(4) {
        position: sticky;
        top: 130px;
        z-index: 4;
    }

    .card-elegirnos:nth-child(5) {
        position: sticky;
        top: 145px;
        z-index: 5;
    }
}

/* SMALL PHONES (Max 576px) */
@media (max-width: 576px) {
    .navbar.scrolled {
        width: 90vw;
        max-width: 350px;
    }

    .mobile-menu {
        width: 90vw;
        max-width: 320px;
        top: 40px;
        /* Adjusted for non-scrolled navbar position */
    }

    .mobile-link {
        font-size: 28px;
    }

    .mm-body {
        gap: 6px;
        margin-bottom: 20px;
    }
}

/* =========================================
   12. NOTEBOOK / SMALL HEIGHT FIXES
   ========================================= */
/* Disable the fixed curtain effect on screens where the footer wouldn't fit vertically */
@media (max-height: 900px) and (min-width: 993px) {
    .footer-section {
        position: relative !important;
        padding-top: 100px;
    }

    .footer-spacer {
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute;
        bottom: 0;
    }

    .hero-bottom-content {
        /* pantalla baja: clamp ya maneja la escala, sólo forzamos row */
        flex-direction: row;
        align-items: flex-end;
        gap: 0;
    }

    .hero-desc {
        font-size: 16px;
    }

    .hero-bottom-right {
        margin-bottom: 0;
    }

    .btn-conoce-trabajamos {
        font-size: 13px;
        padding: 12px 24px;
    }
}

@media (max-width: 1400px) and (min-width: 993px) {
    .hero-bottom-content {
        flex-direction: row;
        align-items: flex-end;
        padding-bottom: 110px;
    }

    .hero-desc {
        font-size: 17px;
        max-width: 380px;
    }

    .hero-bottom-right {
        margin-bottom: 0;
    }
}