/* ===== صفحة تفاصيل الخطة والاشتراك — المعلم الذكي ===== */

/* sticky محتاج إن الأب مايكونش overflow:hidden */
.st-wrapper.sg { overflow: visible; overflow-x: clip; background: var(--color-white); }

.sg-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ----- رأس الصفحة ----- */
.sg-top {
    padding: 135px 0 10px;
    background:
        radial-gradient(circle at 100% 0%, rgba(56, 176, 242, .16), transparent 42%),
        radial-gradient(circle at 0% 100%, rgba(1, 150, 232, .08), transparent 40%),
        var(--color-white);
}

.sg-crumb {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    margin-bottom: 18px; font-size: 13px; color: var(--color-text-soft);
}
.sg-crumb a { color: var(--color-blue); font-weight: 600; }
.sg-crumb a:hover { color: var(--color-navy); }
.sg-crumb .bi { font-size: 11px; opacity: .6; }
.sg-crumb span { color: var(--color-navy); font-weight: 800; }

.sg-title {
    margin: 6px 0 10px;
    font-size: clamp(28px, 4vw, 46px);
    font-weight: 900; line-height: 1.25;
    color: var(--color-navy);
}
.sg-desc { margin: 0; max-width: 720px; font-size: 16px; line-height: 1.9; color: var(--color-text-soft); }

.sg-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.sg-chips span {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 16px; border-radius: 999px;
    background: var(--color-surface-tint); border: 1px solid var(--color-light);
    color: var(--color-navy); font-size: 14px; font-weight: 800;
}
.sg-chips .bi { color: var(--color-sky); }

/* ----- التخطيط ----- */
.sg-body { padding: 28px 0 80px; }
.sg-layout {
    display: grid; grid-template-columns: 390px minmax(0, 1fr);
    gap: 28px; align-items: start;
}
.sg-side { position: sticky; top: 100px; }
.sg-main { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

.sg-card {
    background: var(--color-white);
    border: 1px solid var(--color-line);
    border-radius: 28px; padding: 28px;
}

/* ----- كارت الاشتراك ----- */
.sg-buy {
    padding: 0; overflow: hidden;
    border: 1.5px solid var(--color-light);
    box-shadow: 0 22px 46px rgba(10, 75, 168, .14);
}
.sg-cover { position: relative; aspect-ratio: 16 / 9; background: var(--color-navy-deep); overflow: hidden; }
.sg-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sg-cover-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 36, 90, .05) 30%, rgba(4, 36, 90, .92) 100%); }
.sg-cover-tag {
    position: absolute; top: 14px; right: 14px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 14px; border-radius: 999px;
    background: rgba(255, 255, 255, .95); color: var(--color-navy);
    font-size: 13px; font-weight: 800;
}
.sg-cover-tag .bi { color: var(--color-sky); }
.sg-cover-name { position: absolute; right: 18px; left: 18px; bottom: 14px; color: var(--color-white); }
.sg-cover-name small { display: block; font-size: 13px; color: var(--color-hero-text); font-weight: 700; }
.sg-cover-name b { font-size: 22px; font-weight: 900; line-height: 1.3; }

.sg-buy-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 16px; }

.sg-unit { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sg-unit span { font-size: 14px; font-weight: 700; color: var(--color-text-soft); }
.sg-unit b { font-size: 26px; font-weight: 900; color: var(--color-navy); }
.sg-unit small, .sg-total small, .sg-bar small { font-size: 13px; font-weight: 700; color: var(--color-text-soft); }

.sg-hours { background: var(--color-surface-nav); border: 1px solid var(--color-line); border-radius: 22px; padding: 16px; }
.sg-hours-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sg-hours-head b { font-size: 15px; font-weight: 800; color: var(--color-navy); }
.sg-hours-head small { font-size: 12px; color: var(--color-text-soft); font-weight: 600; }

.sg-stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sg-step {
    width: 48px; height: 48px; flex: none; border-radius: 50%;
    display: grid; place-items: center; font-size: 18px;
    border: 2px solid var(--color-line); background: var(--color-white); color: var(--color-navy);
    transition: all .2s ease;
}
.sg-step.plus { background: var(--color-navy); border-color: var(--color-navy); color: var(--color-white); }
.sg-step:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(10, 75, 168, .18); }
.sg-step.minus:hover:not(:disabled) { border-color: var(--color-sky-bright); color: var(--color-blue); }
.sg-step.plus:hover:not(:disabled) { background: var(--color-blue-dark); }
.sg-step:disabled { opacity: .4; cursor: not-allowed; }
.sg-hours-val { flex: 1; text-align: center; color: var(--color-text-soft); font-weight: 700; font-size: 15px; }
.sg-hours-val b { display: block; font-size: 36px; line-height: 1.1; font-weight: 900; color: var(--color-navy); }

