/* ========================================
   JMD Suministros Industriales - SUMINSA
   Brand-compliant corporate website
   ======================================== */

/* ---------- Self-hosted Fonts (WOFF2) ---------- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/inter-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/inter-500.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/assets/fonts/inter-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/oswald-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/oswald-500.woff2') format('woff2');
}

@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/oswald-700.woff2') format('woff2');
}

/* ---------- CSS Custom Properties ---------- */
:root {
    --color-primary: #004DA7;
    --color-primary-dark: #003a80;
    --color-primary-light: #1a6bc4;
    --color-secondary: #808080;
    --color-secondary-light: #a0a0a0;
    --color-black: #000000;
    --color-white: #FFFFFF;
    --color-bg: #f7f8fa;
    --color-bg-alt: #eef1f5;
    --color-text: #1a1a2e;
    --color-text-light: #4a4a6a;

    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);

    --transition: 0.3s ease;
    --nav-height: 80px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

a:hover {
    color: var(--color-primary-light);
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- NAVBAR ---------- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 1000;
    transition: all var(--transition);
    background: transparent;
}

.navbar.scrolled {
    background: rgba(0, 77, 167, 0.97);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-logo-img {
    height: 40px;
    width: auto;
    transition: opacity var(--transition);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-white);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    letter-spacing: 0.02em;
}

.nav-link:hover {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.15);
}

.nav-link--cta {
    background: var(--color-white);
    color: var(--color-primary) !important;
    font-weight: 600;
    padding: 8px 24px;
}

.nav-link--cta:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-primary) !important;
    transform: translateY(-1px);
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.nav-toggle span {
    width: 26px;
    height: 2px;
    background: var(--color-white);
    border-radius: 2px;
    transition: all var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- HERO ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    overflow: hidden;
}

.hero-bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.02) 0%, transparent 70%);
    animation: patternFloat 20s ease-in-out infinite;
}

.hero-bg-pattern::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 80%;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 50%;
    animation: rotateSlow 30s linear infinite;
}

.hero-bg-pattern::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 60%;
    height: 60%;
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 50%;
    animation: rotateSlow 25s linear infinite reverse;
}

@keyframes patternFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes rotateSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 120px 24px 80px;
}

.hero-logo {
    height: 80px;
    width: auto;
    margin: 0 auto 40px;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.2));
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--color-white);
    line-height: 1.15;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 40px;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Scroll indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.hero-scroll-indicator span {
    display: block;
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 12px;
    position: relative;
}

.hero-scroll-indicator span::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: rgba(255,255,255,0.7);
    border-radius: 2px;
    animation: scrollDown 1.5s ease-in-out infinite;
}

@keyframes scrollDown {
    0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
    50% { opacity: 0.3; transform: translateX(-50%) translateY(12px); }
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
}

.btn-primary:hover {
    background: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-outline {
    background: transparent;
    color: var(--color-white);
    border-color: rgba(255,255,255,0.5);
}

.btn-outline:hover {
    background: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn-full:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 77, 167, 0.3);
}

/* ---------- SECTIONS ---------- */
.section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 12px;
    position: relative;
}

.section-tag::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--color-primary);
    margin: 10px auto 0;
    border-radius: 2px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--color-text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* ---------- NOSOTROS ---------- */
.nosotros {
    background: var(--color-bg);
}

.nosotros-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.nosotros-lead {
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: var(--color-text);
}

.nosotros-text p {
    margin-bottom: 16px;
    color: var(--color-text-light);
}

.nosotros-stats {
    display: grid;
    gap: 20px;
}

.stat-card {
    background: var(--color-white);
    padding: 28px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border-left: 4px solid var(--color-primary);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.stat-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    color: var(--color-primary);
}

.stat-icon svg {
    width: 100%;
    height: 100%;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 4px;
}

/* ---------- SERVICIOS ---------- */
.servicios {
    background: var(--color-white);
}

.servicios-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.servicio-card {
    background: var(--color-white);
    padding: 36px 28px;
    border-radius: var(--radius-md);
    border: 1px solid #e8ecf2;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.servicio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.servicio-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
    border-color: transparent;
}

