/* Подарочные сертификаты MDA — /catalog/sertifikaty/ */

.mdacert {
    --c: var(--theme-base-color, #a855f7);
    --ink: #0e0b12;
    --card: #17131d;
    --text: #f6f3fa;
    --muted: rgba(246, 243, 250, .58);
    --line: rgba(246, 243, 250, .12);

    position: relative;
    margin: 0 auto 60px;
    padding: 0 16px;
    max-width: 1280px;
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    /* шаблон местами центрирует текст — сбрасываем на своей территории */
    text-align: left;
}

.mdacert a { color: inherit; }

/* шаблон рисует «—» перед каждым li — на своих списках убираем */
.mdacert li::before { content: none !important; padding-right: 0; }

/* ---------- карта ---------- */

.mdacert-card {
    container-type: inline-size;
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 6cqw;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(168, 85, 247, .55) 0%, rgba(168, 85, 247, 0) 62%),
        radial-gradient(90% 70% at 0% 100%, rgba(168, 85, 247, .30) 0%, rgba(168, 85, 247, 0) 60%),
        var(--card);
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(255, 255, 255, .06);
    isolation: isolate;
}

/* зернистость как на печатной карте */
.mdacert-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
}

.mdacert-card__word {
    position: absolute;
    top: 13cqw;
    left: 6cqw;
    right: 4cqw;
    display: flex;
    flex-direction: column;
    font-size: 17cqw;
    font-weight: 800;
    line-height: .92;
    letter-spacing: -.035em;
    text-align: left;
    white-space: nowrap;
}

/* обратная сторона — для стопки в герое */
.mdacert-card--blank {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(120% 100% at 20% 0%, rgba(168, 85, 247, .5) 0%, rgba(168, 85, 247, 0) 65%),
        #1a1522;
}

.mdacert-card__brand {
    color: rgba(255, 255, 255, .9);
    font-size: 17cqw;
    font-weight: 800;
    letter-spacing: .06em;
}

.mdacert-card__pill {
    position: absolute;
    top: 4cqw;
    left: 4cqw;
    z-index: 2;
    padding: 1.4cqw 4cqw;
    border-radius: 100px;
    background: var(--c);
    color: #fff;
    font-size: 3.9cqw;
    font-weight: 700;
    letter-spacing: .01em;
    text-transform: uppercase;
    transform: rotate(-9deg);
    box-shadow: 0 6px 20px -6px rgba(168, 85, 247, .8);
}

.mdacert-card__sum {
    position: absolute;
    left: 7cqw;
    top: 44cqw;
    font-size: 20cqw;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.045em;
}

.mdacert-card__sum i {
    font-style: normal;
    font-size: .72em;
    letter-spacing: -.06em;
}

.mdacert-card__foot {
    position: absolute;
    left: 7cqw;
    right: 7cqw;
    bottom: 7cqw;
    display: flex;
    gap: 4cqw;
    align-items: flex-end;
}

.mdacert-qr {
    flex: 0 0 auto;
    width: 22cqw;
    height: 22cqw;
    padding: 1.2cqw;
    border-radius: 1.5cqw;
    background: #fff;
}

.mdacert-card__legal { min-width: 0; }

.mdacert-card__code {
    display: inline-block;
    margin-bottom: 1.6cqw;
    padding: 1.4cqw 5cqw;
    border-radius: 100px;
    background: rgba(255, 255, 255, .92);
    color: #3a3342;
    font-size: 3.6cqw;
    font-weight: 500;
    letter-spacing: .04em;
}

.mdacert-card__legal p {
    margin: 0;
    color: rgba(255, 255, 255, .62);
    font-size: 2.5cqw;
    line-height: 1.35;
}

/* на мелкой карте юр-подпись превращается в кашу — убираем */
@container (max-width: 360px) {
    .mdacert-card__legal p { display: none; }
    .mdacert-card__code { margin-bottom: 0; font-size: 4.4cqw; }
    .mdacert-card__foot { align-items: center; }
}

/* ---------- герой ---------- */

.mdacert-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 56px;
    align-items: center;
    margin: 8px 0 72px;
    padding: 56px 48px;
    border-radius: 28px;
    background:
        radial-gradient(80% 120% at 88% 10%, rgba(168, 85, 247, .38) 0%, rgba(168, 85, 247, 0) 60%),
        var(--ink);
    overflow: hidden;
}

