/**
 * Shop page — Premium visual layer
 * Scoped strictly to: .page-shop
 *
 * يقوم بتجميل صفحة shop.aspx (StudyType -> Stage cards) دون لمس CSS العام.
 *  - Hero قوي بشارة وعنوان متدرّج + شريط إحصائيات
 *  - بطاقة كل StudyType بهيدر بتدرّج وأيقونة وعدّاد للصفوف
 *  - بطاقات الصفوف (.linkIcon) بمظهر premium (إطار CSS بدل icons2.png)
 *  - hover lift + glow ناعم + responsive grid
 */

/* ========== Variables ========== */
.page-shop {
    --sp-accent: #dc3545;
    --sp-accent-2: #ff6b6b;
    --sp-accent-rgb: 220, 53, 69;
    --sp-deep: #1a252f;
    --sp-slate: #2c3e50;
    --sp-slate-mid: #34495e;
    --sp-ink: #1a1d24;
    --sp-muted: #5c6570;
    --sp-soft: #f6f8fc;
    --sp-line: rgba(26, 29, 36, 0.08);
    --sp-radius-lg: 22px;
    --sp-radius-md: 14px;
    --sp-elev-1: 0 10px 26px rgba(15, 18, 28, 0.08);
    --sp-elev-2: 0 22px 60px rgba(15, 18, 28, 0.16);
}

/* ========== HERO ========== */
.page-shop .shop-hero {
    position: relative;
    overflow: hidden;
    padding: 3rem 0 4.5rem;
    color: #fff;
    background:
        radial-gradient(60% 50% at 10% 0%, rgba(255, 107, 107, 0.35), transparent 60%),
        radial-gradient(50% 45% at 90% 10%, rgba(11, 92, 171, 0.35), transparent 60%),
        linear-gradient(165deg, #1a252f 0%, #2c3e50 55%, #1a252f 100%);
    border-bottom: 3px solid rgba(var(--sp-accent-rgb), 0.45);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.page-shop .shop-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(-12deg, transparent, transparent 30px, rgba(255, 255, 255, 0.025) 30px, rgba(255, 255, 255, 0.025) 31px);
    pointer-events: none;
}

.page-shop .shop-hero > .container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.page-shop .shop-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.page-shop .shop-hero-badge i { color: var(--sp-accent-2); }

.page-shop .shop-hero h1 {
    font-size: clamp(2rem, 4vw, 2.9rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0.9rem 0 0.7rem;
    line-height: 1.15;
    background: linear-gradient(180deg, #ffffff 0%, #ffd8dd 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.page-shop .shop-hero h1::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    margin: 0.85rem auto 0;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--sp-accent), var(--sp-accent-2));
}

.page-shop .shop-hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.02rem;
    line-height: 1.6;
    max-width: 44rem;
    margin: 1rem auto 0;
}

.page-shop .shop-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
    max-width: 560px;
    margin: 1.5rem auto 0;
    padding: 0;
    list-style: none;
}

.page-shop .shop-hero-stats li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 0.7rem 0.9rem;
    text-align: left;
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.18s ease, background 0.2s ease;
}

.page-shop .shop-hero-stats li:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.13);
}

.page-shop .shop-hero-stats .sp-stat-ico {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--sp-accent-rgb), 0.4), rgba(var(--sp-accent-rgb), 0.15));
    color: #fff;
    font-size: 1rem;
}

.page-shop .shop-hero-stats .sp-stat-num {
    display: block;
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.1;
}

.page-shop .shop-hero-stats .sp-stat-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 2px;
}

@media (max-width: 575.98px) {
    .page-shop .shop-hero-stats {
        grid-template-columns: 1fr;
        max-width: 320px;
    }
}

/* خط فاصل ناعم بين Hero والقسم */
.page-shop .shop-hero-spacer {
    height: 0;
    margin-top: -2.5rem;
    position: relative;
    z-index: 2;
}

/* ========== Section .shop ========== */
.page-shop .shop {
    margin: 0 auto !important;
    padding: 1.5rem 0 2rem;
    width: auto !important;
}

