/* ===== PROYECTOS CSS ===== */

* {
    font-family: var(--font-primary);
}

/* ===== NAVEGACIÓN BOTTOM FIJA Y REACTIVA ===== */
.specialties-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 3px solid var(--3x3_mexico-primary);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    height: var(--bottom-nav-height);
    z-index: 998;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    opacity: 1;
}

/* Estados del nav */
.specialties-bottom-nav.nav-fixed {
    position: fixed;
    bottom: 0;
    top: auto;
}

.specialties-bottom-nav.nav-absolute {
    position: absolute;
    bottom: auto;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    border-top: 3px solid var(--3x3_mexico-primary);
    border-bottom: none;
}

.specialties-bottom-nav.nav-hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.specialties-bottom-nav.nav-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.specialties-bottom-nav.hovered {
    transform: translateY(0);
    opacity: 1;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.2);
    pointer-events: all;
}

/* Contenedor interno del nav */
.specialties-bottom-nav .nav-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--scale-lg);
    height: 100%;
    justify-content: center;
}

.specialties-bottom-nav .nav-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    gap: var(--scale-xxl);
}

/* Items del nav */
.specialties-bottom-nav .nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-decoration: none;
    color: var(--3x3_mexico-text-light);
    transition: all var(--transition);
    position: relative;
    padding: var(--scale-xs) var(--scale-sm);
    border-radius: var(--border-radius-sm);
    background: transparent;
    cursor: pointer;
}

.specialties-bottom-nav .nav-item:hover {
    color: var(--3x3_mexico-primary);
    background: var(--3x3_mexico-accent);
    transform: translateY(-1px);
}

.specialties-bottom-nav .nav-item.active {
    color: var(--3x3_mexico-primary);
    background: var(--3x3_mexico-accent);
}

/* Iconos del nav */
.specialties-bottom-nav .nav-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 4px;
    transition: all var(--transition);
    color: inherit;
}

.specialties-bottom-nav .nav-item:hover .nav-icon {
    transform: scale(1.1);
}

.specialties-bottom-nav .nav-item.active .nav-icon {
    color: var(--3x3_mexico-primary);
    transform: scale(1.1);
}

/* Labels del nav */
.specialties-bottom-nav .nav-label {
    font-size: 0.7rem;
    font-weight: var(--font-semibold);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: all var(--transition);
}

.specialties-bottom-nav .nav-item.active .nav-label {
    font-weight: var(--font-bold);
}

/* Indicador de sección activa */
.specialties-bottom-nav .nav-indicator {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--3x3_mexico-primary);
    border-radius: 2px;
    transition: all var(--transition);
}

.specialties-bottom-nav .nav-item.active .nav-indicator {
    width: 80%;
}

/* ===== HERO SECTION PROYECTOS ===== */
.projects-hero-section {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
    padding: var(--header-height) 20px 0px;
}

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

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.3);
    transition: transform 20s ease;
}

.projects-hero-section:hover .hero-image {
    transform: scale(1.05);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(242, 45, 58, 0.4) 0%,
            rgba(0, 0, 0, 0.8) 100%);
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-text {
    color: white;
    animation: fadeInUp 1s ease-out;
}

.hero-tag {
    display: inline-block;
    background: rgba(242, 45, 58, 0.2);
    border: 1px solid rgba(242, 45, 58, 0.4);
    border-radius: 30px;
    padding: 8px 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.hero-tag span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
}

.hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.title-line {
    display: block;
}

.title-highlight {
    color: var(--3x3_mexico-primary);
    display: block;
    position: relative;
    background: white;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.2rem);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* ===== GALERÍA DE PROYECTOS ===== */
.projects-gallery-section {
    position: relative;
    padding: var(--scale-xxl) 0 var(--scale-xxxl);
    background: var(--3x3_mexico-light);
    margin-bottom: 40px;
}

/* Sección de Especialidad - SOLO UNA VISIBLE A LA VEZ */
.specialty-section {
    margin-bottom: 0;
    display: none;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    scroll-margin-top: calc(var(--header-height) + 20px);
}

.specialty-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.6s ease;
}

/* Header de Especialidad */
.specialty-header {
    margin-bottom: var(--scale-xl);
    text-align: center;
}

.specialty-title {
    display: inline-flex;
    align-items: center;
    gap: var(--scale-lg);
    padding: var(--scale-md) var(--scale-xl);
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--scale-lg);
}

