/* ===== PORTFOLIO GRID - Hover Overlay ===== */
.epg-wrapper {
    max-width: 83%;
    margin: 0 auto;
    padding: 40px 30px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ===== FILTROS ===== */
.epg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.epg-filter-btn {
    border: 0;
    padding: 10px 18px;
    border-radius: 999px;
    background: #222;
    color: #ddd;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: 0.3s;
}

.epg-filter-btn:hover,
.epg-filter-btn.active {
    background: #1e9cd7;
    color: #ffffff;
}

/* ===== GRID ===== */
.epg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* ===== ITEM / CARD ===== */
.epg-item {
    transition: all 0.3s ease;
}

.epg-item.epg-hidden {
    display: none;
}

.epg-card {
    position: relative;
    display: block;
    border-radius: 24px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background: transparent;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    height: 100%;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.epg-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* ===== IMAGEN ===== */
.epg-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: transparent;
}

.epg-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.epg-image img.epg-loaded {
    opacity: 1;
}

.epg-card:hover .epg-image img {
    transform: scale(1.08);
}

/* ===== OVERLAY ===== */
.epg-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    background: linear-gradient(
        to top,
        rgba(10, 20, 30, 0.92) 0%,
        rgba(10, 20, 30, 0.55) 45%,
        transparent 75%
    );
    opacity: 0;
    transition: opacity 0.35s ease;
}

.epg-card:hover .epg-overlay,
.epg-card:focus-visible .epg-overlay {
    opacity: 1;
}

/* Animación escalonada */
.epg-overlay > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.epg-card:hover .epg-overlay > *,
.epg-card:focus-visible .epg-overlay > * {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--i, 0) * 70ms);
}

/* Tags */
.epg-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.epg-tags span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Título */
.epg-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ===== BOTONES (Ver detalle + Ver preview) ===== */
.epg-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.epg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    line-height: 1;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.epg-btn-detail {
    background: #1e9cd7;
    color: #fff;
}

.epg-btn-detail:hover {
    background: #1a8bc0;
    transform: translateY(-2px);
}

.epg-btn-preview {
    background: transparent;
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, 0.75);
}

.epg-btn-preview:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    transform: translateY(-2px);
}

/* ===== CAPTION MÓVIL ===== */
.epg-cap {
    display: none;
    padding: 14px 4px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ==================================================
   MODAL PREVIEW
================================================== */
.epg-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.epg-modal.active {
    opacity: 1;
    visibility: visible;
}

.epg-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(5px);
}

.epg-modal-content {
    position: relative;
    background: #fff;
    width: 92%;
    max-width: 1100px;
    border-radius: 20px;
    padding: 28px 28px 36px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    transform: translateY(30px);
    transition: transform 0.35s ease;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.epg-modal.active .epg-modal-content {
    transform: translateY(0);
}

.epg-modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    z-index: 5;
}

.epg-modal-close:hover {
    color: #000;
}

.epg-modal-title {
    margin: 0 0 18px;
    font-size: 1.45rem;
    font-weight: 600;
    text-align: center;
    color: #222;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ==================================================
   SLIDER (usado tanto en single como en modal)
================================================== */
.epg-project-slider,
.epg-modal [data-slider] {
    position: relative;
    width: 100%;
    margin: 0;
}

.epg-slider-viewport {
    overflow: hidden;
    border-radius: 14px;
}

.epg-slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.epg-slide {
    flex: 0 0 50%;
    padding: 0 8px;
    box-sizing: border-box;
}

.epg-slide img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

/* Botones del slider */
.epg-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
    z-index: 10;
}

.epg-slider-btn:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.08);
}

.epg-prev { left: -12px; }
.epg-next { right: -12px; }

/* Dots */
.epg-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.epg-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}

.epg-dot.active,
.epg-dot:hover {
    background: #1e9cd7;
    transform: scale(1.25);
}

/* ==================================================
   PROJECT SINGLE (página detalle)
================================================== */
.container,
.container-lg,
.container-md,
.container-sm,
.container-xl,
.container-xxl {
    max-width: 1500px !important;
}

.project-single {
    margin: 0 auto;
    padding: 120px 30px 60px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #5a6a7a;
    line-height: 1.6;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 40px;
    padding-bottom: 51px;
    border-bottom: 1px solid #e3e3e3;
}