.sg-quick { display: flex; gap: 8px; margin-top: 12px; }
.sg-quick-btn {
    flex: 1; padding: 7px 6px; border-radius: 999px;
    border: 1.5px solid var(--color-line); background: var(--color-white);
    color: var(--color-navy); font-size: 13px; font-weight: 800; transition: all .2s ease;
}
.sg-quick-btn:hover { border-color: var(--color-sky-bright); color: var(--color-blue); }
.sg-quick-btn.is-active { background: var(--color-navy); border-color: var(--color-navy); color: var(--color-white); }

.sg-total {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 14px 4px 2px; border-top: 1px dashed var(--color-line);
}
.sg-total > span { font-size: 15px; font-weight: 800; color: var(--color-navy); }
.sg-total b { font-size: 32px; font-weight: 900; color: var(--color-navy); }
.sg-total b.is-bump, .sg-bar b.is-bump { animation: sgBump .28s ease; }
@keyframes sgBump { 0% { transform: scale(1); } 45% { transform: scale(1.14); color: var(--color-sky); } 100% { transform: scale(1); } }

.sg-actions { display: flex; flex-direction: column; gap: 10px; }
.sg-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 50px; padding: 0 22px; border-radius: 16px;
    font-size: 16px; font-weight: 800; border: 2px solid transparent; transition: all .2s ease;
}
.sg-btn.primary { background: var(--color-navy); color: var(--color-white); box-shadow: 0 12px 24px rgba(11, 76, 156, .28); }
.sg-btn.primary:hover { background: var(--color-blue-dark); color: var(--color-white); transform: translateY(-2px); }
.sg-btn.ghost { background: var(--color-white); border-color: var(--color-line); color: var(--color-navy); }
.sg-btn.ghost:hover { border-color: var(--color-navy); }
.sg-btn.is-in-cart { background: rgba(16, 185, 129, .12); border-color: var(--color-green); color: #047857; }
.sg-btn.is-in-cart:hover { background: rgba(16, 185, 129, .2); }

.sg-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sg-points li { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; line-height: 1.6; color: var(--color-text-soft); font-weight: 600; }
.sg-points .bi { color: var(--color-green); margin-top: 3px; }

/* ----- ليه المعلم الذكي ----- */
.sg-why {
    position: relative; overflow: hidden; border-radius: 32px; padding: 38px 36px;
    background: linear-gradient(135deg, var(--color-navy-deep) 0%, var(--color-navy) 60%, var(--color-blue) 100%);
    color: var(--color-white);
    box-shadow: 0 22px 46px rgba(10, 75, 168, .24);
}
.sg-why-dots {
    position: absolute; inset: 0; opacity: .22;
    background-image: radial-gradient(rgba(255, 255, 255, .7) 1.2px, transparent 1.2px);
    background-size: 22px 22px;
}
.sg-why-inner { position: relative; z-index: 1; }
.sg-why-badge {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 999px;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3);
    font-size: 14px; font-weight: 800;
}
.sg-why h2 { margin: 16px 0 10px; font-size: clamp(24px, 3vw, 36px); font-weight: 900; line-height: 1.45; color: var(--color-white); }
.sg-why h2 span { color: var(--color-sky-bright); }
.sg-why p { margin: 0; max-width: 560px; font-size: 16px; line-height: 1.9; color: var(--color-hero-text); }
.sg-why-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.sg-why-pills span {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 999px;
    background: var(--color-white); color: var(--color-navy); font-size: 14px; font-weight: 800;
}
.sg-why-pills .bi { color: var(--color-sky); }

/* ----- عناوين الأقسام ----- */
.sg-sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.sg-sec-head h2 { margin: 0; font-size: clamp(20px, 2.4vw, 26px); font-weight: 900; color: var(--color-navy); }
.sg-sec-head p { margin: 2px 0 0; font-size: 14px; color: var(--color-text-soft); }
.sg-ki {
    width: 46px; height: 46px; flex: none; border-radius: 50%;
    display: grid; place-items: center; font-size: 20px;
    background: var(--color-sky); color: var(--color-white); box-shadow: 0 0 0 5px var(--color-light);
}