.specialty-icon {
    width: 70px;
    height: 70px;
    background: var(--3x3_mexico-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.specialty-text h2 {
    font-size: 2rem;
    font-weight: var(--font-bold);
    color: var(--3x3_mexico-text);
    margin-bottom: 5px;
}

.specialty-text p {
    font-size: 1.1rem;
    color: var(--3x3_mexico-text);
    opacity: 0.8;
    margin: 0;
}

/* Carrusel de Especialidad */
.specialty-carousel {
    position: relative;
    background: white;
    border-radius: var(--border-radius-lg);
    padding: var(--scale-xl);
    box-shadow: var(--shadow-lg);
    max-width: 1200px;
    margin: 0 auto;
}

/* Flechas del Carrusel */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: var(--3x3_mexico-primary);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    box-shadow: var(--shadow-primary);
}

.carousel-arrow:hover:not(:disabled) {
    background: var(--3x3_mexico-primary-dark);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.carousel-arrow:active:not(:disabled) {
    transform: translateY(-50%) scale(0.95);
}

.arrow-prev {
    left: -30px;
}

.arrow-next {
    right: -30px;
}

/* Contenedor del Carrusel */
.carousel-container {
    position: relative;
    overflow: hidden;
    min-height: 600px;
}

/* Tarjeta de Proyecto */
.project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--scale-xl);
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    visibility: hidden;
}

.project-card.active {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    position: relative;
}

.project-card.animated {
    animation: slideInRight 0.8s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== CARRUSEL DE IMÁGENES DEL PROYECTO ===== */
.project-image-carousel {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    height: 645px;
}

.carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slides .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.carousel-slides .slide.active {
    opacity: 1;
}

.carousel-slides .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 2;
}

.carousel-dots .carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dots .carousel-dot.active {
    background: var(--3x3_mexico-primary);
    transform: scale(1.2);
}

.carousel-dots .carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.project-badge {
    position: absolute;
    top: var(--scale-lg);
    left: var(--scale-lg);
    background: var(--3x3_mexico-primary);
    color: white;
    padding: var(--scale-xs) var(--scale-md);
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: var(--scale-xs);
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 2;
}

/* Información del Proyecto */
.project-info {
    padding: var(--scale-md);
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--scale-lg);
    padding-bottom: var(--scale-md);
    border-bottom: 2px solid var(--3x3_mexico-border);
}

.project-category {
    background: var(--3x3_mexico-accent);
    color: var(--3x3_mexico-primary);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-duration {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--3x3_mexico-text);
    font-weight: 600;
}

.project-duration i {
    color: var(--3x3_mexico-primary);
}

.project-title {
    font-size: 1.8rem;
    font-weight: var(--font-bold);
    color: var(--3x3_mexico-text);
    margin-bottom: var(--scale-md);
    line-height: 1.3;
}

.project-location {
    display: flex;
    align-items: center;
    gap: var(--scale-xs);
    font-size: 1rem;
    color: var(--3x3_mexico-text);
    margin-bottom: var(--scale-lg);
}

.project-location i {
    color: var(--3x3_mexico-primary);
}

.project-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--3x3_mexico-text);
    margin-bottom: var(--scale-lg);
}

.project-highlights {
    display: flex;
    flex-direction: column;
    gap: var(--scale-sm);
    margin-bottom: var(--scale-lg);
}

.highlight {
    display: flex;
    align-items: flex-start;
    gap: var(--scale-sm);
    font-size: 1rem;
    color: var(--3x3_mexico-text);
}

.highlight i {
    color: var(--3x3_mexico-primary);
    font-size: 0.9rem;
    margin-top: 3px;
    flex-shrink: 0;
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--scale-md);
    margin-top: var(--scale-xl);
    padding-top: var(--scale-lg);
    border-top: 2px solid var(--3x3_mexico-border);
}

