.ads-plan-options {
    padding: 24px;
    background: linear-gradient(145deg,rgba(8,18,40,.96),rgba(5,13,32,.9))
}

.ads-payment-info {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: linear-gradient(135deg,rgba(8,20,48,.98),rgba(25,11,48,.94));
    box-shadow: 0 0 28px rgba(39,231,255,.16)
}

.ads-duration-picker {
    padding: 24px;
    background: linear-gradient(145deg,rgba(8,18,40,.96),rgba(5,13,32,.9))
}

.ads-duration-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 12px;
    color: var(--text);
    font-size: 18px;
    font-weight: 800
}

.ads-duration-list {
    display: flex;
    flex-direction: column;
    gap: 15px
}

.ads-duration-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px 22px;
    border-radius: 14px;
    background: linear-gradient(105deg,rgba(5,13,32,.96),rgba(8,18,40,.84));
    transition: opacity 0.3s ease, transform 0.3s ease
}

.ads-duration-card.neon-frame::before {
    padding: 1px
}

.ads-duration-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--text);
    font-size: 18px;
    font-weight: 800
}

.ads-duration-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    color: var(--text);
    font-size: 16px;
    font-weight: 600
}

.ads-duration-copy span {
    white-space: nowrap;
}

.ads-duration-price {
    font-size: 20px;
    white-space: nowrap;
    min-width: 160px;
    text-align: center;
    padding: 8px 16px;
    border: 1px solid currentColor;
    border-radius: 10px
}

.ads-duration-pay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 132px;
    align-self: center;
    padding: 8px 14px;
    border: 1px solid currentColor;
    border-radius: 10px;
    color: var(--cyan);
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 0 12px currentColor
}

button.ads-duration-pay {
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.ads-duration-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: min(100%, 360px);
    margin: 10px auto 10px;
    padding: 12px 24px;
    border: 1px solid rgba(255,59,59,.9);
    border-radius: 12px;
    background: linear-gradient(105deg,rgba(5,13,32,.96),rgba(8,18,40,.84));
    color: #ff3b3b;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(255,59,59,.28);
    transition: all 0.2s ease
}

.ads-duration-back:hover { border-color: #ff6b6b; color: #ff6b6b; box-shadow: 0 0 16px rgba(255,59,59,.42) }

.ads-duration-back[hidden] { display: none }

:root.light-theme .ads-duration-back {
    background: var(--surface);
    color: #d62828;
    border-color: rgba(214,40,40,.72);
    box-shadow: 0 6px 16px rgba(214,40,40,.16)
}

:root.light-theme .ads-duration-back:hover {
    border-color: #b71c1c;
    color: #b71c1c;
    box-shadow: 0 6px 16px rgba(183,28,28,.24)
}

.ads-payment-slip {
    width: 100%;
    padding: 22px 24px 18px;
    border: 1px solid rgba(87,225,255,.45);
    border-radius: 18px;
    text-align: center;
    color: var(--text);
    font-size: 14px;
    background: linear-gradient(145deg,rgba(7,18,42,.96),rgba(11,27,58,.78));
    box-shadow: inset 0 0 24px rgba(39,231,255,.08)
}

.ads-payment-header {
    display: flex;
    align-items: center;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 18px;
    text-align: right
}

.ads-payment-header h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(20px,3vw,28px)
}

.ads-payment-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px
}

.ads-payment-badge {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--cyan);
    border-radius: 13px;
    color: var(--cyan);
    font-size: 23px;
    box-shadow: 0 0 16px rgba(39,231,255,.35)
}

.ads-payment-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    direction: ltr;
    align-items: center
}

.ads-payment-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 16px;
    direction: rtl
}

.ads-payment-detail + .ads-payment-detail {
    border-inline-start: 1px solid rgba(210,225,245,.5)
}

.ads-payment-detail strong {
    font-size: clamp(13px,1.8vw,18px);
    font-weight: 500;
    letter-spacing: .04em;
    white-space: nowrap
}

.ads-payment-detail span {
    font-size: 13px;
    color: var(--muted)
}

.ads-payment-note {
    margin: 16px 0 0;
    padding-top: 12px;
    border-top: 1px solid rgba(210,225,245,.28);
    font-size: clamp(11px,1.5vw,15px);
    color: var(--muted)
}

.ads-payment-receipt {
    display: flex;
    align-items: center;
    justify-content: right;
    gap: 8px;
    margin: 12px 0 0;
    padding: 11px 14px;
    border: 1px solid rgba(255,190,55,.5);
    border-radius: 11px;
    background: rgba(255,174,0,.1);
    color: #ffd166;
    font-size: clamp(12px,1.5vw,15px);
    font-weight: 800
}