.mdacert-hero__pill {
    display: inline-block;
    margin-bottom: 18px;
    padding: 8px 20px;
    border-radius: 100px;
    background: var(--c);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.mdacert-hero__title {
    margin: 0 0 18px;
    color: var(--text);
    font-size: clamp(34px, 4.4vw, 62px);
    font-weight: 800;
    line-height: .98;
    letter-spacing: -.03em;
    text-transform: uppercase;
}

.mdacert-hero__lead {
    max-width: 480px;
    margin: 0 0 26px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.55;
}

.mdacert-hero__sums {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 30px;
    padding: 0;
    list-style: none;
}

.mdacert-hero__sums a {
    display: block;
    padding: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 100px;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color .2s, background-color .2s;
}

.mdacert-hero__sums a:hover {
    border-color: var(--c);
    background: rgba(168, 85, 247, .16);
}

.mdacert-hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.mdacert-hero__stack {
    position: relative;
    aspect-ratio: 1 / .88;
}

.mdacert-hero__stack .mdacert-card {
    position: absolute;
    width: 70%;
    transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}

.mdacert-card--back  { top: 2%;  left: 1%;  transform: rotate(-12deg); opacity: .7; }
.mdacert-card--mid   { top: 9%;  left: 11%; transform: rotate(-6deg); opacity: .85; }
.mdacert-card--front { top: 17%; left: 25%; transform: rotate(4deg); }

.mdacert-hero__stack:hover .mdacert-card--back  { transform: rotate(-16deg) translateY(-2%); }
.mdacert-hero__stack:hover .mdacert-card--front { transform: rotate(7deg) translateY(-3%); }

/* ---------- кнопки ---------- */

.mdacert-btn {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 100px;
    background: var(--c);
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    transition: filter .2s, transform .2s;
}

.mdacert-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.mdacert-btn--ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.mdacert-btn--ghost:hover { background: rgba(168, 85, 247, .14); }
.mdacert-btn--sm { padding: 11px 20px; font-size: 14px; }
.mdacert-btn--lg { padding: 18px 40px; font-size: 18px; }

/* ---------- секции ---------- */

.mdacert-section { margin-bottom: 72px; }

.mdacert-h2 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: clamp(26px, 3vw, 40px);
    font-weight: 800;
    letter-spacing: -.02em;
    text-transform: uppercase;
}

.mdacert-sub {
    margin: 0 0 32px;
    color: var(--muted);
    font-size: 16px;
}

.mdacert-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.mdacert-item .mdacert-card {
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}

.mdacert-item:hover .mdacert-card { transform: translateY(-6px) rotate(-1.5deg); }

.mdacert-item__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

.mdacert-item__foot b {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.01em;
}

/* шаги */

.mdacert-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.mdacert-steps li {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .02);
}

.mdacert-steps span {
    display: block;
    margin-bottom: 14px;
    color: var(--c);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .1em;
}

.mdacert-steps b { display: block; margin-bottom: 8px; font-size: 19px; font-weight: 700; }
.mdacert-steps p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }

/* условия */

.mdacert-terms ul {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.mdacert-terms li {
    padding: 22px 24px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(168, 85, 247, .16), rgba(168, 85, 247, .04));
}

.mdacert-terms b { display: block; margin-bottom: 6px; font-size: 22px; font-weight: 800; }
.mdacert-terms span { color: var(--muted); font-size: 15px; line-height: 1.45; }
.mdacert-note { margin: 0; color: var(--muted); font-size: 13px; }

/* финальный блок */

.mdacert-final {
    padding: 56px 40px;
    border-radius: 28px;
    text-align: center;
    background:
        radial-gradient(70% 140% at 50% 0%, rgba(168, 85, 247, .42) 0%, rgba(168, 85, 247, 0) 65%),
        var(--ink);
}

.mdacert-final h2 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: clamp(26px, 3.4vw, 42px);
    font-weight: 800;
    letter-spacing: -.02em;
    text-transform: uppercase;
}

.mdacert-final p { margin: 0 auto 28px; max-width: 520px; color: var(--muted); font-size: 16px; }

/* ---------- адаптив ---------- */

@media (max-width: 1100px) {
    .mdacert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* три шага в два столбца дают сиротливый третий — переводим в один */
@media (max-width: 900px) {
    .mdacert-steps { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .mdacert-hero {
        grid-template-columns: 1fr;
        padding: 36px 24px 28px;
    }

    .mdacert-hero__stack {
        order: -1;
        width: 100%;
        max-width: 420px;
        margin: 0 auto 8px;
        aspect-ratio: 1 / .8;
    }

    .mdacert-final { padding: 40px 22px; }
}

@media (max-width: 560px) {
    .mdacert { padding: 0 12px; }
    .mdacert-grid { gap: 16px; }
    .mdacert-item__foot { flex-direction: column; align-items: stretch; text-align: center; }
    .mdacert-hero__cta .mdacert-btn { flex: 1 1 auto; text-align: center; }
    .mdacert-steps li, .mdacert-terms li { padding: 20px; }
}

@media (max-width: 420px) {
    .mdacert-grid { grid-template-columns: minmax(0, 1fr); }
}