.servicio-card:hover::before {
    transform: scaleX(1);
}

.servicio-icon {
    width: 52px;
    height: 52px;
    color: var(--color-primary);
    margin-bottom: 20px;
}

.servicio-icon svg {
    width: 100%;
    height: 100%;
}

.servicio-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.servicio-desc {
    font-size: 0.93rem;
    color: var(--color-text-light);
    line-height: 1.7;
}

/* ---------- METODOLOGIAS ---------- */
.metodologias {
    background: var(--color-bg);
}

.metodologias-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.metodologia-card {
    background: var(--color-white);
    padding: 44px 36px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.metodologia-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.metodologia-badge {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 16px;
    letter-spacing: 0.05em;
    line-height: 1;
}

.metodologia-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--color-secondary);
    margin-bottom: 16px;
    letter-spacing: 0.05em;
}

.metodologia-desc {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 24px;
    line-height: 1.8;
}

.metodologia-benefits {
    display: grid;
    gap: 10px;
}

.metodologia-benefits li {
    font-size: 0.9rem;
    color: var(--color-text);
    padding-left: 24px;
    position: relative;
}

.metodologia-benefits li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 2px;
    transform: rotate(45deg);
}

/* ---------- CONTACTO ---------- */
.contacto {
    background: var(--color-white);
}

.contacto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.contacto-item {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    align-items: flex-start;
}

.contacto-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: var(--color-bg);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.contacto-icon svg {
    width: 100%;
    height: 100%;
}

.contacto-item h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
    margin-bottom: 4px;
}

.contacto-item a,
.contacto-item p {
    font-size: 0.93rem;
    color: var(--color-text-light);
    line-height: 1.6;
}

.contacto-item a:hover {
    color: var(--color-primary);
}

.contacto-social {
    margin-top: 12px;
}

.contacto-social h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
    margin-bottom: 12px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--color-bg);
    color: var(--color-secondary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

.social-link:hover {
    background: var(--color-primary);
    color: var(--color-white);
    transform: translateY(-2px);
}

/* Form */
.contacto-form-wrapper {
    background: var(--color-bg);
    padding: 36px;
    border-radius: var(--radius-md);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 0.93rem;
    color: var(--color-text);
    background: var(--color-white);
    border: 1px solid #dde1e8;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 77, 167, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-secondary-light);
}

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

/* Mapa */
.contacto-mapa {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* ---------- FOOTER ---------- */
.footer {
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 60px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo {
    height: 36px;
    width: auto;
    margin-bottom: 16px;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.8;
}

.footer h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-white);
    margin-bottom: 16px;
}

.footer-links ul {
    display: grid;
    gap: 8px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--color-white);
}

.footer-contact p,
.footer-contact a {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    display: block;
}

.footer-contact a:hover {
    color: var(--color-white);
}

.footer-bottom {
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ---------- ANIMATIONS ---------- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.4s; }
.fade-in:nth-child(4) { animation-delay: 0.6s; }

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

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

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

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nosotros-grid {
        gap: 40px;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-height: 70px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--color-primary-dark);
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        padding: 40px;
        transition: right 0.4s ease;
        box-shadow: -4px 0 20px rgba(0,0,0,0.2);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 12px 20px;
        width: 100%;
    }

    .nav-link--cta {
        margin-top: 12px;
        text-align: center;
    }

    .hero-logo {
        height: 56px;
    }

    .hero-content {
        padding: 100px 16px 60px;
    }

    .section {
        padding: 70px 0;
    }

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

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

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

    .contacto-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

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

    .hero-ctas {
        flex-direction: column;
        align-items: center;
    }

    .hero-ctas .btn {
        width: 100%;
        max-width: 280px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .servicio-card {
        padding: 28px 20px;
    }

    .metodologia-card {
        padding: 32px 24px;
    }

    .contacto-form-wrapper {
        padding: 24px;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}

/* ---------- FOCUS & ACCESSIBILITY ---------- */
*:focus-visible {
    outline: 3px solid var(--color-primary-light);
    outline-offset: 2px;
    border-radius: 2px;
}

.nav-link:focus-visible {
    outline-color: var(--color-white);
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 9999;
    padding: 12px 24px;
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.skip-link:focus {
    top: 16px;
}

/* ---------- WHATSAPP FLOAT ---------- */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all var(--transition);
    animation: whatsappPulse 2s ease-in-out infinite;
}

.whatsapp-float svg {
    width: 32px;
    height: 32px;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(37, 211, 102, 0.5);
    color: var(--color-white);
}

@keyframes whatsappPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(37, 211, 102, 0.6); }
}