.stat {
    text-align: center;
    padding: var(--scale-md);
    background: var(--3x3_mexico-light);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.stat:hover {
    background: var(--3x3_mexico-accent);
    transform: translateY(-3px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--3x3_mexico-primary);
    line-height: 1;
    margin-bottom: 5px;
    transition: all 0.5s ease;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--3x3_mexico-text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Indicadores del Carrusel */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: var(--scale-xs);
    margin-top: var(--scale-xl);
}

.indicator {
    width: 12px;
    height: 12px;
    background: var(--3x3_mexico-border);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}

.indicator:hover {
    background: var(--3x3_mexico-primary-light);
    transform: scale(1.2);
}

.indicator.active {
    background: var(--3x3_mexico-primary);
    transform: scale(1.4);
}

/* ===== FOOTER ===== */
footer {
    position: relative;
    z-index: 999;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets grandes */
@media (max-width: 1199px) {
    .container {
        padding: 0 var(--scale-md);
    }

    .projects-gallery-section {
        padding: var(--scale-xl) 0 var(--scale-xxl);
    }

    .specialties-bottom-nav .nav-container {
        padding: 0 var(--scale-md);
    }
}

/* Tablets */
@media (max-width: 1024px) {
    :root {
        --bottom-nav-height: 65px;
    }

    .specialties-bottom-nav {
        height: 65px;
    }

    .carousel-arrow {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .arrow-prev {
        left: -25px;
    }

    .arrow-next {
        right: -25px;
    }

    .specialties-bottom-nav .nav-icon {
        width: 26px;
        height: 26px;
        font-size: 1rem;
    }

    .specialties-bottom-nav .nav-label {
        font-size: 0.65rem;
    }
}

/* Tablets pequeñas y móviles grandes */
@media (max-width: 768px) {
    :root {
        --bottom-nav-height: 60px;
    }

    .specialties-bottom-nav {
        height: 60px;
    }

    .specialty-carousel {
        padding: var(--scale-lg);
    }

    .carousel-arrow {
        position: static;
        transform: none;
        margin: 0 var(--scale-sm);
    }

    .arrow-prev,
    .arrow-next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }

    .arrow-prev {
        left: var(--scale-sm);
    }

    .arrow-next {
        right: var(--scale-sm);
    }

    .project-card {
        grid-template-columns: 1fr;
        gap: var(--scale-xl);
    }

    .project-image-carousel {
        height: 300px;
    }

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

    .project-description {
        font-size: 1rem;
    }

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

    .specialties-hero-section {
        padding: calc(var(--header-height) + 15px) 15px 40px;
    }

    .specialties-bottom-nav .nav-item {
        padding: var(--scale-xxs) var(--scale-xs);
    }

    .specialties-bottom-nav .nav-icon {
        width: 24px;
        height: 24px;
        font-size: 0.95rem;
    }

    .specialties-bottom-nav .nav-label {
        font-size: 0.6rem;
    }
}

/* Móviles medianos */
@media (max-width: 575px) {
    :root {
        --bottom-nav-height: 55px;
    }

    .specialties-bottom-nav {
        height: 55px;
    }

    .container {
        padding: 0 var(--scale-sm);
    }

    .specialty-carousel {
        padding: var(--scale-lg);
    }

    .project-image-carousel {
        height: 250px;
    }

    .project-stats {
        grid-template-columns: 1fr;
    }

    .project-meta {
        flex-direction: column;
        gap: var(--scale-sm);
        align-items: flex-start;
    }

    .specialties-bottom-nav .nav-container {
        padding: 0 var(--scale-sm);
    }

    .specialties-bottom-nav .nav-inner {
        gap: 1px;
    }

    .specialties-bottom-nav .nav-item {
        padding: 4px 2px;
    }

    .specialties-bottom-nav .nav-icon {
        width: 22px;
        height: 22px;
        font-size: 0.9rem;
        margin-bottom: 2px;
    }

    .specialties-bottom-nav .nav-label {
        font-size: 0.55rem;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    :root {
        --bottom-nav-height: 50px;
    }

    .specialties-bottom-nav {
        height: 50px;
    }

    .specialties-bottom-nav .nav-label {
        display: none;
    }

    .specialties-bottom-nav .nav-item {
        justify-content: center;
    }

    .specialties-bottom-nav .nav-icon {
        margin-bottom: 0;
        font-size: 1rem;
    }
}

/* Móviles muy pequeños */
@media (max-width: 375px) {
    :root {
        --bottom-nav-height: 45px;
    }

    .specialties-bottom-nav {
        height: 45px;
    }

    .specialties-bottom-nav .nav-container {
        padding: 0 var(--scale-xs);
    }

    .specialties-bottom-nav .nav-icon {
        width: 20px;
        height: 20px;
        font-size: 0.85rem;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(242, 45, 58, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(242, 45, 58, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(242, 45, 58, 0);
    }
}

.project-card.active:hover .project-badge {
    animation: pulse 2s infinite;
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .specialties-bottom-nav,
    .nav-item,
    .nav-icon,
    .carousel-slides .slide,
    .carousel-arrow {
        transition: none !important;
    }

    .specialty-section {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .project-card.active {
        position: relative;
        visibility: visible;
        opacity: 1;
        transform: none;
    }

    .project-card:not(.active) {
        display: none;
    }
}

/* Focus styles para accesibilidad */
.carousel-arrow:focus,
.specialties-bottom-nav .nav-item:focus,
.indicator:focus,
.carousel-dot:focus {
    outline: 3px solid var(--3x3_mexico-primary);
    outline-offset: 2px;
}

/* ===== ESTILOS PARA IMPRESIÓN ===== */
@media print {

    .projects-hero-section,
    .specialties-bottom-nav,
    .carousel-arrow,
    .carousel-indicators,
    .carousel-dots {
        display: none !important;
    }

    .specialty-section {
        display: block !important;
        break-inside: avoid;
        margin-bottom: 2cm;
        opacity: 1 !important;
        transform: none !important;
    }

    .specialty-carousel {
        box-shadow: none;
        padding: 0;
    }

    .project-card {
        grid-template-columns: 1fr;
        gap: 1cm;
        position: relative !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .project-image-carousel {
        height: 200px;
    }
}