/* ============================================
   ELEFANTE LAB - Clean Mobile-First CSS
   ============================================ */

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

:root {
    --primary: #FF6B6B;
    --secondary: #1D3557;
    --background: #FFFFFF;
    --surface: #F6F6F6;
    --bg-light: #F6F6F6;
    --text: #1A1A1A;
    --text-light: #666666;
    --border: #E0E0E0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

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

/* ============================================
   CONTAINER
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
    background: var(--primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    /* iOS notch / safe-area support */
    padding-top: max(env(safe-area-inset-top, 0px), 1rem);
}

.nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.nav ul li a:hover,
.nav ul li a.active {
    background: rgba(255, 255, 255, 0.2);
}

.nav-logo {
    margin-right: auto;
}

.nav-logo a {
    display: flex;
    align-items: center;
}

.nav-logo img {
    height: 40px;
    width: 40px;
    object-fit: contain;
    border-radius: 6px;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.75rem;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 200;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-menu a {
    display: block;
    color: var(--text) !important;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.dropdown-menu a:hover {
    background: var(--surface);
    color: var(--primary) !important;
}

/* Nav brand (standalone logo link, visible on mobile) */
.nav-brand {
    display: none;
    align-items: center;
    position: relative;
    z-index: 101;
}

.nav-brand img {
    height: 36px;
    width: 36px;
    object-fit: contain;
    border-radius: 6px;
}

/* Hamburger button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    gap: 5px;
    padding: 0;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Dropdown active state (JS-driven) — desktop */
.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   MOBILE NAV  (≤ 768 px)
   ============================================ */
@media (max-width: 768px) {

    /* Nav bar stays on top of everything */
    .nav {
        z-index: 1000;
    }

    .nav .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    /* Standalone logo — always visible in the bar */
    .nav-brand {
        display: flex;
        flex-shrink: 0;
        z-index: 1001;
        position: relative;
    }

    /* Hamburger always visible */
    .mobile-menu-toggle {
        display: flex;
        flex-shrink: 0;
        z-index: 1001;
        position: relative;
    }

    /* Full-screen overlay menu — hidden by default */
    .nav ul {
        display: none;
        position: fixed;
        inset: 0;                       /* top/right/bottom/left: 0 */
        background: var(--primary);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0;
        padding: 80px 1.5rem 2rem;      /* 80 px = nav bar height */
        z-index: 999;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0;
    }

    .nav ul.nav-open {
        display: flex;
    }

    /* Hide the logo <li> inside the overlay */
    .nav ul .nav-logo {
        display: none !important;
    }

    /* Each nav item full width */
    .nav ul li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.12);
    }

    .nav ul li:last-child {
        border-bottom: none;
    }

    .nav ul li a {
        font-size: 1rem;
        font-weight: 600;
        padding: 0.9rem 0.25rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: none;            /* border is on the <li> */
        white-space: normal;
        color: white;
    }

    .nav ul li a.active {
        background: transparent;
        color: rgba(255,255,255,0.7);
    }

    /* ── Dropdown inside overlay ─────────────────────── */
    .dropdown {
        width: 100%;
    }

    /* Arrow indicator on the toggle */
    .dropdown-toggle::after {
        content: '›';
        display: inline-block;
        font-size: 1.3rem;
        line-height: 1;
        margin-left: auto;
        padding-left: 0.75rem;
        transition: transform 0.25s ease;
        color: rgba(255,255,255,0.7);
    }

    .dropdown.active .dropdown-toggle::after {
        transform: rotate(90deg);
    }

    /* Sub-menu panel */
    .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        box-shadow: none !important;
        background: rgba(0,0,0,0.15);
        border-radius: 10px;
        padding: 0.25rem 0 0.25rem 0.75rem;
        margin: 0 0 0.5rem;
        min-width: unset;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        display: block !important;       /* always in DOM, height controls visibility */
    }

    .dropdown.active .dropdown-menu {
        max-height: 500px;
        padding: 0.5rem 0 0.5rem 0.75rem;
    }

    .dropdown-menu a {
        color: rgba(255,255,255,0.9) !important;
        font-size: 0.9rem;
        font-weight: 500;
        padding: 0.65rem 0.75rem;
        border-radius: 6px;
        border-bottom: 1px solid rgba(255,255,255,0.08) !important;
        display: block;
    }

    .dropdown-menu a:last-child {
        border-bottom: none !important;
    }

    .dropdown-menu a:hover,
    .dropdown-menu a:active {
        background: rgba(255,255,255,0.12);
        color: white !important;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #FF8A80 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .hero {
        padding: 5rem 0;
    }
    .hero h1 {
        font-size: 2.8rem;
    }
    .hero p {
        font-size: 1.2rem;
    }
}

