/* ═══════════════════════════════════════
   PORTAFOLIO — Acordeón Refactorizado
═══════════════════════════════════════ */

#portafolio {
    background: #fff;
    width: 100%;
}

/* ── Encabezado ── */
.portafolio-header {
    padding: 64px 48px 0;
    text-align: center;
    border-bottom: 1px solid rgba(181, 168, 159, 0.35);
    padding-bottom: 28px;
}

.portafolio-header h2 {
    font-size: 3rem;
    font-weight: 300;
    color: #3F3B38;
    letter-spacing: -0.01em;
}

.portfolio-divider {
    width: 80%;
    height: 2px;
    background-color: #DAD3CF;
    margin: 48px auto 32px;
}

/* ── Acordeón ── */
.accordion {
    width: 100%;
}

/* ── Cada fila del acordeón ── */
.accordion-item {
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid #fff;
    cursor: pointer;
    height: 200px;
    transition: height 0.5s cubic-bezier(0.25, 1, 0.5, 1), background 0.45s ease;
}

/* Imagen de fondo base */
.accordion-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    transition: transform 0.6s ease, filter 0.45s ease;
}

.acc-desarrollo::before {
    background-image: var(--bg-portada);
    background-position: center 15%;
}

.acc-arquitectura::before {
    background-image: var(--bg-portada);
    background-position: center 60%;
}

.acc-interiorismo::before {
    background-image: var(--bg-portada);
    background-position: center 60%;
}

/* Overlay oscuro base (Imagen 1) */
.accordion-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2;
    transition: background 0.45s ease;
}

/* ── Header visible (Categoría + X) ── */
.accordion-header {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    height: 200px;
    transition: height 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.accordion-label {
    font-size: 1.75rem;
    font-weight: 600;
    color: #ffffff;
    transition: font-size 0.3s ease, color 0.3s ease;
    user-select: none;
}

/* Limpieza total del botón del acordeón */
.accordion-close {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none;
    box-shadow: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Mostrar como flex únicamente cuando la sección esté activa */
.accordion-item.is-active .accordion-close {
    display: flex !important;
}

/* Estilos para el ícono de Google dentro de ese botón */
.accordion-close .material-symbols-rounded {
    font-size: 2.5rem;
    color: #eeeeee;
    background: transparent;
    transition: color 0.2s ease, transform 0.2s ease;
}

/* Efecto hover opcional para cuando pasás el mouse */
.accordion-close:hover .material-symbols-rounded {
    color: #ffffff;
    transform: scale(1.1);
}

/* ── HOVER (No activo) ── */
.accordion-item:not(.is-active):hover::after {
    background: rgba(0, 0, 0, 0.55);
}

/* ── ESTADO ACTIVO (Imagen 2) ── */
.accordion-item.is-active {
    height: auto;
    /* Permite crecer para alojar los proyectos */
    background: #bbb1a7;
    /* Color plano sólido topo/grisáceo */
}

.accordion-item.is-active::before {
    display: none;
    /* Elimina la imagen de fondo */
}

.accordion-item.is-active::after {
    display: none;
    /* Elimina el overlay oscuro */
}

.accordion-item.is-active .accordion-header {
    height: 200px;
    /* Mantiene la proporción de altura exacta */
}

.accordion-item.is-active .accordion-label {
    color: #ffffff;
    /* Texto blanco sobre fondo plano */
}

.accordion-item.is-active .accordion-close {
    display: block;
}

/* ── ESTADO INACTIVO (Efecto Velado Blanco — Imagen 2) ── */
.accordion-item.is-inactive::after {
    background: rgba(255, 255, 255, 0.85);
    /* Capa blanca semi-transparente sobre la imagen */
}

.accordion-item.is-inactive .accordion-label {
    color: #B5A89F;
    /* Texto atenuado y con bajo contraste */
}

/* ── CONTENIDO DESPLEGADO ── */
.accordion-body {
    position: relative;
    z-index: 3;
    display: none;
    width: 100%;
}

.accordion-item.is-active .accordion-body {
    display: block;
}

/* ── Grid de proyectos (Estructura vertical limpia) ── */
.projects-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ── Tarjeta de proyecto (Mismo tamaño que el header) ── */
.project-card {
    position: relative;
    height: 180px;
    width: 100%;
    overflow: hidden;
    border-top: 4px solid #fff;
    display: flex;
    align-items: center;
    padding-left: 48px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Placeholders/Imágenes para los proyectos (Reemplaza con tus .jpg reales) */
.proj-avalos {
    background-image: url('https://images.unsplash.com/photo-1780328766286-23e6cb082cb9?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
    background-size: cover;
    background-position: center;
}

.proj-pedraza {
    background-image: url('https://images.unsplash.com/photo-1780328766286-23e6cb082cb9?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
    background-size: cover;
    background-position: center;
}

.proj-tercero {
    background-image: url('https://images.unsplash.com/photo-1780328766286-23e6cb082cb9?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
    background-size: cover;
    background-position: center;
}

/* Filtro oscuro muy suave por defecto sobre el proyecto */
.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1;
    transition: background 0.4s ease;
}

.project-card:hover::after {
    background: rgba(0, 0, 0, 0.7);
}

/* Texto del proyecto super grande */
.project-name {
    position: relative;
    z-index: 2;
    font-size: 8rem;
    font-weight: 600;
    color: #B5A89F;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%
}

/* ESTILOS COMPONENTE: MODAL PROYECTOS */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: #ffffff;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    overflow-y: auto;
    padding: 32px 0;
}

.modal-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    position: relative;
    width: 92%;
    max-width: 1400px;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ── Barra Superior (Logo + Cruz) ── */
.modal-container>div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.modal-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: #b5a89f;
    letter-spacing: 0.1em;
    user-select: none;
}

.modal-brand img {
    height: 68px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #a0a0a0;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 0.8;
}

.modal-close-btn:hover {
    color: #333;
}

.modal-close-btn span {
    font-size: 48px;
    color: #00000046;
}

.modal-layout {
    display: grid;
    grid-template-columns: 35% 60%;
    gap: 70px;
    flex: 1;
    align-items: stretch;
}

/* ── COLUMNA IZQUIERDA: TEXTOS COMPACTOS ── */
.modal-info-col {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
}

/* Ajuste para que la información esté pegada arriba a la izquierda y junta */
.modal-text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0;
}

.project-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #B5A89F;
    border: 1px solid #DAD3CF;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.project-title {
    font-size: 4rem;
    font-weight: 500;
    color: #425464;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    line-height: 1.1;
}

.project-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #766D67;
    font-weight: 400;
    margin-bottom: 24px;
}