.project-single .project-title {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 36px !important;
    line-height: 46px !important;
    color: rgb(110, 193, 228) !important;
    margin: 0 0 36px 0;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.project-tags a {
    display: inline-block;
    padding: 3px 16px;
    border: 1px solid #d0e0f0;
    border-radius: 50px;
    color: #7b6cf6;
    margin-top: 11px;
    font-size: 16px;
    text-decoration: none;
    background: #ffffff;
    transition: all 0.2s ease;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: bold;
}

.project-meta {
    list-style: none;
    margin-top: 27px;
    margin-right: -39px;
    padding: 0;
    font-size: 16px;
    line-height: 1.9;
    min-width: 180px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
}

.project-meta strong {
    color: #2c3e50;
    font-weight: 700;
}

.project-overview {
    margin-bottom: 0;
}

.project-single h2 {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 700 !important;
    font-size: 36px !important;
    line-height: 46px !important;
    color: rgb(110, 193, 228) !important;
    margin: 0 0 22px 0;
}

.overview-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.overview-columns p,
.project-bottom-text {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    line-height: 29px !important;
    color: black;
    margin: 0;
}

.project-results {
    margin-bottom: 10px;
}

.results-grid {
    display: flex !important;
    align-items: baseline;
    gap: 46px;
    margin-right: 0;
    margin-left: -45px;
    margin-bottom: 10px;
}

.results-lists {
    display: flex !important;
    flex: 1 1 auto;
    gap: 50px;
    max-width: 882px;
}

.results-lists ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1;
}

.results-lists li {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    color: #5a6a7a !important;
    line-height: 1.4;
    font-weight: 500;
}

.results-lists svg {
    width: 15px !important;
    height: 15px !important;
    flex-shrink: 0;
    margin-top: 24px;
    fill: #7b6cf6 !important;
}

.progress-bars {
    flex: 0 0 230px;
    padding-top: 10px;
}

.progress-item {
    margin-bottom: 16px;
}

.progress-item h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #5ba3d0;
    margin: 0 0 9px 0;
}

.custom-progress {
    height: 15px;
    background-color: #e8f0f8 !important;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    width: 210%;
}

.custom-progress-fill {
    height: 100%;
    background-color: #6A47ED !important;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-radius: 0;
    transition: width 0.6s ease;
}

.custom-progress-fill::after {
    content: attr(data-percent);
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1;
    white-space: nowrap;
}

.project-images {
    display: flex !important;
    gap: 9px;
    margin: 40px 0 28px;
}

.project-images img {
    width: 50% !important;
    max-width: 50%;
    height: auto;
    border-radius: 6px;
    display: block;
    object-fit: cover;
}

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

/* Portátiles */
@media (max-width: 1550px) {
    .epg-wrapper {
        max-width: 85%;
        padding: 30px 20px;
    }
    .epg-grid {
        gap: 22px;
    }
}

/* Tablets grandes */
@media (max-width: 1200px) {
    .epg-wrapper {
        max-width: 90%;
        padding: 35px 20px;
    }
    .epg-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* Tablets / Móviles */
@media (max-width: 900px) {
    .project-header {
        flex-direction: column;
        gap: 24px;
    }
    .project-meta {
        text-align: left;
        margin-right: 0;
    }
    .overview-columns {
        grid-template-columns: 1fr;
    }
    .results-grid {
        flex-direction: column;
        gap: 15px;
        margin-left: 0;
        margin-right: 0;
    }
    .results-lists {
        flex-direction: column;
        gap: 8px;
        max-width: 100%;
    }
    .custom-progress {
        width: 100%;
    }
    .progress-bars {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .project-images {
        flex-direction: column;
    }
    .project-images img {
        width: 100% !important;
        max-width: 100%;
    }
    .project-single .project-title,
    .project-single h2 {
        font-size: 28px !important;
        line-height: 36px !important;
        margin-top: 28px;
    }
}

@media (max-width: 768px) {
    .epg-wrapper {
        max-width: 100%;
        padding: 25px 16px;
    }
    .epg-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .epg-filters {
        gap: 8px;
    }
    .epg-filter-btn {
        font-size: 14px;
        padding: 8px 14px;
    }
    .epg-title {
        font-size: 20px;
    }

    /* Mostrar siempre el overlay en móviles */
    .epg-overlay {
        opacity: 1;
        background: linear-gradient(
            to top,
            rgba(10,20,30,.90) 0%,
            rgba(10,20,30,.55) 45%,
            transparent 75%
        );
    }
    .epg-overlay > * {
        opacity: 1;
        transform: none;
    }

    .epg-buttons {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .epg-slide {
        flex: 0 0 100%;
        padding: 0 4px;
    }
    .epg-slide img {
        height: 260px;
    }
    .epg-prev { left: 8px; }
    .epg-next { right: 8px; }

    .epg-modal-content {
        padding: 20px 16px 28px;
    }
    .epg-modal .epg-slide img {
        height: 220px;
    }
}

@media (max-width: 480px) {
    .epg-wrapper {
        padding: 20px 12px;
    }
    .epg-grid {
        gap: 18px;
    }
    .epg-card {
        border-radius: 18px;
    }
    .epg-title {
        font-size: 18px;
    }
    .epg-tags span {
        font-size: 10px;
        padding: 4px 9px;
    }
    .epg-overlay {
        padding: 16px;
        gap: 8px;
    }
    .epg-filter-btn {
        width: 100%;
    }
}