.ads-payment-receipt span {
    font-size: 18px
}

.ads-plan-panel {
    display: none;
    flex-direction: column;
    gap: 15px
}

.ads-plan-panel.is-visible {
    display: flex
}

.ads-plan-option {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 22px;
    background: linear-gradient(105deg,rgba(5,13,32,.96),rgba(8,18,40,.84));
    border-color: rgba(130,160,210,.28);
    box-shadow: inset 0 0 28px rgba(22,54,104,.16);
    transition: opacity 0.3s ease, transform 0.3s ease
}

.ads-plan-option.neon-frame::before {
    padding: 1px
}

.ads-plan-option-header {
    display: flex;
    width:100%;
    align-items: center;
    justify-content: space-between;
    gap: 20px
}

.ads-plan-description {
    flex: 1;
    text-align: right
}

.ads-plan-price {
    position: relative;
    display: grid;
    place-items: center;
    padding: 8px 16px;
    border: 1px solid currentColor;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    white-space: nowrap;
    min-width: 160px
}

.ads-plan-option.neon-cyan .ads-plan-price,
.ads-plan-option.neon-cyan .ads-plan-buy {
    color: var(--cyan);
    border-color: var(--cyan);
    background: transparent
}

.ads-plan-option.neon-gold .ads-plan-price,
.ads-plan-option.neon-gold .ads-plan-buy {
    color: var(--gold);
    border-color: var(--gold);
    background: transparent
}

.ads-plan-option.neon-pink .ads-plan-price,
.ads-plan-option.neon-pink .ads-plan-buy {
    color: var(--pink);
    border-color: var(--pink);
    background: transparent
}

.ads-plan-price.neon-frame::before {
    /*padding: 2px*/
}

.ads-plan-buy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 170px;
    padding: 9px 18px;
    border: 1px solid currentColor;
    border-radius: 10px;
    color: var(--cyan);
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 0 12px currentColor
}

.ads-plan-page [hidden] {
    display: none !important
}

/* Keep the currently selected ۱/۳/۶ ماهه tab centered when the other tabs are hidden. */
.ads-plan-tabs.is-selection-mode {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.ads-plan-tabs.is-selection-mode .ads-plan-tab:not([hidden]) {
    grid-column: 2;
}

.ads-selection-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: min(100%, 420px);
    margin: 0 auto 16px;
    padding: 10px 16px;
    border: 1px solid rgba(39,231,255,.45);
    border-radius: 12px;
    background: linear-gradient(105deg,rgba(5,13,32,.96),rgba(8,18,40,.84));
    color: var(--muted);
    font-size: 14px;
}

.ads-selection-summary-value { color: var(--text); }

