/* ═══════════════════════════════════════════════════
   MetaLogic — Catálogo de Sitios Web
   Styles específicos de catalogo.html
   ═══════════════════════════════════════════════════ */

/* ══ HERO DEL CATÁLOGO ══════════════════════════════ */
.cat-hero {
    position: relative;
    padding: 160px 0 80px;
    overflow: hidden;
    background: var(--bg-dark);
}

/* Slim variant: when only the section-tag is shown */
.cat-hero--slim {
    padding: 140px 0 48px;
}

.cat-hero--slim .cat-hero-tag {
    font-size: 1rem;
    letter-spacing: 0.06em;
}

.cat-hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(110, 193, 228, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(110, 193, 228, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black 40%, transparent 100%);
}

.cat-hero .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.cat-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-family: var(--font-code);
}

.cat-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--sky-blue);
    transition: var(--transition);
}

.cat-breadcrumb a:hover {
    color: var(--text-primary);
}

.cat-breadcrumb .material-icons-round {
    font-size: 0.9rem;
}

.bread-sep {
    font-size: 1rem;
    color: var(--text-muted);
}

.cat-hero-title {
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 16px 0 20px;
}

.cat-hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin: 0 auto 48px;
    line-height: 1.7;
}

/* Stats row */
.cat-stats {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px 32px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.cat-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px;
}

.cat-stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.cat-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-code);
}

.cat-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--glass-border);
    flex-shrink: 0;
}

/* ══ SECCIÓN PRINCIPAL ══════════════════════════════ */
.cat-section {
    padding-top: 60px;
    background: var(--bg-section);
}

/* ══ FILTROS ════════════════════════════════════════ */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 56px;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    transition: var(--transition);
    white-space: nowrap;
}

.filter-pill:hover {
    border-color: var(--sky-blue);
    color: var(--text-primary);
    background: rgba(110, 193, 228, 0.06);
}

.filter-pill.active {
    background: linear-gradient(135deg, var(--cognitive-blue), var(--neural-purple));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 20px rgba(63, 143, 210, 0.35);
}

/* ══ GRID DE PROYECTOS ══════════════════════════════ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* ══ TARJETA DE PROYECTO ════════════════════════════ */
.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(110, 193, 228, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(110, 193, 228, 0.1);
}

.project-card:focus-visible {
    outline: 2px solid var(--sky-blue);
    outline-offset: 3px;
    transform: translateY(-4px);
    border-color: rgba(110, 193, 228, 0.4);
}

/* Preview area */
.card-preview {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.6s ease;
}

/* Imagen rota: se oculta y queda visible el gradiente + emoji de fondo */
.card-thumb.img-broken {
    display: none;
}

.project-card:hover .card-thumb {
    transform: scale(1.06);
}

.card-preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Only show icon when no image is visible */
    pointer-events: none;
}

/* Show emoji icon when no thumbnail is loaded
   (img is hidden via onerror → parent overlay becomes visible) */
.card-preview-overlay .card-preview-icon {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5));
    opacity: 0.85;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

/* When thumbnail IS visible, hide the fallback icon */
.card-preview:has(.card-thumb:not([style*="display: none"])) .card-preview-icon {
    opacity: 0;
}

.project-card:hover .card-preview-icon {
    transform: scale(1.1);
}

/* Tech badge (React App, etc.) */
.card-tech-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-code);
    background: linear-gradient(135deg, var(--cognitive-blue), var(--neural-purple));
    color: #fff;
    letter-spacing: 0.04em;
    z-index: 2;
    box-shadow: 0 2px 12px rgba(63, 143, 210, 0.5);
}

/* Card body */
.card-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