.btn-solicitar-info {
    background: #ff7e67;
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease;
    font-family: var(--font);
}

a {
    color: #ffffff;
    text-decoration: none;
}

.btn-solicitar-info:hover {
    background: #e26751;
}

.modal-divider {
    height: 2px;
    background-color: #DAD3CF;
}

/* Metadatos inferiores */
.modal-meta-data {
    font-size: 0.875rem;
    color: #B5A89F;
    line-height: 1.6;
    font-weight: 400;
    margin-bottom: 10px;
}

/* ── COLUMNA DERECHA: GALERÍA SIMÉTRICA ── */
.modal-gallery-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.main-viewer-wrapper {
    position: relative;
    flex: 1;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    /* min-height: 350px; */
}

.main-image-display {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

/* Flechas direccionales */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    z-index: 10;
    transition: background 0.2s ease;
}

.gallery-arrow span {
    font-size: 2rem;
    color: #000000;
}

.gallery-arrow:hover {
    background: rgba(255, 255, 255, 1);
}

.prev-arrow {
    left: 20px;
}

.next-arrow {
    right: 20px;
}

/* Grilla fija de 3 Miniaturas Abajo */
.thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    height: 160px;
    width: 100%;
    flex-shrink: 0;
}

.thumb-item {
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.thumb-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.2s ease;
    border-radius: 4px;
}

.thumb-item.active::after,
.thumb-item:hover::after {
    background: rgba(255, 255, 255, 0);
}

/* ── RESPONSIVE ── */

@media (max-width: 1200px) {
    .project-name {
        font-size: 6rem;
    }
}

@media (max-width: 1024px) {
    .modal-overlay {
        padding: 24px 0;
    }

    .modal-container {
        height: auto;
        overflow-y: visible;
    }

    .modal-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .modal-info-col {
        gap: 32px;
    }
}

@media (max-width: 800px) {

    .accordion-item,
    .accordion-header {
        height: 360px;
    }

    .accordion-item.is-active .accordion-header {
        height: 360px;
    }

    .project-name {
        font-size: 5rem;
    }

    .modal-close-btn span {
        font-size: 48px;
    }

    .modal-brand img {
        height: 48px;
    }

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

    .thumbnails-grid {
        height: 100px;
    }
}

@media (max-width: 768px) {

    .project-card {
        height: 120px;
        /* Se reduce proporcionalmente en móviles */
    }

    .accordion-header,
    .project-card {
        padding-left: 24px;
        padding-right: 24px;
    }

    .project-name {
        font-size: 2.5rem;
    }
}


@media (max-width: 640px) {
    .portfolio-divider {
        width: 30%;
        min-width: 100px;
    }

    .accordion-item,
    .accordion-header {
        height: 260px;
    }

    .accordion-item.is-active .accordion-header {
        height: 260px;
    }

}