:root.light-theme .ads-selection-summary {
    border-color: rgba(0, 137, 163, .34);
    background: linear-gradient(105deg, #ffffff, #edf9fc);
    color: #4b6570;
    box-shadow: 0 6px 18px rgba(0, 104, 128, .1);
}

:root.light-theme .ads-selection-summary-value {
    color: #123b4a;
}

.ads-stage-three {
    padding: 24px;
    background: linear-gradient(145deg,rgba(8,18,40,.96),rgba(5,13,32,.9));
}

.ads-stage-three-frequency {
    flex: 0 0 auto;
    padding: 8px 14px;
    /*border: 1px solid rgba(210,225,245,.42);*/
    border-radius: 10px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.ads-plan-option-cyan { border-color: rgba(39,231,255,.28) }
.ads-plan-option-gold { border-color: rgba(255,210,35,.28) }
.ads-plan-option-pink { border-color: rgba(255,58,157,.3) }

.ads-duration-card.neon-cyan .ads-duration-pay,
.ads-duration-card.neon-cyan .ads-duration-price { color: var(--cyan); border-color: var(--cyan) }

.ads-duration-card.neon-gold .ads-duration-pay,
.ads-duration-card.neon-gold .ads-duration-price { color: var(--gold); border-color: var(--gold) }

.ads-duration-card.neon-orange .ads-duration-pay,
.ads-duration-card.neon-orange .ads-duration-price { color: #ffb000; border-color: #ffb000 }

.ads-duration-card.neon-pink .ads-duration-pay,
.ads-duration-card.neon-pink .ads-duration-price { color: var(--pink); border-color: var(--pink) }

.ads-duration-card.neon-green .ads-duration-pay,
.ads-duration-card.neon-green .ads-duration-price { color: var(--green-soft); border-color: var(--green-soft) }

@media(max-width:768px) {
    .ads-plan-options {
        padding: 14px;
        border-radius: 18px
    }

    .ads-duration-picker {
        padding: 14px;
        border-radius: 18px
    }

    .ads-duration-heading {
        font-size: 15px;
        padding: 5px 6px 9px
    }

    .ads-duration-card {
        padding: 12px 14px
    }

    .ads-duration-header {
        font-size: 14px;
        gap: 12px
    }

    .ads-duration-copy {
        font-size: 11px
    }

    .ads-duration-price {
        min-width: 120px;
        font-size: 12px;
        padding: 6px 12px
    }

    .ads-duration-pay {
        width: 118px;
        min-height: 40px;
        padding: 7px 10px;
        border-radius: 12px;
        font-size: 12px;
        white-space: nowrap
    }

    .ads-duration-back {
        font-size: 14px;
        padding: 10px 20px
    }

    .ads-selection-summary {
        width: calc(100% - 28px);
        margin-bottom: 12px;
        font-size: 12px;
    }

    .ads-stage-three { padding: 14px; border-radius: 18px; }

    .ads-stage-three .ads-duration-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "copy price"
            "copy frequency";
        align-items: baseline;
        gap: 8px 10px;
    }

    .ads-stage-three .ads-duration-copy { grid-area: copy; }
    .ads-stage-three .ads-stage-three-frequency {
        grid-area: frequency;
        justify-self: stretch;
        padding: 4px 9px;
        font-size: 11px;
        line-height: 1.5;
        text-align: center;
    }
    .ads-stage-three .ads-duration-price {
        grid-area: price;
        min-width: 108px;
        width: 108px;
        padding: 6px 8px;
        font-size: 12px;
    }

    .ads-payment-info {
        padding: 14px
    }

    .ads-payment-slip {
        padding: 16px 10px 12px
    }

    .ads-payment-header {
        gap: 9px;
        margin-bottom: 13px
    }

    .ads-payment-header h2 {
        font-size: 19px
    }

    .ads-payment-header p {
        font-size: 11px
    }

    .ads-payment-badge {
        width: 38px;
        height: 38px;
        font-size: 18px
    }

    .ads-payment-detail {
        padding: 7px
    }

    .ads-payment-detail strong {
        font-size: 14px;
        letter-spacing: 0
    }

    .ads-payment-detail span {
        font-size: 11px
    }

    .ads-payment-note {
        margin-top: 11px;
        padding-top: 8px;
        font-size: 10px
    }

    .ads-payment-receipt {
        margin-top: 9px;
        padding: 9px 7px;
        font-size: 10px;
        line-height: 1.8
    }

    .ads-payment-receipt span {
        font-size: 15px
    }

    .ads-plan-panel {
        gap: 15px
    }

    .ads-plan-option {
        padding: 12px 14px
    }

    .ads-plan-option-header {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        direction: ltr;
    }

    .ads-plan-description h2 {
        font-size: 13px;
        line-height: 1.65;
        margin: 0
    }

    .ads-plan-description {
        min-width: 0;
        order: 2;
        direction: rtl;
    }

    .ads-plan-description p {
        display: none
    }

    .ads-plan-price {
        width: 120px;
        min-width: 120px;
        flex: 0 0 120px;
        font-size: 15px;
        text-align: center;
        order: 1;
    }

    .ads-plan-buy {
        width: 140px;
        align-self: center;
        padding: 8px 12px;
        font-size: 14px
    }
}

/* Keep mobile plan cards aligned like the duration cards: title on the right,
   a fixed price on the left, and the purchase action centered below. */
@media(max-width:768px) {
    .ads-plan-options .ads-plan-option {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 14px;
    }

    .ads-plan-options .ads-plan-option-header {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        direction: ltr;
    }

    .ads-plan-options .ads-plan-description {
        min-width: 0;
        order: 2;
        direction: rtl;
    }

    .ads-plan-options .ads-plan-description h2 {
        margin: 0 !important;
        font-size: 12px !important;
        line-height: 1.65;
        white-space: normal !important;
    }

    .ads-plan-options .ads-plan-price {
        width: 120px;
        min-width: 120px;
        flex: 0 0 120px;
        margin: 0 !important;
        padding: 6px 12px;
        font-size: 12px !important;
        text-align: center;
        order: 1;
        border: 1px solid currentColor !important;
    }

    .ads-plan-options .ads-plan-buy {
        width: 120px;
        align-self: center;
        min-height: 30px;
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
}
