/* =========================================================
       ✅ 1) المتغيرات + الإعدادات العامة
       ========================================================= */
:root {
    /* ألوان الهوية */
    --blue: #0d6efd;
    --blue2: #0a4cc8;
    --yellow: #f6c10e;

    --ink: #071225;

    /* نصوص */
    --text: #eaf2ff;
    --muted: rgba(234, 242, 255, 0.78);

    /* زجاج/حدود/ظل */
    --stroke: rgba(255, 255, 255, 0.12);
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

body {
    background: #050b17;
    color: #fff;
    overflow-x: hidden;
}

/* =========================================================
       ✅ 3) خلفية الصفحة الرئيسية (Main Background)
       ========================================================= */
.products-bg {
    position: relative;
    min-height: 100vh;
    padding-top: 84px; /* لتعويض الهيدر الثابت */
    padding-bottom: 70px;
    isolation: isolate;
}

/* طبقة الخلفية الأساسية */
.products-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
            120deg,
            rgba(13, 110, 253, 0.72),
            rgba(0, 0, 0, 0.25) 45%,
            rgba(246, 193, 14, 0.4)
        ),
        url("/assets/images/bg-1.png");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    filter: saturate(1.05) contrast(1.05);
    z-index: -3;
}

/* طبقة الإضاءات (Glow) */
.products-bg::after {
    content: "";
    position: absolute;
    inset: -2px;
    background: radial-gradient(
            650px 380px at 18% 18%,
            rgba(13, 110, 253, 0.55),
            transparent 60%
        ),
        radial-gradient(
            650px 380px at 86% 20%,
            rgba(246, 193, 14, 0.55),
            transparent 62%
        ),
        radial-gradient(
            850px 520px at 86% 86%,
            rgba(13, 110, 253, 0.35),
            transparent 65%
        ),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.6));
    z-index: -2;
    pointer-events: none;
}

/* شبكة خفيفة */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px
        ),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 52px 52px;
    opacity: 0.18;
    z-index: -1;
    pointer-events: none;
    mask-image: radial-gradient(
        circle at 50% 30%,
        rgba(0, 0, 0, 1),
        rgba(0, 0, 0, 0.25) 60%,
        transparent 78%
    );
}

/* =========================================================
       ✅ 4) الهيرو + البحث
       ========================================================= */
.hero {
    padding: 34px 0 18px;
    text-align: center;
    margin-top: 70px; /* بديل عن inline style */
}
.hero h1 {
    font-weight: 900;
    font-size: clamp(28px, 3.2vw, 44px);
    margin: 0 0 8px;
}
.hero p {
    margin: 0 auto 18px;
    max-width: 820px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    line-height: 1.9;
}

.search-wrap {
    display: flex;
    justify-content: center;
}
.search {
    width: min(820px, 100%);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    padding: 0.55rem 0.65rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.search input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    color: #fff;
    padding: 0.55rem 0.75rem;
    font-weight: 700;
}
.search input::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.search-btn {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    border: 0;
    background: linear-gradient(135deg, var(--yellow), var(--yellow2));
    color: #fff;
    display: grid;
    place-items: center;
    transition: 0.22s ease;
}
.search-btn:hover {
    transform: translateY(-2px) scale(1.02);
}

/* =========================================================
       ✅ 5) فلاتر المنتجات (Chips)
       ========================================================= */
.chips {
    margin: 18px auto 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.chip {
    border: 0;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 900;
    color: #fff;
    background: var(--secondary-color);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: 0.22s ease;
    position: relative;
    overflow: hidden;
}
.chip::after {
    content: "";
    position: absolute;
    inset: -30px;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.28),
        transparent 55%
    );
    opacity: 0;
    transition: 0.22s ease;
}
.chip:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}
.chip:hover::after {
    opacity: 1;
}

