:root {
    /* Colors */
    --primary: #0072BC;
    --primary-dark: #005a96;
    --primary-light: #e0f2fe;
    --accent: #F78F1E; /* Exact Logo Orange */
    --gradient: linear-gradient(135deg, #0072BC 0%, #F78F1E 100%);
    --bg-dark: #09090b;
    --bg-card: #18181b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Spacing */
    --container: 1200px;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* evita scroll horizontal en cualquier viewport */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Reusable Components */
.btn-primary {
    background: var(--gradient);
    color: var(--white);
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(247, 143, 30, 0.3);
}

.btn-secondary {
    background: var(--glass);
    color: var(--white);
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    display: inline-block;
}

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

.badge {
    background: rgba(51, 143, 199, 0.1);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(51, 143, 199, 0.2);
}

.section-subtitle {
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Header */
.main-header {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 1200px;
    z-index: 1000;
    padding: 0.8rem 1.5rem;
    background: rgba(20, 20, 23, 0.7);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    transition: var(--transition);
}

.main-header.menu-open {
    /* pill shape is kept; dropdown is now fixed/detached */
}

.main-header.scrolled {
    /* NO forzamos width aquí; los valores de left/right del breakpoint ya lo controlan */
    padding: 0.6rem 1.5rem;
    background: rgba(12, 12, 14, 0.9);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;        /* permite que el logo ceda espacio si es necesario */
    overflow: hidden;
}

.logo img {
    height: 32px;
    width: auto;
    flex-shrink: 0;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.desktop-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-login {
    font-size: 0.75rem !important;
    opacity: 0.6;
    margin-right: 0.5rem;
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    /* Ensure adequate tap target on mobile */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-login:hover {
    opacity: 1;
}

.mobile-actions {
    display: none;
    flex-shrink: 0;   /* nunca se comprime */
    align-items: center;
    gap: 0.8rem;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 36px;
    min-height: 36px;
}

/* Dropdown Mobile Nav — fixed, full-viewport-width */
.mobile-dropdown {
    display: none;
    flex-direction: column;
    padding: 1.2rem 1.8rem 2rem;
    background: rgba(10, 10, 13, 0.97);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    position: fixed;
    top: 72px;   /* header top(10px) + header height (~62px) */
    left: 0;
    right: 0;    /* usar left+right en lugar de width:100vw evita el overflow en iOS */
    z-index: 999;
    border-radius: 0 0 28px 28px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow-x: hidden;
}

.mobile-dropdown.active {
    display: flex;
    animation: dropdownSlide 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mobile-dropdown nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.mobile-dropdown .mobile-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.4px;
    transition: var(--transition);
    /* large tap target */
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
}

.mobile-dropdown .mobile-link:last-of-type {
    border-bottom: none;
}

.mobile-dropdown .mobile-link:active,
.mobile-dropdown .mobile-link:hover {
    color: var(--primary);
    padding-left: 2rem;
    background: rgba(255, 255, 255, 0.03);
}

.mobile-dropdown .btn-cta-mobile {
    display: block;
    background: var(--white);
    color: #000;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-top: 1.4rem;
    transition: var(--transition);
}

.mobile-dropdown .btn-cta-mobile:hover {
    background: var(--accent);
    color: #000;
}

@media (min-width: 1025px) {
    .mobile-dropdown,
    .mobile-dropdown.active {
        display: none !important;
    }
}

.mobile-nav-overlay.active {
    transform: translateX(-100%);
}

.mobile-nav-content nav {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
}

.mobile-nav-content a {
    font-size: 2rem;
    color: var(--white);
    text-decoration: none;
    font-weight: 800;
}

.close-menu {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
}

.btn-cta {
    background: var(--white);
    color: #000 !important;
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
}

.btn-cta:hover {
    transform: scale(1.05);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 800px;
    display: flex;
    align-items: flex-end;   /* content anchored to bottom */
    padding-bottom: 6rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.hero-bg .overlay {
    position: absolute;
    inset: 0;
    /*
     * Gradiente de abajo hacia arriba:
     * - Bottom: #0c0c0e sólido (mismo color que la sección 'Nuestra Filosofía')
     *   -> la imagen "emerge" del fondo con transición continua
     * - Middle: semi-transparente (zona del texto / descripción)
     * - Top: transparente (imagen nítida en la parte superior)
     */
    background: linear-gradient(
        to top,
        rgba(12, 12, 14, 1.0)  0%,
        rgba(12, 12, 14, 0.80) 30%,
        rgba(12, 12, 14, 0.25) 60%,
        rgba(12, 12, 14, 0.0)  100%
    );
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    font-size: 5rem;
    line-height: 0.95;
    margin-bottom: 2rem;
    font-weight: 800;
    letter-spacing: -2px;
}

.hero h1 .highlight {
    display: block;
    color: var(--white);
    opacity: 0.7;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 500px;
    line-height: 1.5;
    margin-left: auto;
    margin-right: auto;
}

.hero-btns {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.btn-hero-main {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--white);
    padding: 1.2rem 2.5rem;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: var(--transition);
    border: none;
    box-shadow: 0 8px 24px rgba(0, 114, 188, 0.35);
}

.btn-hero-main:hover {
    filter: brightness(1.15);
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(247, 143, 30, 0.4);
}

/* Trust Bar */
.trust-bar {
    background: var(--bg-card);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    padding: 3rem 0;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.icon-box {
    width: 60px;
    height: 60px;
    background: rgba(51, 143, 199, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.trust-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.trust-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* About Section */
.about {
    padding: 8rem 0;
}

.about-grid, .about-v2-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
}

.about-v2-grid {
    gap: 6rem;
}

.section-title-v2 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.accent-text {
    color: var(--accent);
}

.about h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.about p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.philosophy-box {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 24px;
    position: relative;
}

.quote-icon {
    color: var(--primary);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.philosophy-box h3 {
    margin-bottom: 0.8rem;
}

.quote-author {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
    color: var(--primary);
}

.image-wrapper {
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.image-wrapper img {
    width: 100%;
    display: block;
}

.stats-overlay {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    background: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.stat {
    text-align: center;
}

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

.stat .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.strengths {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.strength-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.strength-item i {
    color: var(--primary);
    width: 20px;
}

/* Projects Section (Reference based) */
.projects-section {
    padding: 10rem 0;
    background: var(--bg-dark);
}

.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 4rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    no-scrollbar: true;
}

.filter-btn {
    background: #1c1c1f;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 0.8rem 1.5rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.filter-btn.active {
    background: var(--white);
    color: #000;
}

.project-card-v2 {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    background: #141417;
    border-radius: 40px;
    overflow: hidden;
    margin-bottom: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: var(--transition);
}

.project-card-v2:nth-child(even) {
    grid-template-columns: 1.2fr 1fr;
}

.project-card-v2:nth-child(even) .project-info-v2 {
    order: 2;
}

.project-card-v2:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.1);
}

.project-info-v2 {
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-category {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.project-info-v2 h3 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.project-info-v2 p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    font-size: 1rem;
    line-height: 1.6;
}

.project-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.detail-v2 span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.detail-v2 strong {
    font-size: 1rem;
    color: var(--white);
}

.project-img-v2 {
    width: 100%;
    height: 100%;
    min-height: 400px;
    overflow: hidden;
}

.project-img-v2 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card-v2:hover img {
    transform: scale(1.05);
}

/* Services (Minimalist) */
.services {
    padding: 10rem 0;
    background: #0c0c0e;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.service-card {
    background: #141417;
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 3rem;
    border-radius: 40px;
    transition: var(--transition);
}

.service-card:hover {
    border-color: var(--accent);
    transform: translateY(-10px);
}

.service-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.service-card ul {
    list-style: none;
    margin-bottom: 0;
}

.service-card li {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* FAQ Section */
.faq {
    padding: 8rem 0;
}

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

.faq-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.faq-cta {
    margin-top: 3rem;
}

.btn-text {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 1.5rem;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question i {
    transition: var(--transition);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
    color: var(--primary);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease;
}

.faq-item.active .faq-answer {
    padding-bottom: 1.5rem;
    max-height: 1000px;
}

.faq-answer p {
    color: var(--text-muted);
}

/* Contact Section */
.contact {
    padding-bottom: 8rem;
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    box-shadow: 0 50px 100px rgba(0,0,0,0.5);
}

.contact-info {
    padding: 4rem;
    background: linear-gradient(135deg, var(--primary) 0%, #1e5a7d 100%);
    color: var(--white);
}

.contact-info h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.contact-info p {
    margin-bottom: 3rem;
    opacity: 0.9;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-form {
    padding: 4rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.form-group input, .form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--white);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.btn-primary.block {
    width: 100%;
}

/* Footer */
.main-footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--glass-border);
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.footer-brand img {
    height: 30px;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-muted);
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary);
}



/* Projects Carousel */
.projects-carousel {
    padding: 8rem 0;
    background: #09090b;
    overflow: hidden;
}

.carousel-container {
    width: 100%;
    position: relative;
    padding: 2rem 0;
}

.carousel-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 2rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
    min-height: 280px;
    align-items: center;
}

.carousel-track::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.carousel-item {
    flex: 0 0 350px;
    height: 250px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    position: relative;
}

.carousel-item:hover {
    transform: scale(1.03);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.carousel-item:hover .carousel-overlay {
    opacity: 1;
}

.carousel-overlay i {
    color: var(--white);
    background: var(--primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--white);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2rem;
}

/* ============================================================
   KAIZEN CAPSULE GALLERY CAROUSEL (Inspiración de Lujo)
   ============================================================ */
.gallery-section {
    position: relative;
    padding: 7rem 0 9rem;
    /* Degradado fluido que inicia en el fondo oscuro de "Nuestros Proyectos" y se sumerge en el azul Kaizen */
    background: linear-gradient(180deg, 
        #09090b 0%, 
        rgba(0, 114, 188, 0.12) 12%, 
        rgba(0, 114, 188, 0.28) 35%, 
        rgba(0, 114, 188, 0.22) 65%, 
        rgba(9, 9, 11, 0.88) 90%, 
        #09090b 100%
    );
    overflow: hidden;
}

/* Aura de iluminación azul atmosférica centrada en el carrusel */
.gallery-section::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1350px, 95vw);
    height: 650px;
    background: radial-gradient(ellipse at 50% 35%, rgba(0, 114, 188, 0.38) 0%, rgba(0, 114, 188, 0.14) 50%, transparent 75%);
    filter: blur(75px);
    pointer-events: none;
    z-index: 0;
}

/* Línea de división y fusión lumínica superior entre "Nuestros Proyectos" y "Galería" */
.gallery-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 114, 188, 0.2) 15%, 
        rgba(0, 114, 188, 0.75) 45%, 
        rgba(247, 143, 30, 0.6) 50%, 
        rgba(0, 114, 188, 0.75) 55%, 
        rgba(0, 114, 188, 0.2) 85%, 
        transparent 100%
    );
    box-shadow: 0 0 16px rgba(0, 114, 188, 0.6);
    z-index: 1;
}

.gallery-section .container {
    position: relative;
    z-index: 2;
}

.gallery-section .section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 3.5rem;
}

.gallery-section .section-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.gallery-section .gallery-main-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.gallery-section .gallery-desc {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Panoramic Carousel Stage Wrapper (Expands across full desktop width) */
.capsule-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 1rem 0 2rem;
    z-index: 2;
}

.capsule-carousel-container {
    position: relative;
    width: 100%;
    max-width: 1720px; /* Expansión amplia para monitores de escritorio */
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
}

.capsule-carousel-stage {
    position: relative;
    width: 100%;
    height: 490px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.8rem;
}

/* Each morphing slide */
.capsule-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
    cursor: pointer;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                width 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                height 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                border-radius 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.4s ease;
    will-change: transform, width, height, border-radius, opacity;
}

.capsule-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
    pointer-events: none;
}

.capsule-slide:hover img {
    transform: scale(1.06);
}

.capsule-slide:hover {
    border-color: rgba(247, 143, 30, 0.5);
}

/* Center active card */
.capsule-slide.is-center {
    cursor: zoom-in;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* Pill Badge on Center Card - Identical to inspiration image */
.capsule-badge {
    position: absolute;
    bottom: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #0f172a;
    padding: 10px 22px;
    border-radius: 9999px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
    pointer-events: auto;
    transition: opacity 0.4s ease, transform 0.4s ease, background 0.3s ease;
}

.capsule-badge:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.capsule-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
}

.capsule-badge-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

/* Arrow Navigation Buttons */
.capsule-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 35;
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.capsule-nav-btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 10px 25px rgba(247, 143, 30, 0.5);
}

.capsule-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.capsule-nav-btn.prev-btn {
    left: 6px;
}

.capsule-nav-btn.next-btn {
    right: 6px;
}

/* Bottom Dots Indicators */
.capsule-indicators {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1rem;
    z-index: 25;
}

.capsule-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.22);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.capsule-dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.capsule-dot.active {
    width: 32px;
    background: var(--accent);
    box-shadow: 0 0 14px rgba(247, 143, 30, 0.6);
}

@media (max-width: 1024px) {
    .desktop-nav { display: none; }
    .mobile-actions {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        flex-shrink: 0;
    }

    /* Header pill: margen visible en tablets */
    .main-header {
        left: 1rem;
        right: 1rem;
        width: auto;
        transform: none;
    }

    .hero h1 { font-size: 2.8rem; }
    .about-grid, .about-v2-grid, .faq-grid, .contact-card { gap: 3rem; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .project-card-v2 { grid-template-columns: 1fr; }
    .project-card-v2:nth-child(even) { grid-template-columns: 1fr; }
    .project-card-v2:nth-child(even) .project-info-v2 { order: 1; }
    .project-info-v2 { padding: 3rem; }
    .project-img-v2 { min-height: 300px; }
    .section-title-v2 { font-size: 2.8rem; }
    .capsule-carousel-stage { height: 410px; }
    .capsule-nav-btn { width: 44px; height: 44px; }
}

@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .mobile-menu-toggle { display: flex; }

    /* Header pill ajustado para móvil */
    .main-header {
        top: 10px;
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        transform: none;
        padding: 0.65rem 1.1rem;
    }

    /* Nombre de marca más pequeño en pantallas muy estrechas */
    .brand-name {
        font-size: 0.95rem;
    }
    
    .hero {
        height: auto;
        padding: 8rem 0 4rem;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-btns {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.8rem;
    }
    
    .hero-bg .overlay {
        /* En móvil también: oscuro desde abajo, imagen visible arriba */
        background: linear-gradient(
            to top,
            rgba(9, 9, 11, 0.97) 0%,
            rgba(9, 9, 11, 0.80) 40%,
            rgba(9, 9, 11, 0.20) 70%,
            rgba(9, 9, 11, 0.0)  100%
        );
    }

    .trust-grid { grid-template-columns: 1fr; }
    .about-grid, .about-v2-grid, .services-grid, .faq-grid, .contact-card { grid-template-columns: 1fr; }
    
    .about-image { order: -1; }
    .contact-info, .contact-form { padding: 2.5rem; }
    
    .footer-top { flex-direction: column; gap: 2rem; }
    .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }

    .section-title-v2 { font-size: 2.2rem; }
    .project-info-v2 { padding: 2rem; }
    
    /* Stats mobile layout */
    .about-v2 .stat-v2 { margin-bottom: 1rem; }
    
    /* Hero container fix for horizontal scroll */
    .hero-content {
        padding-left: 0;
        margin: 0 auto;
    }

    /* Capsule carousel adjustments for mobile */
    .capsule-carousel-stage {
        height: 330px;
        margin-bottom: 1.2rem;
    }
    .capsule-badge {
        bottom: 14px;
        right: 14px;
        padding: 6px 14px;
        font-size: 0.8rem;
    }
    .capsule-badge-text {
        max-width: 140px;
    }
    .capsule-nav-btn {
        width: 38px;
        height: 38px;
        opacity: 0.9;
    }
    .capsule-nav-btn.prev-btn { left: 0px; }
    .capsule-nav-btn.next-btn { right: 0px; }
}