/* ---------- MODAL (Aviso de Privacidad) ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 40px;
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--color-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-content h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text);
    margin-bottom: 24px;
    padding-right: 32px;
}

.modal-body p {
    font-size: 0.93rem;
    color: var(--color-text-light);
    margin-bottom: 16px;
    line-height: 1.7;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

/* ---------- FOOTER LEGAL ---------- */
.footer-legal-link {
    color: rgba(255, 255, 255, 0.6);
    transition: color var(--transition);
}

.footer-legal-link:hover {
    color: var(--color-white);
}

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

    .whatsapp-float svg {
        width: 28px;
        height: 28px;
    }

    .modal-content {
        padding: 28px 24px;
    }
}

/* ========================================
   MULTI-PAGE COMPONENTS
   ======================================== */

/* ---------- BREADCRUMBS ---------- */
.breadcrumbs {
    background: var(--color-bg-alt);
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: var(--nav-height);
}

.breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.breadcrumbs-item + .breadcrumbs-item::before {
    content: "›";
    margin-right: 4px;
    color: var(--color-secondary-light);
}

.breadcrumbs-item a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

.breadcrumbs-item a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.breadcrumbs-item--active span {
    color: var(--color-text);
    font-weight: 500;
}

/* ---------- PAGE HERO ---------- */
.page-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    padding: 80px 0 60px;
    text-align: center;
}

/* When no breadcrumbs, add top margin */
.page-hero:first-child {
    margin-top: var(--nav-height);
}

.page-hero-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    line-height: 1.2;
}

.page-hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ---------- PAGE CONTENT ---------- */
.page-content {
    padding: 60px 0;
}

.page-content h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: var(--color-text);
    text-transform: uppercase;
    margin-top: 48px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary);
    display: inline-block;
}

.page-content h2:first-child {
    margin-top: 0;
}

.page-content h3 {
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: var(--color-primary-dark);
    text-transform: uppercase;
    margin-top: 32px;
    margin-bottom: 12px;
}

.page-content p {
    color: var(--color-text-light);
    line-height: 1.8;
    margin-bottom: 16px;
    font-size: 1rem;
}

.page-content ul,
.page-content ol {
    color: var(--color-text-light);
    margin-bottom: 16px;
    padding-left: 24px;
    line-height: 1.8;
}

.page-content li {
    margin-bottom: 8px;
}

.page-content strong {
    color: var(--color-text);
}

/* ---------- CTA SECTION ---------- */
.cta-section {
    background: var(--color-bg-alt);
    padding: 60px 0;
}

.cta-box {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    color: var(--color-white);
}

.cta-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2rem);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.cta-text {
    font-size: 1.05rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn-outline {
    border-color: var(--color-white);
    color: var(--color-white);
}

.cta-buttons .btn-outline:hover {
    background: var(--color-white);
    color: var(--color-primary);
}

.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-whatsapp svg {
    width: 20px;
    height: 20px;
}

/* ---------- FAQ SECTION ---------- */
.faq-section {
    padding: 60px 0;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.faq-item:hover {
    box-shadow: var(--shadow-sm);
}

.faq-item[open] {
    box-shadow: var(--shadow-md);
}

.faq-question {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 500;
    text-transform: uppercase;
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    color: var(--color-text);
    transition: background var(--transition), color var(--transition);
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: "+";
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
    transition: transform var(--transition);
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item[open] .faq-question::after {
    content: "−";
    transform: rotate(180deg);
}

.faq-item[open] .faq-question {
    background: var(--color-primary);
    color: var(--color-white);
}

.faq-item[open] .faq-question::after {
    color: var(--color-white);
}

.faq-answer {
    padding: 20px 24px;
    background: var(--color-white);
}

.faq-answer p {
    color: var(--color-text-light);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* ---------- SERVICE CARDS GRID (for hub pages) ---------- */
.services-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.service-hub-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 32px 28px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.service-hub-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.service-hub-card h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 12px;
    border-bottom: none;
    margin-top: 0;
}

.service-hub-card p {
    color: var(--color-text-light);
    line-height: 1.6;
    font-size: 0.93rem;
}

.service-hub-card .card-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-hub-card .card-link::after {
    content: " →";
}

/* ---------- DATA STATS ROW (for nearshoring) ---------- */
.data-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.data-stat {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--color-primary);
}

.data-stat-number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    display: block;
}

.data-stat-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    display: block;
}

