/* ==========================================================================
   GALERÍA DE PROYECTOS (TARJETAS)
   ========================================================================== */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 80px 10%;
}

.project-card {
    position: relative;
    height: 280px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    will-change: transform, box-shadow;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
    z-index: 1;
}

.project-card h3 {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    margin: 0;
    padding: 25px 20px;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 400;
    z-index: 2;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.slider-intro {
    text-align: center;
    padding: 60px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    background-color: #f8f9fa;
}

.bg-text-decor {
    font-size: clamp(30px, 11vw, 120px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: clamp(4px, 1.5vw, 15px);
    color: var(--color-logo-dark, #1a1a1a);
    line-height: 0.95;
    user-select: none;
}

@supports (-webkit-text-stroke: 1px black) {
    .bg-text-decor {
        color: transparent;
        -webkit-text-stroke: 1px var(--color-logo-dark, #1a1a1a);
    }
}

/* ==========================================================================
   NUEVO MODAL STYLE: PREMIUM MINIMAL (UNIFICADO)
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    overflow-y: scroll;
    animation: fadeIn 0.4s ease;
}

.modal-content {
    background-color: transparent;
    margin: 0 auto;
    width: 90%;
    max-width: 1200px;
    position: relative;
    padding: 80px 0;
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.close {
    position: absolute;
    top: 30px;
    right: 0px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    background-color: transparent; /* Eliminamos el fondo de círculo oscuro */
    z-index: 10001;
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1); /* Transición más fluida */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Creamos las líneas finas de la cruz */
.close::before,
.close::after {
    content: '';
    position: absolute;
    width: 28px; /* Largo de la línea */
    height: 1px;  /* Grosor ultra fino premium */
    background-color: var(--color-logo-dark, #1a1a1a); /* Color adaptado a tu paleta */
    transition: background-color 0.3s ease;
}

/* Cruzamos las líneas */
.close::before {
    transform: rotate(45deg);
}

.close::after {
    transform: rotate(-45deg);
}

/* Comportamiento al pasar el ratón (Hover) */
.close:hover { 
    transform: rotate(135deg); /* Gira un cuarto de vuelta extra de forma espectacular */
}

.close:hover::before,
.close:hover::after {
    background-color: #999; /* Suaviza el color al interactuar */
}

/* Layout 2 Columnas */
.modal-body-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: start;
}

.modal-image-container {
    background: #f9f9f9;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header-img {
    width: 100%;
    height: auto;
    max-height: 65vh;
    object-fit: contain;
    padding: 20px 20px 0 20px;
    display: block;
}

/* ==========================================================================
   CARRUSEL DE MINIATURAS CON FLECHAS FLOTANTES
   ========================================================================== */
.thumbnails-slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 50px; /* Margen para que las flechas no pisen las esquinas de las imágenes */
    background: #f9f9f9;
    margin-top: 10px;
}

.modal-thumbnails {
    display: flex;
    gap: 12px;
    padding: 20px 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    width: 100%;
    cursor: grab; /* Mano abierta por defecto en todo el área */
    user-select: none;
    
    &::-webkit-scrollbar { display: none; }
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}
.modal-thumbnails.grabbing,
.modal-thumbnails.grabbing .modal-thumb {
    cursor: grabbing !important; /* Forzamos el puño cerrado durante el arrastre */
    scroll-behavior: auto;
}

.modal-thumb {
    width: 75px;
    height: 75px;
    border-radius: 10px;
    opacity: 0.4;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: grayscale(100%);
    cursor: inherit; 
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid transparent;
    pointer-events: auto;
    -webkit-user-drag: none;
}

.modal-thumb.active, .modal-thumb:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.02);
    border-color: var(--color-logo-dark, #1a1a1a);
}

/* Flechas Estilizadas Modernas */
.thumb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent; /* Sin fondo de color */
    color: var(--color-logo-dark, #1a1a1a);
    border: none;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: color 0.3s ease, transform 0.2s ease;
}
.thumb-arrow svg {
    transition: stroke-width 0.2s ease;
}
.thumb-arrow:hover {
    color: #000000;
}
.thumb-arrow:hover svg {
    stroke-width: 2.5;
}
.thumb-arrow:active {
    transform: translateY(-50%) scale(0.92);
}

.prev-thumb {
    left: 10px;
}

.next-thumb {
    right: 10px;
}

/* ==========================================================================
   INFO DE PROYECTO (COLUMNA DERECHA)
   ========================================================================== */
.modal-info {
    position: sticky;
    top: 40px;
}

.modal-info h2 {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 25px;
    color: #1a1a1a;
}

.modal-info p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 30px;
}

.project-specs {
    border-top: 2px solid #1a1a1a;
    padding-top: 20px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 18px 0;
    border-bottom: 1px solid #eee;
}

.spec-item span {
    font-weight: bold;
    color: #999;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.spec-item strong {
    color: #1a1a1a;
    font-size: 1rem;
}

/* ==========================================================================
   ANIMACIONES Y RESPONSIVE
   ========================================================================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 1024px) {
    .modal-body-wrapper { grid-template-columns: 1fr; gap: 30px; }
    .modal-info { position: static; }
    .modal-content { padding: 80px 5%; }
}

@media (max-width: 750px) {
    .projects-container { padding: 40px 5%; }
    .modal-info h2 { font-size: 1.8rem; }
    .slider-intro { margin-top: 80px; }
    
    .close { 
        position: fixed;
        top: 20px; 
        right: 20px;
        width: 46px;
        height: 46px;
    }

    /* En móviles reducimos el padding lateral para ganar pantalla */
    .thumbnails-slider-wrapper {
        padding: 0 35px;
    }
    .thumb-arrow {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .prev-thumb { left: 2px; }
    .next-thumb { right: 2px; }
}

@media (max-width: 480px) {
    .spec-item { flex-direction: column; gap: 5px; }
}