.chip.active {
    background: #0b0f18;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

/* =========================================================
       ✅ 6) عنوان القسم (Section Head)
       ========================================================= */
.section-head {
    margin-top: 10px;
    text-align: center;
}
.section-head h2 {
    font-weight: 900;
    font-size: clamp(20px, 2.2vw, 30px);
    margin: 0 0 6px;
}
.section-head p {
    margin: 0 auto;
    max-width: 760px;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 600;
    line-height: 1.9;
}

/* =========================================================
       ✅ 7) شبكة المنتجات + الكروت
       ========================================================= */
.grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 18px;
}

.cardx {
    grid-column: span 4;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    transform: translateY(14px);
    opacity: 0;
    animation: rise 0.7s ease forwards;
    position: relative;
}

@keyframes rise {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cardx::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        120deg,
        rgba(13, 110, 253, 0.45),
        rgba(246, 193, 14, 0.28),
        rgba(13, 110, 253, 0.25)
    );
    opacity: 0;
    transition: 0.22s ease;
    z-index: 0;
}
.cardx:hover::before {
    opacity: 1;
}
.cardx:hover {
    transform: translateY(-4px);
    transition: 0.22s ease;
}

.cardx .inner {
    position: relative;
    z-index: 1;
    padding: 14px;
}

.thumb {
    border-radius: 18px;
    overflow: hidden;
    height: 170px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
}
.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.02);
    transition: 0.35s ease;
}
.cardx:hover .thumb img {
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: linear-gradient(135deg, var(--yellow), var(--yellow2));
    color: #071225;
    font-weight: 900;
    padding: 7px 12px;
    border-radius: 999px;
    box-shadow: 0 14px 30px rgba(246, 193, 14, 0.25);
}

.title {
    margin: 12px 2px 4px;
    font-weight: 900;
    font-size: 18px;
    color: var(--accent-color);
}
.desc {
    margin: 0 2px 10px;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.85;
    font-weight: 600;
    font-size: 14.5px;
}

.meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 2px 12px;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #fff;
}
.pill i {
    width: 9px;
    height: 9px;
    border-radius: 99px;
    background: var(--yellow);
    display: inline-block;
    box-shadow: 0 0 0 4px rgba(246, 193, 14, 0.18);
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 2px 2px;
}
.price {
    font-weight: 900;
    color: rgba(255, 255, 255, 0.92);
}

.more {
    text-decoration: none;
    font-weight: 900;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(
        135deg,
        var(--secondary-color),
        rgba(10, 76, 200, 0.95)
    );
    border: 1px solid rgba(255, 255, 255, 0.16);
    transition: 0.22s ease;
    white-space: nowrap;
}
.more:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

/* =========================================================
       ✅ 8) CTA (دعوة للتواصل)
       ========================================================= */
.cta {
    margin-top: 26px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 26px;
    padding: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.cta h3 {
    margin: 0;
    font-weight: 900;
    font-size: 20px;
}
.cta p {
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-weight: 600;
    line-height: 1.85;
    flex: 1;
    min-width: 260px;
}
.btn-aflak {
    border: none;
    border-radius: 16px;
    padding: 0.75rem 1rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
}
.btn-aflak.yellow {
    background: linear-gradient(135deg, var(--yellow), var(--yellow2));
    color: #071225;
    box-shadow: 0 16px 38px rgba(246, 193, 14, 0.22);
}
.btn-aflak.yellow:hover {
    transform: translateY(-2px);
    filter: brightness(1.02);
}

/* =========================================================
       ✅ 9) Timeline (كيف تطلب من أفلاك)
       ========================================================= */
.timeline {
    position: relative;
    max-width: 1120px;
    margin: 0 auto;
    padding: 26px 28px 22px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: radial-gradient(
            1100px 240px at 50% 0%,
            rgba(13, 110, 253, 0.22),
            transparent 55%
        ),
        radial-gradient(
            900px 240px at 20% 100%,
            rgba(255, 193, 7, 0.14),
            transparent 55%
        ),
        linear-gradient(180deg, rgba(8, 16, 28, 0.62), rgba(8, 16, 28, 0.5));
    box-shadow: var(--shadow);
    overflow: hidden;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.timeline::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 22px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 0 40px rgba(13, 110, 253, 0.18);
    opacity: 0.9;
}

.timeline .line {
    position: absolute;
    left: 28px;
    right: 28px;
    top: 60px;
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.08),
        rgba(13, 110, 253, 0.55),
        rgba(255, 193, 7, 0.55),
        rgba(255, 255, 255, 0.08)
    );
    filter: drop-shadow(0 0 10px rgba(13, 110, 253, 0.25));
    opacity: 0.9;
}

