/* ========== VARIABLES ========== */
:root {
    --azul: #030083;
    --naranja: #fc7f00;
    --blanco: #ffffff;
    --gris-fondo: #f4f7fc;
    --sombra-externa: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 20px 48px -10px rgba(0, 0, 0, 0.08);
    --border-radius: 28px;
    --gris-claro: #f9fafb;
    --gris-borde: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--gris-fondo);
    overflow-x: hidden;
    line-height: 1.5;
}

/* ===== TARJETAS DE PROYECTO ===== */
.proyecto-full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: var(--gris-fondo);
}

.proyecto-card-inner {
    width: 100%;
    max-width: 1320px;
    background: var(--blanco);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--sombra-externa);
    display: flex;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.proyecto-full:hover .proyecto-card-inner {
    transform: translateY(-8px);
    box-shadow: 0 30px 60px -12px rgba(3, 0, 131, 0.15), 0 18px 36px -18px rgba(0, 0, 0, 0.1);
}

.proyecto-card-inner {
    flex-direction: row;
}

.proyecto-full.reverse .proyecto-card-inner {
    flex-direction: row-reverse;
}

/* Columnas */
.proyecto-texto {
    flex: 0 0 50%;
    padding: 2.5rem;
    background: var(--blanco);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.proyecto-imagen {
    flex: 0 0 50%;
    background: #0a0a1a;
    position: relative;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.proyecto-full.reverse .proyecto-imagen {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

/* ===== ESTILOS DEL TEXTO ===== */
.proyecto-estado-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 0.4rem 1.2rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.proyecto-estado-badge::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.estado-planificacion { background: #fef3c7; color: #b45309; }
.estado-planificacion::before { background: #b45309; }
.estado-en_construccion { background: #fed7aa; color: #9b2c1d; }
.estado-en_construccion::before { background: #9b2c1d; }
.estado-entregado { background: #d1fae5; color: #065f46; }
.estado-entregado::before { background: #065f46; }

.proyecto-texto h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    background: linear-gradient(135deg, #0f172a 0%, var(--azul) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.proyecto-descripcion {
    font-size: 1rem;
    color: #334155;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.proyecto-cliente,
.proyecto-ubicacion {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    color: #1e293b;
    margin-bottom: 0.6rem;
}

.proyecto-cliente i,
.proyecto-ubicacion i {
    color: var(--naranja);
    width: 1.2rem;
    font-size: 1rem;
}

.detalles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    background: rgba(249, 250, 251, 0.6);
    backdrop-filter: blur(8px);
    padding: 1.5rem;
    border-radius: 20px;
    margin: 1.5rem 0;
    border: 1px solid rgba(229, 231, 235, 0.8);
}

.detalle-item .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.5px;
    display: block;
}

.detalle-item .value {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin-top: 4px;
}

.avance-wrapper {
    margin: 1rem 0;
}

.avance-wrapper span {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.barra-avance {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    margin-top: 6px;
    overflow: hidden;
}

.barra-avance-progreso {
    height: 100%;
    background: linear-gradient(90deg, var(--naranja) 0%, #ff9d33 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.barra-avance-progreso::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

.proyecto-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 1rem 0 1.5rem;
}

.tag {
    background: rgba(241, 245, 249, 0.8);
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--azul);
    letter-spacing: 0.5px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.2s ease;
}

.tag:hover {
    background: var(--azul);
    color: white;
    border-color: var(--azul);
    transform: translateY(-2px);
}

/* ===== CARRUSEL - VERSIÓN PROFESIONAL ===== */
.carrusel-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
    overflow: hidden;
    background: #0a0a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carrusel-slides {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.carrusel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carrusel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carrusel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.carrusel-slide img:hover {
    transform: scale(1.02);
}

.carrusel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.carrusel-btn:hover {
    background: var(--naranja);
    transform: translateY(-50%) scale(1.1);
}

.btn-prev { left: 15px; }
.btn-next { right: 15px; }

.carrusel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 40px;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dot:hover {
    background: white;
    transform: scale(1.2);
}

.dot.active {
    background: var(--naranja);
    transform: scale(1.3);
}

/* Indicador de zoom */
.proyecto-imagen::after {
    content: '🔍';
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 12px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.proyecto-imagen:hover::after {
    opacity: 1;
}

/* ===== LIGHTBOX MODAL ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    z-index: 10001;
}

.lightbox-close:hover {
    background: var(--naranja);
    transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    z-index: 10001;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: var(--naranja);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }

.lightbox-counter {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    z-index: 10001;
}

.lightbox-caption {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 20px;
    font-size: 16px;
    z-index: 10001;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== LOADER ===== */
.loader-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--azul);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    text-align: center;
    padding: 2rem;
    color: #dc2626;
    background: #fef2f2;
    border-radius: 20px;
    margin: 2rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .proyecto-texto {
        padding: 2rem;
    }
    
    .proyecto-texto h2 {
        font-size: 1.8rem;
    }
    
    .detalles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .proyecto-full {
        padding: 1rem;
    }
    
    .proyecto-card-inner,
    .proyecto-full.reverse .proyecto-card-inner {
        flex-direction: column !important;
    }
    
    .proyecto-texto {
        order: 1;
        width: 100%;
        padding: 1.8rem;
    }
    
    .proyecto-imagen {
        order: 2;
        width: 100%;
        min-height: 320px;
        border-radius: 0 0 var(--border-radius) var(--border-radius) !important;
    }
    
    .carrusel-wrapper,
    .carrusel-slides {
        min-height: 320px;
    }
    
    .proyecto-full.reverse .proyecto-imagen {
        border-radius: 0 0 var(--border-radius) var(--border-radius) !important;
    }
    
    .proyecto-texto h2 {
        font-size: 1.6rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .lightbox-prev { left: 15px; }
    .lightbox-next { right: 15px; }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 24px;
    }
}