/* =====================================================
   ПРОГИМНАЗИАЛЕН ЕТАП
   Страница: pages/progimnazia.html
===================================================== */

:root {
    --prog-green: #14865f;
    --prog-green-dark: #0f6247;
    --prog-green-light: #dff3e8;

    --prog-background: #f5f8f6;
    --prog-surface: #ffffff;
    --prog-border: #dbe7e0;

    --prog-text: #153c31;
    --prog-text-soft: #68766f;

    --prog-yellow: #f5d47b;
    --prog-purple: #b9a5df;
    --prog-blue: #a9c8ef;

    --prog-shadow:
        0 18px 48px rgba(25, 71, 55, 0.12);

    --prog-shadow-hover:
        0 26px 60px rgba(25, 71, 55, 0.17);

    --prog-radius-small: 12px;
    --prog-radius-medium: 20px;
    --prog-radius-large: 30px;
}


/* =====================================================
   ОСНОВНИ НАСТРОЙКИ
===================================================== */

body {
    background: var(--prog-background);
}

main {
    overflow: hidden;
}


/* =====================================================
   HERO СЕКЦИЯ
===================================================== */

.stage-page-hero {
    padding:
        clamp(70px, 9vw, 125px)
        0;

    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(138, 210, 165, 0.32),
            transparent 28%
        ),
        radial-gradient(
            circle at 85% 18%,
            rgba(255, 255, 255, 0.8),
            transparent 24%
        ),
        linear-gradient(
            135deg,
            #eef8f1,
            #d7f0e1
        );
}

.stage-page-hero-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.05fr)
        minmax(360px, 0.95fr);

    align-items: center;
    gap: clamp(45px, 8vw, 110px);
}

.stage-page-hero-content {
    position: relative;
    z-index: 2;
}

.stage-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 25px;

    color: var(--prog-green-dark);
    text-decoration: none;

    font-size: 0.9rem;
    font-weight: 800;

    transition:
        transform 0.25s ease,
        color 0.25s ease;
}

.stage-back-link:hover {
    color: var(--prog-green);
    transform: translateX(-4px);
}

.stage-page-hero h1 {
    max-width: 760px;
    margin: 0;

    color: var(--prog-text);

    font-size: clamp(3rem, 6vw, 6.2rem);
    line-height: 0.96;
    letter-spacing: -0.06em;
}

.stage-page-description {
    max-width: 700px;
    margin: 26px 0 0;

    color: var(--prog-text-soft);

    font-size: clamp(1.04rem, 1.4vw, 1.24rem);
    line-height: 1.7;
}

.stage-page-actions {
    margin-top: 34px;

    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}


/* =====================================================
   HERO ИЛЮСТРАЦИЯ
===================================================== */

.stage-page-visual {
    min-height: 440px;

    display: grid;
    place-items: center;
}

.lower-stage-illustration {
    position: relative;

    width: min(470px, 90vw);
    aspect-ratio: 1 / 1;

    overflow: hidden;

    border: 14px solid rgba(255, 255, 255, 0.92);
    border-radius: 42px;

    background:
        linear-gradient(
            rgba(255, 255, 255, 0.2) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.2) 1px,
            transparent 1px
        ),
        linear-gradient(
            145deg,
            #63bd89,
            #a6dbba
        );

    background-size:
        34px 34px,
        34px 34px,
        auto;

    box-shadow: var(--prog-shadow);

    transform: rotate(2deg);
}

.lower-stage-shape {
    position: absolute;

    width: 105px;
    height: 105px;

    display: grid;
    place-items: center;

    border: 3px solid rgba(21, 60, 49, 0.55);
    border-radius: 26px;

    background: rgba(255, 255, 255, 0.62);
    color: var(--prog-text);

    font-size: 3.1rem;
    font-weight: 900;

    backdrop-filter: blur(7px);
}

.shape-triangle {
    left: 11%;
    top: 12%;

    transform: rotate(-7deg);
}

.shape-square {
    right: 10%;
    top: 18%;

    transform: rotate(7deg);
}

.shape-circle {
    left: 34%;
    bottom: 13%;

    transform: rotate(-3deg);
}

.lower-stage-formula {
    position: absolute;
    right: 9%;
    bottom: 20%;

    padding: 14px 18px;

    border-radius: 16px;

    background: rgba(255, 255, 255, 0.78);
    color: var(--prog-text);

    font-size: 1.3rem;
    font-weight: 900;

    box-shadow:
        0 12px 26px rgba(20, 80, 58, 0.12);
}