.timeline .steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
    direction: rtl;
}

.timeline .step {
    position: relative;
    padding: 12px 10px 0;
    text-align: right;
}

.timeline .step .num {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    margin: 0 0 10px auto;
    font-weight: 900;
    color: var(--text);
    background: radial-gradient(
            14px 14px at 30% 30%,
            rgba(255, 255, 255, 0.18),
            transparent 55%
        ),
        linear-gradient(
            180deg,
            rgba(13, 110, 253, 0.35),
            rgba(13, 110, 253, 0.14)
        );
    border: 1px solid rgba(13, 110, 253, 0.55);
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.12),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    z-index: 2;
}

.timeline .step:nth-child(2) .num,
.timeline .step:nth-child(4) .num {
    border-color: rgba(255, 193, 7, 0.65);
    background: radial-gradient(
            14px 14px at 30% 30%,
            rgba(255, 255, 255, 0.18),
            transparent 55%
        ),
        linear-gradient(
            180deg,
            rgba(255, 193, 7, 0.34),
            rgba(255, 193, 7, 0.14)
        );
}

.timeline .step h4 {
    margin: 0 0 6px;
    color: var(--text);
    font-weight: 800;
    font-size: 1.02rem;
}
.timeline .step p {
    margin: 0;
    color: rgba(233, 242, 255, 0.55);
    line-height: 1.75;
    font-size: 0.95rem;
}

.timeline .cta-row {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    direction: rtl;
}

.timeline .cta-row .mini {
    margin: 0;
    color: rgba(233, 242, 255, 0.75);
    font-size: 0.95rem;
}

.timeline .products-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    color: #07101f;
    font-weight: 800;
    background: linear-gradient(90deg, var(--yellow), var(--secondary-color));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 30px rgba(255, 193, 7, 0.2);
    transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
    white-space: nowrap;
}

.timeline .products-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #07101f;
    stroke-width: 2.2;
    transform: rotate(180deg);
    transition: transform 0.22s ease;
}

.timeline .products-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.03);
    box-shadow: 0 18px 44px rgba(255, 193, 7, 0.26);
}

.timeline .products-btn:hover svg {
    transform: rotate(180deg) translateX(2px);
}

/* ✅ Responsive للـ Timeline */
@media (max-width: 992px) {
    .timeline {
        padding: 22px 18px 18px;
    }
    .timeline .line {
        left: 18px;
        right: 18px;
        top: 72px;
    }
    .timeline .steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}
@media (max-width: 560px) {
    .timeline .steps {
        grid-template-columns: 1fr;
    }
    .timeline .line {
        display: none;
    }
    .timeline .cta-row {
        flex-direction: column;
        align-items: stretch;
    }
    .timeline .products-btn {
        justify-content: center;
    }
}

/* =========================================================
       ✅ 11) Responsive عام للمنتجات
       ========================================================= */
@media (max-width: 1199.98px) {
    .cardx {
        grid-column: span 6;
    }
}
@media (max-width: 767.98px) {
    .cardx {
        grid-column: span 12;
    }
    .hero {
        padding-top: 22px;
    }
    .btn-aflak {
        width: 100%;
        justify-content: center;
    }
    .cta {
        text-align: center;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cardx {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .cardx:hover {
        transform: none;
    }
    .cardx:hover .thumb img {
        transform: none;
    }
    .chip:hover,
    .search-btn:hover,
    .more:hover,
    .btn-aflak:hover {
        transform: none;
    }
}
