html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* الهيرو القديم من Flare Cloud */
.header-hero {
    background: linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(9,121,135,1) 35%, rgba(0,212,255,1) 100%);
    color: white;
    padding: 60px 0;
}

.card-service {
    border: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.footer a {
    color: inherit;
}

.footer h5 {
    font-weight: 600;
}

.footer .fa-lg {
    font-size: 1.25rem;
}

.footer .list-unstyled li {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .footer .col-md-4 {
        text-align: center;
    }

        .footer .col-md-4 .list-unstyled {
            display: inline-block;
        }
}

/* =========================
   متغيرات الثيم (لايت / دارك)
   ========================= */
:root {
    --bg: #ffffff;
    --text: #212529;
    --card: #ffffff;
    --muted: #6c757d;
    /* ارتفاع النافبار التقريبي (نحتاجه في السكشنز) */
    --nav-height: 64px;
    /* ألوان خلفيات السكشنات في الوضع العادي (لايت) */
    --section1-bg: #f8f9fa;
    --section2-bg: #ffffff;
    --section3-bg: #f8f9fa;
    --section4-bg: #ffffff;
    --section5-bg: #f8f9fa;
}

.dark-theme {
    --bg: #121212;
    --text: #eaeaea;
    --card: #1e1e1e;
    --muted: #9aa0a6;
    /* ألوان خلفيات السكشنات في الوضع الداكن */
    --section1-bg: #181818;
    --section2-bg: #141414;
    --section3-bg: #181818;
    --section4-bg: #141414;
    --section5-bg: #181818;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: Roboto, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html[lang="ar"] body, .rtl body {
    font-family: Cairo, Roboto, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

.card {
    background: var(--card);
    color: var(--text);
}

.text-muted {
    color: var(--muted) !important;
}

.themed-card img {
    filter: brightness(0.95);
}

.dark-theme .themed-card img {
    filter: brightness(0.8) contrast(1.05);
}

.rtl {
    direction: rtl;
}


/* =============================
   تثبيت الـ Navbar أعلى الصفحة
   ============================= */

/* نجعل النافبار ثابتًا بالأعلى */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1030; /* أعلى من الكروت */
}


/* =======================================
   Scroll Stacking لسكشنات الصفحة الرئيسية
   ======================================= */

/* غلاف لكل سكشنات Index */
.scroll-stack {
    position: relative;
}

/* كل سكشن في Index يجب أن يحمل هذا الكلاس */
.scroll-card {
    position: sticky;
    top: var(--nav-height); /* يبدأ الالتصاق بعد النافبار مباشرة */
    padding: 3rem 0; /* مسافة مريحة فوق وتحت */
    /* الخلفية ستكون حسب ترتيب السكشن (nth-of-type) */
    min-height: calc(100vh - var(--nav-height)); /* ليغطي الشاشة تقريبًا */
}

/* تعيين لون خلفية لكل سكشن حسب ترتيبه داخل .scroll-stack */
.scroll-stack > .scroll-card:nth-of-type(1) {
    background-color: var(--section1-bg);
}

.scroll-stack > .scroll-card:nth-of-type(2) {
    background-color: var(--section2-bg);
}

.scroll-stack > .scroll-card:nth-of-type(3) {
    background-color: var(--section3-bg);
}

.scroll-stack > .scroll-card:nth-of-type(4) {
    background-color: var(--section4-bg);
}

.scroll-stack > .scroll-card:nth-of-type(5) {
    background-color: var(--section5-bg);
}

/* للشاشات الصغيرة نقلل الـ padding قليلاً */
@media (max-width: 768px) {
    .scroll-card {
        padding: 2rem 0;
        min-height: calc(100vh - var(--nav-height) - 16px);
    }
}

/* =================
   صور الهيرو (Hero)
   ================= */

.hero-image-wrapper {
    min-height: 220px;
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.06);
}

.dark-theme .hero-image-wrapper {
    background: rgba(255, 255, 255, 0.06);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================
   كروت المنتجات
   ================== */

.product-card {
    border-radius: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
}

.product-image-wrapper {
    min-height: 180px;
    border-radius: 0.8rem 0.8rem 0 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-theme .product-image-wrapper {
    background: rgba(255, 255, 255, 0.10);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-title {
    font-weight: 600;
}

.product-desc {
    font-size: 0.9rem;
}

.product-price {
    font-weight: 600;
}

.product-stock {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.stock-count {
    font-weight: 700;
}

/* ==================
   كروت فريق العمل
   ================== */

.team-card {
    border-radius: 1rem;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.18);
}

.team-avatar-wrapper {
    width: 110px;
    height: 110px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(13, 110, 253, 0.5);
    background-color: rgba(255, 255, 255, 0.3);
}

.dark-theme .team-avatar-wrapper {
    background-color: rgba(0, 0, 0, 0.2);
}

.team-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.social-icons .social-icon {
    font-size: 1.1rem;
    text-decoration: none;
}

/* ============================
   حركات ظهور العناصر مع السكروول
   ============================ */

.fade-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

    .fade-on-scroll.in-view {
        opacity: 1;
        transform: translateY(0);
    }

/* دوران صور المنتجات عندما يخرج سكشن المنتجات من الشاشة */
.product-image.rotate-out {
    animation: product-rotate 0.8s ease-in-out;
}

@keyframes product-rotate {
    0% {
        transform: rotateY(0deg);
    }

    50% {
        transform: rotateY(20deg) scale(0.98);
    }

    100% {
        transform: rotateY(0deg);
    }
}