.lower-stage-grid-lines {
    position: absolute;
    left: 8%;
    bottom: 8%;

    width: 120px;
    height: 85px;

    opacity: 0.45;

    background:
        linear-gradient(
            rgba(21, 60, 49, 0.55) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(21, 60, 49, 0.55) 1px,
            transparent 1px
        );

    background-size: 18px 18px;
}


/* =====================================================
   ИЗБОР НА КЛАС
===================================================== */

.grade-navigation {
    padding: 90px 0;
    background: var(--prog-surface);
}

.grade-button-grid {
    margin-top: 42px;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.grade-navigation-card {
    min-height: 125px;
    padding: 22px;

    display: flex;
    align-items: center;
    gap: 18px;

    border: 1px solid var(--prog-border);
    border-radius: var(--prog-radius-medium);

    background: var(--prog-surface);
    color: var(--prog-text);
    text-decoration: none;

    box-shadow:
        0 12px 28px rgba(25, 71, 55, 0.07);

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.grade-navigation-card:hover {
    transform: translateY(-5px);

    border-color: rgba(20, 134, 95, 0.38);

    box-shadow:
        0 18px 38px rgba(25, 71, 55, 0.12);
}

.grade-navigation-card-active {
    border-color: rgba(20, 134, 95, 0.42);
    background: var(--prog-green-light);
}

.grade-navigation-number {
    flex: 0 0 62px;

    width: 62px;
    height: 62px;

    display: grid;
    place-items: center;

    border-radius: 18px;

    background: var(--prog-green);
    color: white;

    font-size: 1.65rem;
    font-weight: 900;
}

.grade-navigation-card strong,
.grade-navigation-card small {
    display: block;
}

.grade-navigation-card strong {
    font-size: 1.12rem;
}

.grade-navigation-card small {
    margin-top: 5px;
    color: var(--prog-text-soft);
}


/* =====================================================
   ФИЛТРИ
===================================================== */

.resource-filter-section {
    padding: 24px 0;

    background: #edf4ef;

    border-top: 1px solid var(--prog-border);
    border-bottom: 1px solid var(--prog-border);
}

.resource-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.resource-filter-title {
    margin-right: 8px;

    color: var(--prog-text);
    font-weight: 900;
}

.resource-filter-button {
    padding: 10px 15px;

    border: 1px solid var(--prog-border);
    border-radius: 999px;

    background: white;
    color: var(--prog-text);

    font-size: 0.86rem;
    font-weight: 800;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.resource-filter-button:hover {
    transform: translateY(-2px);
    border-color: var(--prog-green);
}

.resource-filter-button.active {
    border-color: var(--prog-green);
    background: var(--prog-green);
    color: white;
}


/* =====================================================
   СЕКЦИИ ПО КЛАСОВЕ
===================================================== */

.grade-resources-section {
    padding: 95px 0;
}

.grade-resources-highlight {
    background:
        linear-gradient(
            180deg,
            #f1f8f4,
            #e9f5ed
        );
}

.grade-section-heading {
    margin-bottom: 38px;

    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 30px;
}

.grade-section-heading h2 {
    margin: 0;

    color: var(--prog-text);

    font-size: clamp(2.3rem, 4.5vw, 4.4rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.grade-resource-count {
    padding: 9px 14px;

    border: 1px solid var(--prog-border);
    border-radius: 999px;

    background: white;
    color: var(--prog-green-dark);

    font-size: 0.82rem;
    font-weight: 900;
}


/* =====================================================
   ПРАЗНО СЪСТОЯНИЕ ЗА 5. КЛАС
===================================================== */

.empty-grade-state {
    padding: 35px;

    display: flex;
    align-items: center;
    gap: 25px;

    border: 1px dashed rgba(20, 134, 95, 0.35);
    border-radius: var(--prog-radius-medium);

    background: rgba(255, 255, 255, 0.7);
}

.empty-grade-symbol {
    flex: 0 0 82px;

    width: 82px;
    height: 82px;

    display: grid;
    place-items: center;

    border-radius: 24px;

    background: var(--prog-green-light);
    color: var(--prog-green);

    font-size: 2rem;
    font-weight: 900;
}

.empty-grade-state h3 {
    margin: 0;
}

.empty-grade-state p {
    margin:
        8px
        0
        0;

    color: var(--prog-text-soft);
}


/* =====================================================
   КАРТИ С РЕСУРСИ
===================================================== */

.stage-resource-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 22px;
}

.stage-resource-card {
    overflow: hidden;

    border: 1px solid var(--prog-border);
    border-radius: 24px;

    background: var(--prog-surface);

    box-shadow:
        0 14px 34px rgba(25, 71, 55, 0.09);

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.stage-resource-card:hover {
    transform: translateY(-7px);

    border-color: rgba(20, 134, 95, 0.35);

    box-shadow: var(--prog-shadow-hover);
}

.stage-resource-image {
    position: relative;

    min-height: 235px;

    display: block;
    overflow: hidden;

    text-decoration: none;
}

.stage-resource-grade {
    position: absolute;
    left: 20px;
    bottom: 18px;
    z-index: 5;

    padding: 7px 12px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.92);
    color: var(--prog-text);

    font-size: 0.78rem;
    font-weight: 900;
}

.interactive-resource-badge,
.download-resource-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 5;

    padding: 7px 11px;

    border-radius: 999px;

    font-size: 0.74rem;
    font-weight: 900;
}

.interactive-resource-badge {
    background: var(--prog-green);
    color: white;
}

.download-resource-badge {
    background: rgba(255, 255, 255, 0.88);
    color: var(--prog-text);
}

.eco-park-resource-image {
    background-image: url("../images/products/stem_eko-park.webp");
    background-size: cover;
    background-position: center;
}

.medallion-resource-image {
    background-image: url("../images/products/medalyon.png");
    background-size: cover;
    background-position: center;
}

.excursion-resource-image {
    background-image: url("../images/products/stem_ekskurzia.avif");
    background-size: cover;
    background-position: center;
}

.mission-resource-image {
    background:
        radial-gradient(circle at 22% 30%, rgba(123, 44, 191, 0.55), transparent 42%),
        radial-gradient(circle at 70% 60%, rgba(230, 126, 34, 0.5), transparent 45%),
        radial-gradient(circle at 45% 85%, rgba(0, 137, 123, 0.55), transparent 45%),
        linear-gradient(135deg, #123a2f 0%, #0d5c43 100%);
}


/* =====================================================
   МАЛКА КАРТА НА ЕКО ПАРКА
===================================================== */

.eco-park-mini-map {
    position: absolute;
    inset: 30px;

    overflow: hidden;

    border: 8px solid rgba(255, 255, 255, 0.82);
    border-radius: 22px;

    background: #9bd279;

    transform: rotate(2deg);

    box-shadow:
        0 16px 32px rgba(27, 83, 60, 0.18);
}

.mini-lake {
    position: absolute;
    left: 9%;
    top: 10%;

    width: 29%;
    aspect-ratio: 1;

    border: 6px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;

    background: #62bbe6;
}

.mini-playground {
    position: absolute;
    right: 10%;
    top: 11%;

    width: 31%;
    height: 31%;

    clip-path:
        polygon(
            50% 0,
            100% 38%,
            82% 100%,
            18% 100%,
            0 38%
        );

    background: #f4cd62;
}

.mini-flower-zone {
    position: absolute;
    left: 34%;
    bottom: 9%;

    width: 31%;
    height: 27%;

    clip-path:
        polygon(
            50% 0,
            100% 100%,
            0 100%
        );

    background: #ef8f9d;
}

.mini-path {
    position: absolute;
    background: #eee0c8;
}

.mini-path-one {
    left: 45%;
    top: 0;

    width: 11%;
    height: 100%;
}

.mini-path-two {
    left: 0;
    top: 46%;

    width: 100%;
    height: 11%;
}


/* =====================================================
   СЪДЪРЖАНИЕ НА РЕСУРСНИТЕ КАРТИ
===================================================== */

.stage-resource-content {
    padding: 24px;
}

.stage-resource-content h3 {
    margin:
        6px
        0
        0;

    color: var(--prog-text);

    font-size: 1.45rem;
    letter-spacing: -0.025em;
}

.stage-resource-content .resource-description {
    min-height: 92px;
}

.resource-tags {
    margin-top: 20px;

    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.resource-tags span {
    padding: 6px 9px;

    border-radius: 999px;

    background: var(--prog-green-light);
    color: var(--prog-green-dark);

    font-size: 0.72rem;
    font-weight: 800;
}

.stage-resource-footer {
    margin-top: 24px;
    padding-top: 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    border-top: 1px solid var(--prog-border);
}

.resource-access,
.resource-price {
    color: var(--prog-text);
    font-weight: 900;
}

.resource-open-link {
    color: var(--prog-green);
    text-decoration: none;
    font-weight: 900;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}

.resource-open-link:hover {
    color: var(--prog-green-dark);
    transform: translateX(4px);
}


/* =====================================================
   ПРЕДСТОЯЩИ РЕСУРСИ ЗА 7. КЛАС
===================================================== */

.coming-resources-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.coming-resource-card {
    min-height: 210px;
    padding: 28px;

    border: 1px solid var(--prog-border);
    border-radius: var(--prog-radius-medium);

    background:
        linear-gradient(
            145deg,
            white,
            #f3f8f5
        );
}

.coming-resource-label {
    display: inline-block;

    margin-bottom: 38px;
    padding: 6px 10px;

    border-radius: 999px;

    background: var(--prog-green-light);
    color: var(--prog-green-dark);

    font-size: 0.72rem;
    font-weight: 900;
}

.coming-resource-card h3 {
    margin: 0;
}

.coming-resource-card p {
    margin:
        9px
        0
        0;

    color: var(--prog-text-soft);
}


/* =====================================================
   АБОНАМЕНТ
===================================================== */

.stage-subscription {
    padding:
        40px
        0
        100px;
}

.stage-subscription-box {
    padding:
        clamp(34px, 5vw, 60px);

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;

    border-radius: var(--prog-radius-large);

    background:
        radial-gradient(
            circle at 90% 20%,
            rgba(255, 255, 255, 0.35),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #174c3b,
            #13815d
        );

    color: white;

    box-shadow: var(--prog-shadow);
}

.stage-subscription-box h2 {
    max-width: 700px;
    margin: 0;

    font-size: clamp(2rem, 4vw, 3.7rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.stage-subscription-box p:not(.eyebrow) {
    max-width: 650px;

    color: rgba(255, 255, 255, 0.78);
}

.stage-subscription-box .eyebrow {
    color: #bceacf;
}

.stage-subscription-box .button-primary {
    flex: 0 0 auto;

    background: white;
    color: var(--prog-green-dark);
}

.stage-subscription-box .button-primary:hover {
    background: #edf8f1;
}


/* =====================================================
   ФИЛТРИРАНЕ ЧРЕЗ JAVASCRIPT
===================================================== */

.stage-resource-card.hidden {
    display: none;
}


/* =====================================================
   АДАПТАЦИЯ ЗА ТАБЛЕТ
===================================================== */

@media (max-width: 1050px) {

    .stage-page-hero-grid {
        grid-template-columns: 1fr;
    }

    .stage-page-hero-content {
        min-width: 0;
        text-align: center;
    }

    .stage-page-description {
        margin-left: auto;
        margin-right: auto;
    }

    .stage-page-actions {
        justify-content: center;
    }

    .grade-button-grid,
    .stage-resource-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .grade-navigation-card:last-child,
    .stage-resource-card:nth-child(3):last-child {
        grid-column: span 2;
    }

}


/* =====================================================
   АДАПТАЦИЯ ЗА ТЕЛЕФОН
===================================================== */

@media (max-width: 720px) {

    .stage-page-hero {
        padding:
            65px
            0;
    }

    .stage-page-hero h1 {
        font-size: clamp(3rem, 14vw, 5rem);
        overflow-wrap: break-word;
    }

    .stage-page-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .stage-page-actions .button {
        width: 100%;
    }

    .stage-page-visual {
        min-height: 350px;
    }

    .lower-stage-illustration {
        border-width: 9px;
        border-radius: 28px;
    }

    .lower-stage-shape {
        width: 76px;
        height: 76px;

        border-radius: 20px;

        font-size: 2.2rem;
    }

    .grade-button-grid,
    .stage-resource-grid,
    .coming-resources-grid {
        grid-template-columns: 1fr;
    }

    .grade-navigation-card:last-child,
    .stage-resource-card:last-child {
        grid-column: auto;
    }

    .grade-section-heading,
    .stage-subscription-box {
        align-items: stretch;
        flex-direction: column;
    }

    .resource-filter-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .resource-filter-button {
        width: 100%;
    }

    .empty-grade-state {
        align-items: flex-start;
        flex-direction: column;
    }

    .stage-subscription-box .button {
        width: 100%;
    }

}