.page-shop .shop .igClass {
    max-width: 1320px;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ========== Box-Shop (StudyType card) ========== */
.page-shop .box-shop {
    position: relative;
    border: 1px solid var(--sp-line) !important;
    border-radius: var(--sp-radius-lg) !important;
    overflow: hidden;
    margin-bottom: 2.2rem !important;
    background: #fff;
    box-shadow: var(--sp-elev-1);
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.page-shop .box-shop:hover {
    box-shadow: var(--sp-elev-2);
}

/* رأس البطاقة */
.page-shop .box-shop > h3 {
    position: relative;
    background: linear-gradient(135deg, var(--sp-slate) 0%, var(--sp-slate-mid) 50%, var(--sp-deep) 100%) !important;
    color: #fff !important;
    padding: 1.15rem 1.5rem !important;
    margin: 0 !important;
    text-align: left !important;
    text-shadow: none !important;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

/* أيقونة قبل النص في الهيدر */
.page-shop .box-shop > h3::before {
    content: "\f02d";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(var(--sp-accent-rgb), 0.4), rgba(var(--sp-accent-rgb), 0.15));
    border: 1px solid rgba(var(--sp-accent-rgb), 0.55);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 6px 16px rgba(var(--sp-accent-rgb), 0.3);
    flex-shrink: 0;
}

/* خط متدرّج علوي يلامس هيدر البطاقة */
.page-shop .box-shop::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(var(--sp-accent-rgb), 0.85), #ffffffaa, rgba(var(--sp-accent-rgb), 0.85), transparent);
    z-index: 1;
}

/* عدّاد الصفوف داخل الهيدر — يُحدّث عبر JS */
.page-shop .box-shop > h3 .bs-counter {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.page-shop .box-shop > h3 .bs-counter i { color: var(--sp-accent-2); font-size: 0.7rem; }

/* جسم البطاقة (شبكة الصفوف) */
.page-shop .box-shop .igSubjact {
    background:
        radial-gradient(80% 60% at 50% -10%, rgba(var(--sp-accent-rgb), 0.06), transparent 60%),
        linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%) !important;
    padding: 1.5rem 1.5rem 1.75rem !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.1rem;
}

@media (max-width: 1199.98px) {
    .page-shop .box-shop .igSubjact { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767.98px) {
    .page-shop .box-shop .igSubjact {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 1rem !important;
        flex-direction: initial !important;
        align-items: initial !important;
    }
}

@media (max-width: 420px) {
    .page-shop .box-shop .igSubjact { grid-template-columns: 1fr !important; }
}

/* ========== linkIcon (Stage card) ========== */
.page-shop .igSubjact .linkIcon {
    width: 100% !important;
    padding: 0 !important;
    display: block !important;
    text-decoration: none !important;
    transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease !important;
}

.page-shop .igSubjact .linkIcon .icon {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 1rem 1.1rem;
    background: #fff;
    border: 1px solid var(--sp-line);
    border-radius: var(--sp-radius-md);
    box-shadow: 0 8px 22px rgba(15, 18, 28, 0.06);
    height: 100%;
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.page-shop .igSubjact .linkIcon .icon::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(135deg, rgba(var(--sp-accent-rgb), 0.08), rgba(11, 92, 171, 0.06));
    border-radius: var(--sp-radius-md) var(--sp-radius-md) 50% 50% / var(--sp-radius-md) var(--sp-radius-md) 24px 24px;
    z-index: 0;
}

/* إخفاء إطار icons2.png القديم */
.page-shop .igSubjact .linkIcon .icon > img:first-child {
    display: none !important;
}

/* صورة الصف بحجم طبيعي */
.page-shop .igSubjact .linkIcon .icon .image2 {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    max-width: 100%;
    height: auto !important;
    max-height: 180px;
    border: none !important;
    border-radius: 8px;
    background: transparent;
    margin: 0 0 0.85rem;
    z-index: 1;
    object-fit: contain;
}

/* صورة احتياطية لو فارغة */
.page-shop .igSubjact .linkIcon .icon .image2[src=""],
.page-shop .igSubjact .linkIcon .icon .image2:not([src]) {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    width: 140px !important;
    height: 140px !important;
}

/* النص (العنوان) */
.page-shop .igSubjact .linkIcon .icon .daitle {
    padding-top: 0 !important;
    color: var(--sp-ink) !important;
    text-align: center;
    text-decoration: none;
    z-index: 1;
    position: relative;
    width: 100%;
}

.page-shop .igSubjact .linkIcon .icon .daitle h5 {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--sp-ink);
    margin: 0;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.page-shop .igSubjact .linkIcon .icon .daitle p {
    margin: 0.4rem 0 0 !important;
    font-size: 0.72rem !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sp-muted) !important;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s ease;
}

.page-shop .igSubjact .linkIcon .icon .daitle p::before {
    content: "Browse";
}

.page-shop .igSubjact .linkIcon .icon .daitle p::after {
    content: "\f061";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    transition: transform 0.2s ease;
}

/* hover */
.page-shop .igSubjact .linkIcon:hover {
    transform: translateY(-8px) !important;
    text-decoration: none !important;
}

.page-shop .igSubjact .linkIcon:hover .icon {
    border-color: rgba(var(--sp-accent-rgb), 0.5);
    box-shadow:
        0 0 0 1px rgba(var(--sp-accent-rgb), 0.3),
        0 22px 46px rgba(var(--sp-accent-rgb), 0.18);
}

.page-shop .igSubjact .linkIcon:hover .icon .image2 {
    transform: scale(1.04);
    transition: transform 0.25s ease;
}

.page-shop .igSubjact .linkIcon:hover .icon .daitle p {
    color: var(--sp-accent) !important;
}

.page-shop .igSubjact .linkIcon:hover .icon .daitle p::after {
    transform: translateX(4px);
}

/* فوكس قابلية الوصول */
.page-shop .igSubjact .linkIcon:focus-visible {
    outline: none;
}

.page-shop .igSubjact .linkIcon:focus-visible .icon {
    border-color: var(--sp-accent);
    box-shadow:
        0 0 0 3px rgba(var(--sp-accent-rgb), 0.25),
        0 14px 32px rgba(var(--sp-accent-rgb), 0.18);
}

/* responsive: ارتفاع أقصى أصغر للصورة على الشاشات الصغيرة */
@media (max-width: 991.98px) {
    .page-shop .igSubjact .linkIcon .icon .image2 {
        max-height: 150px;
    }
}

@media (max-width: 575.98px) {
    .page-shop .igSubjact .linkIcon .icon .image2 {
        max-height: 130px;
    }
    .page-shop .box-shop > h3 {
        font-size: 1.1rem !important;
        padding: 0.95rem 1.1rem !important;
    }
    .page-shop .box-shop > h3 .bs-counter {
        font-size: 0.65rem;
        padding: 0.22rem 0.55rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-shop .igSubjact .linkIcon,
    .page-shop .igSubjact .linkIcon .icon,
    .page-shop .igSubjact .linkIcon .icon .image2,
    .page-shop .igSubjact .linkIcon .icon .daitle p::after,
    .page-shop .box-shop {
        transition: none !important;
    }
}