/* ---------- COVERAGE CITIES GRID ---------- */
.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.city-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform var(--transition), box-shadow var(--transition);
}

.city-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.city-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 8px;
    margin-top: 0;
    border-bottom: none;
}

.city-card p {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.5;
}

/* ---------- SECTORS GRID ---------- */
.sectors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

/* ---------- RESPONSIVE ADJUSTMENTS FOR MULTI-PAGE ---------- */
@media (max-width: 768px) {
    .page-hero {
        padding: 60px 0 40px;
    }

    .page-content {
        padding: 40px 0;
    }

    .cta-box {
        padding: 36px 24px;
    }

    .faq-question {
        padding: 16px 20px;
        font-size: 0.95rem;
    }

    .faq-answer {
        padding: 16px 20px;
    }

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

    .breadcrumbs {
        padding: 10px 0;
    }

    .breadcrumbs-list {
        font-size: 0.8rem;
    }
}

/* ========================================
   IMMERSIVE UI/UX ENHANCEMENTS
   ======================================== */

/* ---------- PAGE TRANSITION ---------- */
body {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

body.page-loading {
    opacity: 0;
    transform: translateY(8px);
}

/* ---------- SCROLL PROGRESS BAR ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--color-primary-light);
    z-index: 1002;
    transform-origin: left;
    transform: scaleX(0);
    transition: none;
}

/* ---------- NAV ENHANCEMENTS ---------- */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-white);
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
    left: 20%;
}

.nav-link--cta::after {
    display: none;
}

.navbar.scrolled .nav-logo-img {
    height: 32px;
    transition: height 0.3s ease;
}

/* ---------- HERO IMMERSIVE ---------- */
.hero-bg-pattern {
    background-image:
        /* Blueprint grid */
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px),
        /* Original radials */
        radial-gradient(circle at 20% 80%, rgba(255,255,255,0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.05) 0%, transparent 50%);
    background-size:
        100px 100px,
        100px 100px,
        20px 20px,
        20px 20px,
        100% 100%,
        100% 100%;
    animation: none;
}

.hero-shape {
    position: absolute;
    opacity: 0.06;
    pointer-events: none;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.hero-shape--1 {
    top: 15%;
    left: 10%;
    width: 120px;
    height: 120px;
}

.hero-shape--2 {
    top: 60%;
    right: 8%;
    width: 100px;
    height: 100px;
}

.hero-shape--3 {
    bottom: 20%;
    left: 25%;
    width: 80px;
    height: 80px;
}

/* Hero text reveal */
.hero-title {
    clip-path: inset(0 0 0 0);
    animation: heroReveal 1s ease forwards;
}

@keyframes heroReveal {
    from {
        clip-path: inset(0 100% 0 0);
        opacity: 0;
    }
    to {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

/* ---------- SCROLL ANIMATION VARIANTS ---------- */
.animate-from-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.6s ease;
}

.animate-from-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.6s ease;
}

.animate-scale {
    opacity: 0;
    transform: scale(0.92);
    transition: all 0.6s ease;
}

.animate-from-left.visible,
.animate-from-right.visible,
.animate-scale.visible {
    opacity: 1;
    transform: none;
}

/* Stagger delay for card grids */
.servicios-grid .servicio-card:nth-child(1) { transition-delay: 0s; }
.servicios-grid .servicio-card:nth-child(2) { transition-delay: 0.1s; }
.servicios-grid .servicio-card:nth-child(3) { transition-delay: 0.2s; }
.servicios-grid .servicio-card:nth-child(4) { transition-delay: 0.3s; }
.servicios-grid .servicio-card:nth-child(5) { transition-delay: 0.4s; }
.servicios-grid .servicio-card:nth-child(6) { transition-delay: 0.5s; }

.cities-grid .city-card:nth-child(1) { transition-delay: 0s; }
.cities-grid .city-card:nth-child(2) { transition-delay: 0.08s; }
.cities-grid .city-card:nth-child(3) { transition-delay: 0.16s; }
.cities-grid .city-card:nth-child(4) { transition-delay: 0.24s; }
.cities-grid .city-card:nth-child(5) { transition-delay: 0.32s; }

/* Section divider diagonal */
.section-divider {
    height: 60px;
    margin-top: -1px;
    overflow: hidden;
}

.section-divider--down {
    background: var(--color-white);
}

.section-divider--down::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    clip-path: polygon(0 0, 100% 0, 100% 0%, 0 100%);
}