/* ----- المزايا ----- */
.sg-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sg-benefit {
    border-radius: 24px; padding: 22px 20px; border: 1px solid var(--color-line);
    background: var(--color-white); transition: transform .25s ease, box-shadow .25s ease;
}
.sg-benefit:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(10, 75, 168, .12); }
.sg-benefit-ico {
    width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center;
    font-size: 22px; margin-bottom: 14px; background: var(--color-navy); color: var(--color-white);
}
.sg-benefit h3 { margin: 0 0 6px; font-size: 17px; font-weight: 900; color: var(--color-navy); }
.sg-benefit p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--color-text-soft); }
.sg-benefit.tone-1 { background: var(--color-surface-tint); border-color: var(--color-light); }
.sg-benefit.tone-1 .sg-benefit-ico { background: var(--color-sky); }
.sg-benefit.tone-2 { background: var(--color-bg-light); }
.sg-benefit.tone-2 .sg-benefit-ico { background: var(--color-sky-bright); color: var(--color-navy-deep); }

/* ----- المقارنة ----- */
.sg-table-wrap { overflow-x: auto; border-radius: 22px; border: 1px solid var(--color-line); }
.sg-table { width: 100%; min-width: 520px; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
.sg-table th, .sg-table td { padding: 15px 18px; text-align: right; border-bottom: 1px solid var(--color-line-soft); vertical-align: middle; }
.sg-table tbody tr:last-child th, .sg-table tbody tr:last-child td { border-bottom: 0; }
.sg-table thead th { background: var(--color-surface-nav); font-weight: 800; color: var(--color-text-soft); }
.sg-table thead th.is-smart { background: var(--color-navy); color: var(--color-white); }
.sg-table tbody th { font-weight: 800; color: var(--color-navy); white-space: nowrap; }
.sg-table td { color: var(--color-text-soft); font-weight: 600; }
.sg-table td.is-smart { background: var(--color-surface-nav); color: var(--color-navy); font-weight: 800; }
.sg-table td.is-smart .bi { color: var(--color-green); margin-left: 6px; }

/* ----- الخطوات ----- */
.sg-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sg-step-card {
    display: flex; gap: 14px; align-items: flex-start; padding: 20px;
    border-radius: 24px; background: var(--color-bg-light); border: 1px solid var(--color-line);
}
.sg-step-num {
    width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center;
    background: var(--color-sky); color: var(--color-white); font-size: 18px; font-weight: 900;
    box-shadow: 0 0 0 4px var(--color-light);
}
.sg-step-card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 900; color: var(--color-navy); }
.sg-step-card p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--color-text-soft); }

/* ----- الأسئلة الشائعة ----- */
.sg-faq { display: grid; gap: 12px; }
.sg-faq-item { border: 1px solid var(--color-line); border-radius: 20px; background: var(--color-white); overflow: hidden; transition: border-color .2s ease; }
.sg-faq-item[open] { border-color: var(--color-light); background: var(--color-surface-nav); }
.sg-faq-item summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; font-size: 16px; font-weight: 800; color: var(--color-navy);
}
.sg-faq-item summary::-webkit-details-marker { display: none; }
.sg-faq-item summary .bi { color: var(--color-sky); transition: transform .25s ease; }
.sg-faq-item[open] summary .bi { transform: rotate(180deg); }
.sg-faq-item p { margin: 0; padding: 0 20px 18px; font-size: 14.5px; line-height: 1.9; color: var(--color-text-soft); }

/* ----- شريط الشراء (موبايل) ----- */
.sg-bar { display: none; }

@media (max-width: 991px) {
    .sg-layout { grid-template-columns: 1fr; }
    .sg-side { position: static; }
    .sg-benefits, .sg-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .st-wrapper.sg.has-bar { padding-bottom: 84px; }
    .sg-bar {
        display: flex; align-items: center; justify-content: space-between; gap: 14px;
        position: fixed; right: 0; left: 0; bottom: 0; z-index: 40;
        padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
        border-top: 1px solid var(--color-line); box-shadow: 0 -10px 30px rgba(10, 75, 168, .12);
    }
    .sg-bar-info small { display: block; }
    .sg-bar-info b { font-size: 22px; font-weight: 900; color: var(--color-navy); }
    .sg-bar .sg-btn { height: 46px; flex: 0 0 auto; }
    body:has(.sg-bar) .floating-actions { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}

/* ----- تكامل أنظمة الاشتراك، الكوبون، وأولياء الأمور ----- */
.sg-buy-intro {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sg-buy-heading {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
    color: var(--color-navy);
}
.sg-buy-sub {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--color-text-soft);
}
.sg-expiry-pill {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 16px;
    background: var(--color-surface-tint);
    border: 1px solid var(--color-light);
    color: var(--color-navy);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.6;
}
.sg-expiry-pill .bi {
    color: var(--color-blue);
    margin-top: 2px;
    flex: none;
}

.sg-child-box {
    background: var(--color-surface-nav);
    border: 1px solid var(--color-line);
    border-radius: 18px;
    padding: 12px 14px;
}
.sg-child-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sg-child-form label {
    font-size: 13px;
    font-weight: 800;
    color: var(--color-navy);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.sg-child-form .form-select {
    border-radius: 12px;
    border-color: var(--color-line);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--color-navy);
}

.sg-active-alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 18px;
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
    font-size: 13px;
}
.sg-active-alert__enter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: #067647;
    color: #fff;
    font-weight: 800;
    font-size: 12.5px;
    text-decoration: none;
}
.sg-active-alert__enter:hover {
    background: #055f39;
    color: #fff;
}