/* Category badges */
.card-category {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-code);
    padding: 3px 10px;
    border-radius: 50px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cat-automotriz  { background: rgba(30, 78, 122, 0.35); color: #6EC1E4; border: 1px solid rgba(30,78,122,0.6); }
.cat-ecommerce   { background: rgba(74, 27, 107, 0.35); color: #C084FC; border: 1px solid rgba(74,27,107,0.6); }
.cat-marca       { background: rgba(101, 40, 0, 0.4);   color: #FB923C; border: 1px solid rgba(101,40,0,0.7); }
.cat-restaurante { background: rgba(120, 20, 10, 0.35); color: #F87171; border: 1px solid rgba(120,20,10,0.6); }
.cat-salud       { background: rgba(10, 80, 80, 0.35);  color: #34D399; border: 1px solid rgba(10,80,80,0.6); }
.cat-turismo     { background: rgba(15, 50, 100, 0.35); color: #60A5FA; border: 1px solid rgba(15,50,100,0.6); }

/* Stack tags */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-code);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
}

.tag-special {
    background: rgba(63, 143, 210, 0.12);
    border-color: rgba(63, 143, 210, 0.3);
    color: var(--sky-blue);
}

/* Card title and description */
.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    flex: 1;
    margin-bottom: 4px;
}

/* CTA button inside card */
.card-cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    font-size: 0.88rem;
    border-radius: 50px;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    transition: var(--transition);
    font-weight: 600;
    align-self: flex-start;
}

.card-cta:hover {
    border-color: var(--sky-blue);
    background: rgba(110, 193, 228, 0.08);
    color: var(--sky-blue);
    transform: translateX(3px);
}

.card-cta .material-icons-round {
    font-size: 0.9rem;
}

/* ══ FILTRO MÓVIL (select desplegable) ════════════ */
.filter-select {
    display: none; /* hidden on desktop — shown via media query */
}

/* Estado vacío */
.filter-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 80px 20px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.filter-empty .material-icons-round {
    font-size: 3rem;
    opacity: 0.4;
}

.filter-empty p {
    font-size: 1rem;
}

/* ══ CTA FINAL ══════════════════════════════════════ */
.cat-cta-section {
    padding: 80px 0 100px;
    background: var(--bg-section);
}

.cat-cta-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 48px 56px;
}

.cat-cta-content .section-tag {
    margin-bottom: 12px;
}

.cat-cta-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    margin: 12px 0 16px;
    line-height: 1.2;
}

.cat-cta-content p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.cat-cta-actions {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ══ RESPONSIVE ═════════════════════════════════════ */

/* Below 1024px: 2 columns */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }

    .cat-cta-box {
        flex-direction: column;
        text-align: center;
        padding: 40px 32px;
    }

    .cat-cta-actions {
        justify-content: center;
    }
}

/* Below 768px: 1 column, compact hero */
@media (max-width: 768px) {
    .cat-hero {
        padding: 120px 0 56px;
    }

    .cat-hero-title {
        font-size: 2rem;
    }

    .cat-hero-desc {
        font-size: 1rem;
    }

    .cat-stats {
        padding: 14px 20px;
        gap: 0;
    }

    .cat-stat {
        padding: 0 14px;
    }

    .cat-stat-num {
        font-size: 1.4rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-preview {
        height: auto;
        aspect-ratio: 16 / 10;
    }

    .filter-row {
        margin-bottom: 36px;
        gap: 8px;
    }

    .filter-pill {
        padding: 8px 16px;
        font-size: 0.84rem;
    }

    .cat-cta-box {
        padding: 32px 24px;
    }

    .cat-cta-actions {
        flex-direction: column;
        width: 100%;
    }

    .cat-cta-actions .btn {
        justify-content: center;
        width: 100%;
    }
}

/* Below 480px: extra compact adjustments */
@media (max-width: 480px) {
    .cat-stats {
        flex-wrap: wrap;
        gap: 8px 0;
        padding: 14px 16px;
    }

    .cat-stat-divider {
        display: none;
    }

    .cat-stat {
        padding: 6px 16px;
        flex: 1 0 33%;
    }

    .cat-hero-title {
        font-size: 1.8rem;
    }

    .card-body {
        padding: 16px 16px 18px;
    }

    .card-title {
        font-size: 1.05rem;
    }
}
/* ── Mobile filter: swap pills for a select dropdown ── */
@media (max-width: 640px) {
    .filter-row {
        display: none;
    }

    .filter-select {
        display: block;
        width: 100%;
        padding: 12px 20px;
        margin-bottom: 28px;
        border-radius: 50px;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        color: var(--text-primary);
        font-family: var(--font-primary);
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        outline: none;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='%236EC1E4'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 16px center;
        padding-right: 44px;
        transition: border-color var(--transition), box-shadow var(--transition);
    }

    .filter-select:focus,
    .filter-select:hover {
        border-color: var(--sky-blue);
        box-shadow: 0 0 0 3px rgba(110, 193, 228, 0.12);
    }

    .filter-select option {
        background: #0f1022;
        color: var(--text-primary);
    }
}