@media (min-width: 1024px) {
    .hero h1 {
        font-size: 3.2rem;
    }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    background: white;
    color: var(--primary);
    padding: 0.9rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-submit {
    display: block;
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 0.9rem 2rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    margin-top: 0.5rem;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.section-image {
    width: 100%;
    max-width: 800px;
    margin: 3rem auto 0;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

@media (min-width: 768px) {
    .section {
        padding: 5rem 0;
    }
    .section-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .section-title {
        font-size: 2.2rem;
    }
}

/* ============================================
   INTRO SECTION (image + stats)
   ============================================ */
.intro-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

.intro-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.intro-text {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 700px;
}

.section-title + .intro-text,
.trust-section .intro-text {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.intro-image img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

@media (min-width: 768px) {
    .intro-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
    .intro-content h2 {
        font-size: 2rem;
    }
    .stat-number {
        font-size: 2.5rem;
    }
}

/* ============================================
   SOLUTIONS GRID (7 cards)
   ============================================ */
.solutions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.solution-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.solution-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.solution-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.75rem;
}

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

.solution-card-full {
    background: linear-gradient(135deg, var(--primary) 0%, #FF8A80 100%);
    color: white;
    border: none;
}

.solution-card-full h3,
.solution-card-full p {
    color: white;
}

@media (min-width: 640px) {
    .solutions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .solution-card-full {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1024px) {
    .solutions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .solution-card-full {
        grid-column: 1 / -1;
    }
}

/* ============================================
   TRUST SECTION
   ============================================ */
.trust-section {
    background: var(--surface);
    padding: 3rem 0;
}

.trust-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.trust-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.trust-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.trust-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #F3F0FF;
    border-radius: 16px;
    margin: 0 auto 1.25rem;
    color: #7C3AED;
    transition: background 0.25s ease, transform 0.25s ease;
}
.trust-card:hover .trust-icon { transform: scale(1.1); }
.trust-icon svg { width: 28px; height: 28px; }

/* Colour variants – trust icons */
.trust-icon--coral  { background: #FFF0F0; color: #E05252; }
.trust-icon--rose   { background: #FFF0F6; color: #DB2777; }
.trust-icon--violet { background: #F3F0FF; color: #7C3AED; }
.trust-icon--amber  { background: #FFFBEB; color: #D97706; }
.trust-icon--teal   { background: #ECFDF5; color: #059669; }
.trust-icon--indigo { background: #EEF2FF; color: #4F46E5; }
.trust-icon--slate  { background: #F1F5F9; color: #475569; }

.trust-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.trust-description {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
}

@media (min-width: 640px) {
    .trust-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .trust-section {
        padding: 5rem 0;
    }
}

@media (min-width: 1024px) {
    .trust-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   EVERYTHING IS POSSIBLE SECTION
   ============================================ */
.everything-section {
    padding: 3rem 0;
    background: white;
}

.everything-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 2rem;
}

.everything-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.everything-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.everything-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #F3F0FF;
    border-radius: 14px;
    margin-bottom: 1rem;
    color: #7C3AED;
    transition: background 0.25s ease, transform 0.25s ease;
}
.everything-card:hover .card-icon { transform: scale(1.08); }

/* Colour variants – card icons */
.card-icon--violet { background: #F3F0FF; color: #7C3AED; }
.card-icon--amber  { background: #FFFBEB; color: #D97706; }
.card-icon--teal   { background: #ECFDF5; color: #059669; }
.card-icon--coral  { background: #FFF0F0; color: #E05252; }
.card-icon--indigo { background: #EEF2FF; color: #4F46E5; }
.card-icon--slate  { background: #F1F5F9; color: #475569; }

.card-icon svg {
    width: 26px;
    height: 26px;
}

.everything-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

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

.card-accent {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.everything-card:hover .card-accent {
    transform: scaleX(1);
}

@media (min-width: 640px) {
    .everything-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .everything-title {
        font-size: 2.2rem;
    }
    .everything-section {
        padding: 5rem 0;
    }
}

@media (min-width: 1024px) {
    .everything-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .everything-title {
        font-size: 2.5rem;
    }
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
    background: var(--secondary);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: white;
}

.cta-section p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .cta-section {
        padding: 5rem 0;
    }
    .cta-section h2 {
        font-size: 2rem;
    }
    .cta-section p {
        font-size: 1.2rem;
    }
}

/* ============================================
   SERVICES GRID (como-trabajamos, porque-elefante, casos)
   ============================================ */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.service-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.75rem;
}

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

.service-card ul {
    margin-left: 1rem;
}

.service-card ul li {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.8;
}

@media (min-width: 640px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: #1A1A1A;
    color: #ccc;
    padding: 3rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

.footer-info {
    order: 2;
}

.footer-form-container {
    order: 1;
}

.footer-brand {
    margin-bottom: 2rem;
}

.footer-logo img {
    height: 56px;
    width: 56px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.footer-slogan {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.footer-description {
    color: #ccc;
    line-height: 1.6;
    font-size: 0.9rem;
}

.footer-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    line-height: 2;
}

.footer-column ul li a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.footer-column ul li a:hover {
    color: var(--primary);
}

.footer-column .office {
    margin-bottom: 1.25rem;
}

.footer-column .office h5 {
    color: var(--primary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.footer-column .office p {
    color: #ccc;
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-badges {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-badge {
    height: 60px;
    width: auto;
}

.footer-copyright {
    border-top: 1px solid #333;
    padding-top: 1.5rem;
}

.footer-copyright p {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.footer-form-container {
    background: #2A2A2A;
    padding: 2rem;
    border-radius: 12px;
}

.footer-form-container h3 {
    color: white;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.footer-form-container > p {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    background: #3A3A3A;
    border: 1px solid #4A4A4A;
    border-radius: 6px;
    padding: 0.75rem;
    color: white;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

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

.contact-form select {
    appearance: auto;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #ccc;
    font-size: 0.8rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: auto;
}

@media (min-width: 640px) {
    .footer-columns {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 768px) {
    .footer {
        padding: 4rem 0 2rem;
    }
    .footer-grid {
        grid-template-columns: 1fr 400px;
        gap: 4rem;
    }
    .footer-info {
        order: 1;
    }
    .footer-form-container {
        order: 2;
    }
    .footer-badge {
        height: 75px;
    }
}

/* ============================================
   INLINE STYLE OVERRIDES FOR MOBILE
   ============================================ */
@media (max-width: 767px) {
    [style*="grid-template-columns: 1fr 420px"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    [style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    /* Fix caso study alternating layouts */
    [style*="gap: 4rem"][style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    /* Reset order on mobile so image always appears after text */
    [style*="order: 1"],
    [style*="order: 2"] {
        order: 0 !important;
    }
    .section [style*="display: grid"][style*="gap: 4rem"] {
        gap: 2rem !important;
        margin-bottom: 3rem !important;
    }
    .section [style*="display: grid"][style*="gap: 3rem"] {
        gap: 2rem !important;
    }
    /* Footer inline grid */
    [style*="grid-template-columns: 1fr 420px"],
    [style*="grid-template-columns: 1fr 400px"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

@media (max-width: 480px) {
    [style*="padding: 28px"] {
        padding: 1.25rem !important;
    }
    [style*="margin-bottom: 6rem"] {
        margin-bottom: 3rem !important;
    }
    [style*="font-size: 2rem"][style*="color: var(--secondary)"] {
        font-size: 1.5rem !important;
    }
    [style*="font-size: 1.1rem"][style*="color: var(--primary)"] {
        font-size: 1rem !important;
    }
}

/* ============================================
   SOLUTION HERO (sub-pages)
   ============================================ */
.solution-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #FF8A80 100%);
    color: white;
    text-align: center;
    padding: 3rem 0;
}

.solution-hero h1 {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.solution-hero p {
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

@media (min-width: 768px) {
    .solution-hero {
        padding: 6rem 0 4rem;
    }
    .solution-hero h1 {
        font-size: 3rem;
    }
    .solution-hero p {
        font-size: 1.2rem;
    }
}

/* ============================================
   TARGET SECTION (sub-pages)
   ============================================ */
.target-section {
    background: var(--surface);
    padding: 3rem 0;
}

.target-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.target-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.target-card .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #FFF0F0;
    border-radius: 14px;
    margin: 0 auto 1rem;
}

.target-card .icon svg {
    width: 28px;
    height: 28px;
}

.target-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

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

@media (min-width: 640px) {
    .target-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .target-section {
        padding: 4rem 0;
    }
}

@media (min-width: 1024px) {
    .target-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   COMO TRABAJAMOS: span 2 for last card
   ============================================ */
@media (max-width: 639px) {
    .service-card[style*="grid-column: span 2"] {
        grid-column: span 1 !important;
    }
    .service-card ul[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   TABLE STYLES (porque-elefante comparison)
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
}

@media (max-width: 640px) {
    table {
        font-size: 0.8rem;
    }
    table th,
    table td {
        padding: 0.75rem 0.5rem !important;
    }
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 {
    font-weight: 800;
    line-height: 1.2;
}

h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 1rem;
}

h3 {
    font-weight: 700;
    color: var(--secondary);
}

@media (min-width: 768px) {
    h2 {
        font-size: 2rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.6s ease-out;
}

.trust-card:hover .trust-icon {
    animation: pulse 2s infinite;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================
   TECH STACK SECTION
   ============================================ */

.tech-section {
    padding: 4rem 0 5rem;
    background: var(--bg-light);
    overflow: hidden;
}

/* ── Marquee / ticker ─────────────────────────────────────────── */
.tech-marquee-wrap {
    overflow: hidden;
    margin: 0 -1rem 3rem;
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.tech-marquee {
    display: flex;
    gap: 0;
    width: max-content;
    animation: marquee-scroll 28s linear infinite;
}

.tech-marquee span {
    display: inline-block;
    padding: 0.45rem 1.25rem;
    margin: 0 0.35rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--secondary);
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: background 0.2s, color 0.2s;
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .tech-marquee { animation: none; }
}

/* ── Grid de categorías ───────────────────────────────────────── */
.tech-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px)  { .tech-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tech-grid { grid-template-columns: repeat(3, 1fr); } }

.tech-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 1.75rem 1.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tech-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(0,0,0,0.09);
}

.tech-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.1rem;
}

.tech-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
}

.tech-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* colour variants reuse trust-icon palette */
.tech-icon--blue   { background: #EFF6FF; color: #2563EB; }
.tech-icon--violet { background: #F3F0FF; color: #7C3AED; }
.tech-icon--teal   { background: #ECFDF5; color: #059669; }
.tech-icon--amber  { background: #FFFBEB; color: #D97706; }
.tech-icon--coral  { background: #FFF0F0; color: #E05252; }
.tech-icon--indigo { background: #EEF2FF; color: #4F46E5; }

/* ── Tags ─────────────────────────────────────────────────────── */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    display: inline-block;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.tag--blue   { background: #EFF6FF; color: #1D4ED8; }
.tag--violet { background: #F3F0FF; color: #6D28D9; }
.tag--teal   { background: #ECFDF5; color: #047857; }
.tag--amber  { background: #FFFBEB; color: #B45309; }
.tag--coral  { background: #FFF0F0; color: #C53030; }
.tag--indigo { background: #EEF2FF; color: #4338CA; }

/* ============================================
   CASOS DE ÉXITO — case-block cards
   ============================================ */

/* ── Hero stats bar ── */
.hero-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    padding: 0.35rem 1rem;
    border-radius: 999px;
    margin-bottom: 1.2rem;
    border: 1px solid rgba(255,255,255,0.25);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.hero-stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.02em;
}

/* ── Section header ── */
.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1rem;
    margin: 0;
}

/* ── Casos common section ── */
.casos-common {
    background: var(--surface);
}

/* ── CTA section ── */
.casos-cta {
    background: var(--secondary);
    color: white;
    text-align: center;
    padding: 5rem 0;
}

.casos-cta h2 {
    color: white;
    margin-bottom: 1rem;
}

.casos-cta p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.btn--white {
    background: #fff;
    color: var(--secondary);
}

.btn--white:hover {
    background: rgba(255,255,255,0.9);
    color: var(--secondary);
}

/* ── Footer inner grid ── */
.footer-inner {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 60px;
    align-items: start;
}

@media (max-width: 900px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}

@media (max-width: 600px) {
    .hero-stats {
        gap: 1.5rem;
    }

    .hero-stat-num {
        font-size: 1.6rem;
    }

    .casos-cta {
        padding: 3.5rem 0;
    }

    .casos-cta p {
        font-size: 0.95rem;
    }
}

.case-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 5rem;
    padding-bottom: 5rem;
    border-bottom: 1px solid var(--border, #eee);
}

.case-block:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.case-block--reverse .case-visual { order: 2; }
.case-block--reverse .case-content { order: 1; }

/* ── Visual column ── */
.case-visual {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
}

.case-visual img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.case-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,107,107,0.15) 0%, transparent 60%);
    pointer-events: none;
}

.case-visual:hover img {
    transform: scale(1.03);
}

.case-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    z-index: 3;
    backdrop-filter: blur(4px);
}

/* ── Content column ── */
.case-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(255,107,107,0.08);
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    margin-bottom: 1rem;
}

.case-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 0.4rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.case-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.case-description {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.75;
    margin-bottom: 1.6rem;
}

/* ── Results grid ── */
.case-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    background: var(--surface);
    border-left: 4px solid var(--primary);
    border-radius: 0 12px 12px 0;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1.4rem;
}

.case-result-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding-right: 1rem;
    border-right: 1px solid var(--border, #e2e8f0);
}

.case-result-item:last-child {
    border-right: none;
    padding-right: 0;
    padding-left: 1rem;
}

.case-result-item:nth-child(2) {
    padding: 0 1rem;
}

.case-result-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    white-space: nowrap;
}

.case-result-label {
    font-size: 0.75rem;
    color: var(--text-light);
    line-height: 1.35;
}

/* ── Tech tags ── */
.case-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.case-tech span {
    font-size: 0.73rem;
    font-weight: 600;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338CA;
    border: 1px solid #c7d2fe;
    transition: background 0.2s, color 0.2s;
}

.case-tech span:hover {
    background: #4338CA;
    color: #fff;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .case-block {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 3rem;
        padding-bottom: 3rem;
    }

    /* On mobile: text first, image second (always) */
    .case-block .case-visual        { order: 2; margin-top: 1.4rem; }
    .case-block .case-content       { order: 1; }
    .case-block--reverse .case-visual { order: 2; }
    .case-block--reverse .case-content { order: 1; }

    .case-visual {
        border-radius: 14px;
    }

    .case-visual img {
        aspect-ratio: 16 / 9;
    }

    .case-title {
        font-size: 1.75rem;
    }

    .case-subtitle {
        font-size: 0.95rem;
    }

    .case-description {
        font-size: 0.9rem;
    }

    .case-results {
        grid-template-columns: repeat(3, 1fr);
        padding: 1rem;
        gap: 0;
    }

    .case-result-item {
        padding-right: 0.6rem;
    }

    .case-result-item:nth-child(2) {
        padding: 0 0.6rem;
    }

    .case-result-item:last-child {
        padding-left: 0.6rem;
    }

    .case-result-num {
        font-size: 1.15rem;
    }

    .case-result-label {
        font-size: 0.68rem;
    }
}

/* ============================================
   SCROLL REVEAL
   ============================================ */

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal--visible {
    opacity: 1;
    transform: none;
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ============================================
   SCROLL-TO-TOP BUTTON
   ============================================ */

.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.45);
    opacity: 0;
    transform: translateY(12px) scale(0.85);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
    pointer-events: none;
    z-index: 9000;
}

.scroll-top-btn--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.scroll-top-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px) scale(1.05);
}

.scroll-top-btn:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .scroll-top-btn {
        bottom: 1.25rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .nav,
    .footer,
    .cta-section {
        display: none;
    }
    body {
        color: black;
        background: white;
    }
}