.sg-pkg-tabs {
    display: grid;
    gap: 8px;
}
.sg-pkg-tab {
    width: 100%;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 16px;
    border: 1.5px solid var(--color-line);
    background: var(--color-white);
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.sg-pkg-tab:hover {
    border-color: var(--color-sky-bright);
    background: var(--color-surface-nav);
}
.sg-pkg-tab.is-active {
    border-color: var(--color-navy);
    background: var(--color-surface-tint);
    box-shadow: 0 6px 14px rgba(11, 76, 156, .1);
}
.sg-pkg-tab__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.sg-pkg-tab__type {
    font-size: 11px;
    font-weight: 800;
    color: var(--color-blue);
}
.sg-pkg-tab__name {
    font-size: 14px;
    font-weight: 800;
    color: var(--color-navy);
}
.sg-pkg-tab__price {
    flex: none;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 15px;
    font-weight: 900;
    color: var(--color-navy);
}
.sg-pkg-tab__price small {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-soft);
}

.st-package-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.st-package-card[hidden] {
    display: none !important;
}

.sg-pkg-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.sg-pkg-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--color-surface-tint);
    color: var(--color-blue);
    font-size: 11.5px;
    font-weight: 800;
    margin-bottom: 4px;
}
.sg-pkg-name {
    margin: 0;
    font-size: 16px;
    font-weight: 900;
    color: var(--color-navy);
}
.sg-pkg-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.65;
    color: var(--color-text-soft);
}

.sg-monthly-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--color-surface-nav);
    border: 1px solid var(--color-line);
    border-radius: 20px;
    padding: 14px 16px;
}
.sg-monthly-limit b {
    display: block;
    font-size: 20px;
    font-weight: 900;
    color: var(--color-navy);
}
.sg-monthly-limit small,
.sg-monthly-duration {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--color-text-soft);
}

.st-package-card .st-coupon-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-surface-nav);
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--color-line);
    cursor: pointer;
    margin: 0;
    user-select: none;
}
.st-package-card .st-coupon-toggle span {
    font-size: 13px;
    color: var(--color-navy);
    font-weight: 700;
}
.st-package-card .st-coupon-toggle .form-check-input {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}
.st-package-card .st-coupon-drawer {
    animation: stCouponFadeIn 0.22s ease;
}
.st-package-card .coupon-wrapper {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    overflow: hidden;
    background: var(--color-white);
}
.st-package-card .coupon-wrapper .form-control {
    border: 0;
    box-shadow: none;
    font-size: 13px;
    background: transparent;
    text-align: right;
    padding: 9px 14px;
}
.st-package-card .coupon-wrapper .btn-coupon {
    background: var(--color-navy);
    border: 0;
    color: var(--color-white);
    padding: 0 18px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}
.st-package-card .coupon-wrapper .btn-coupon:hover {
    background: var(--color-blue-dark);
    color: var(--color-white);
}
.sg-total-amount {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
}
.sg-total .st-price-before {
    font-size: 13px;
    color: var(--color-text-soft);
    text-decoration: line-through;
    font-weight: 700;
}
.sg-unavailable-box {
    padding: 16px;
    border-radius: 18px;
    background: var(--color-surface-nav);
    border: 1px solid var(--color-line);
    color: var(--color-text-soft);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}
.sg-bullets {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}
.sg-bullets li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--color-text-soft);
    font-weight: 600;
}
.sg-bullets .bi {
    color: var(--color-sky);
    margin-top: 3px;
    flex: none;
}
@keyframes stCouponFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .sg-top { padding-top: 110px; }
    .sg-wrap { padding: 0 16px; }
    .sg-card { padding: 20px 16px; border-radius: 24px; }
    .sg-buy { padding: 0; }
    .sg-why { padding: 28px 20px; border-radius: 26px; }
    .sg-benefits, .sg-steps { grid-template-columns: 1fr; }
    .sg-benefit { padding: 18px 16px; }
    .sg-table th, .sg-table td { padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .sg * { animation: none !important; transition: none !important; }
}