/* ---------- 3D CARD TILT ---------- */
.card-3d {
    perspective: 800px;
}

.card-3d .servicio-card {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.15s ease-out, box-shadow var(--transition);
}

.card-3d .servicio-card .servicio-icon {
    transition: transform 0.3s ease;
}

.card-3d .servicio-card:hover .servicio-icon {
    transform: translateZ(20px) scale(1.1);
}

/* Gradient glow border on hover */
.servicio-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary-dark));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.servicio-card:hover::after {
    opacity: 1;
}

/* ---------- ANIMATED COUNTERS ---------- */
[data-count-target] {
    font-variant-numeric: tabular-nums;
}

/* ---------- CTA BUTTON ENHANCEMENTS ---------- */
.btn {
    position: relative;
    overflow: hidden;
}

/* Shine/shimmer effect */
.btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transform: skewX(-25deg);
    transition: left 0.6s ease;
    pointer-events: none;
}

.btn:hover::after {
    left: 125%;
}

/* Ripple effect */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: rippleExpand 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes rippleExpand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* CTA box gradient border */
.cta-box {
    position: relative;
}

.cta-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent, rgba(255,255,255,0.15));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* ---------- TEXTURE & DEPTH ---------- */
.nosotros::before,
.nearshoring-preview::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

.nosotros,
.nearshoring-preview {
    position: relative;
}

.nosotros > .container,
.nearshoring-preview > .container {
    position: relative;
    z-index: 1;
}

/* Enhanced shadows with blue tint */
.servicio-card:hover {
    box-shadow: 0 8px 40px rgba(0, 77, 167, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.stat-card:hover {
    box-shadow: 0 4px 20px rgba(0, 77, 167, 0.1);
}

.service-hub-card:hover {
    box-shadow: 0 8px 30px rgba(0, 77, 167, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Nearshoring gradient mesh */
.nearshoring-preview {
    background: linear-gradient(135deg, var(--color-bg) 0%, #e8edf5 50%, var(--color-bg) 100%);
}

/* ---------- FAQ SMOOTH HEIGHT ---------- */
.faq-answer-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.faq-item[open] .faq-answer-wrapper {
    grid-template-rows: 1fr;
}

.faq-answer-wrapper > .faq-answer {
    overflow: hidden;
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
    body,
    .scroll-progress,
    .hero-title,
    .animate-on-scroll,
    .animate-from-left,
    .animate-from-right,
    .animate-scale,
    .servicio-card,
    .btn::after,
    .faq-answer-wrapper {
        transition: none !important;
        animation: none !important;
    }

    body.page-loading {
        opacity: 1;
        transform: none;
    }

    .animate-on-scroll,
    .animate-from-left,
    .animate-from-right,
    .animate-scale {
        opacity: 1;
        transform: none;
    }

    .hero-title {
        clip-path: none;
        opacity: 1;
    }
}

/* ---------- RESPONSIVE IMMERSIVE ---------- */
@media (max-width: 768px) {
    .hero-shape {
        display: none;
    }

    .section-divider {
        height: 40px;
    }

    .scroll-progress {
        height: 2px;
    }
}
