/* MaravatíoShop V1.8 · Fondo configurable por categoría */
.category-visual-section {
    position: relative;
    isolation: isolate;
    min-height: calc(100vh - 78px);
    overflow: hidden;
    background: #f5f6ff;
}

.category-background-media {
    position: absolute;
    inset: 0;
    z-index: -3;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.category-background-overlay {
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(180deg, rgba(245, 246, 255, .70) 0%, rgba(245, 246, 255, .78) 38%, rgba(245, 246, 255, .92) 100%),
        radial-gradient(circle at 50% 4%, rgba(255, 255, 255, .20), transparent 42%);
    backdrop-filter: blur(1.2px);
}

.category-content-layer {
    position: relative;
    z-index: 1;
}

.category-heading-card {
    max-width: 940px;
    padding: 28px 30px;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 25px;
    background: rgba(255, 255, 255, .77);
    box-shadow: 0 20px 55px rgba(23, 31, 96, .13);
    backdrop-filter: blur(12px);
}

.category-heading-card h2 {
    text-shadow: 0 2px 18px rgba(255, 255, 255, .95);
}

.category-heading-card p {
    color: #4e5879;
}

.category-learning-areas {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-top: 20px;
}

.category-learning-areas span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(23, 59, 214, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .90);
    color: #172554;
    box-shadow: 0 8px 20px rgba(33, 44, 114, .08);
    font-size: .76rem;
    font-weight: 850;
}

.category-guide-grid {
    align-items: start;
}

.category-guide-grid .guide-card {
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 24px 60px rgba(34, 44, 140, .18);
    backdrop-filter: blur(6px);
}

.category-empty {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, .90);
}

/* Panel para administrar fondos */
.category-background-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.category-background-admin-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 15px 35px rgba(34, 44, 140, .09);
}

.category-background-preview {
    position: relative;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    background: linear-gradient(135deg, #dfe6ff, #fff2cc);
}

.category-background-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-background-preview span {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: 7px 10px;
    border-radius: 9px;
    background: rgba(7, 31, 119, .84);
    color: #fff;
    font-size: .7rem;
    font-weight: 900;
    backdrop-filter: blur(7px);
}

.category-background-form-body {
    padding: 18px;
}

.category-background-form-body h2 {
    margin-top: 0;
}

.category-background-default-box {
    display: grid;
    grid-template-columns: minmax(220px, 360px) 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid #dbe4ff;
    border-radius: 19px;
    background: linear-gradient(135deg, #f4f7ff, #fffdf1);
}

.category-background-default-box img {
    width: 100%;
    aspect-ratio: 16 / 8;
    object-fit: cover;
    border-radius: 14px;
}

@media (max-width: 860px) {
    .category-background-admin-grid,
    .category-background-default-box {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .category-visual-section {
        padding-top: 42px;
    }

    .category-heading-card {
        padding: 22px 16px;
    }

    .category-learning-areas {
        justify-content: stretch;
    }

    .category-learning-areas span {
        width: 100%;
        justify-content: center;
        border-radius: 12px;
        text-align: center;
    }
}
