/* =========================================================
   TWILIGHT - PERFORMANCE CSS
   CSS ONLY
   ========================================================= */

/* ===== الأساس ===== */

html {
    scroll-behavior: auto !important;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden !important;
    margin: 0 !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeSpeed;
}

/* ===== منع إعادة الحسابات غير الضرورية ===== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ===== الصور ===== */

img {
    display: block;
    max-width: 100%;
    border: 0;
}

/* الصور الموجودة أسفل الشاشة */
img[loading="lazy"] {
    content-visibility: auto;
}

/* ===== كروت المنتجات ===== */

.s-product-card,
.s-product-card-content,
.s-product-card-image,
.product-card,
.product-item {
    contain: layout paint;
}

/* ===== صور المنتجات ===== */

.s-product-card-image {
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.s-product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ===== الأقسام البعيدة ===== */

.home-section {
    contain: layout;
}

/* الأقسام التي تأتي بعد أول قسم */
.home-section:nth-child(n+3) {
    content-visibility: auto;
    contain-intrinsic-size: 500px;
}

/* ===== قوائم المنتجات ===== */

.products-list,
.product-list,
.s-products-list {
    contain: layout;
}

/* ===== البانرات ===== */

.s-banner,
.banner,
.main-banner {
    overflow: hidden;
    contain: paint;
}

.s-banner img,
.banner img,
.main-banner img {
    display: block;
    width: 100%;
    max-width: 100%;
    object-fit: cover;
}

/* ===== الهيدر ===== */

header,
.s-header,
.site-header {
    contain: layout style;
}

/* ===== القوائم المنسدلة ===== */

.dropdown,
.menu,
.drawer,
.popup,
.modal {
    contain: layout paint;
}

/* ===== الأزرار والروابط ===== */

button,
a {
    -webkit-tap-highlight-color: transparent;
}

/* ===== إزالة المؤثرات الثقيلة ===== */

.s-product-card,
.product-card,
.banner,
.s-banner {
    transition-property: none !important;
}

/* ===== إيقاف الحركات الثقيلة ===== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== الجوال ===== */

@media (max-width: 768px) {

    body {
        overflow-x: hidden !important;
    }

    .s-product-card,
    .product-card {
        contain: layout paint;
    }

    .s-product-card-image {
        aspect-ratio: 1 / 1;
    }

    .home-section:nth-child(n+3) {
        content-visibility: auto;
        contain-intrinsic-size: 400px;
    }
}

/* ===== تقليل إعادة الرسم ===== */

section {
    contain: layout;
}

/* ===== تحسين العناصر التي تحتوي على صور ===== */

.s-product-card-image,
.product-image,
.product-card-image {
    overflow: hidden;
    contain: paint;
}

/* ===== منع العناصر من تجاوز الشاشة ===== */

.container,
.container-fluid,
section,
main {
    max-width: 100%;
}

/* ===== تحسين الخطوط ===== */

body,
button,
input,
textarea,
select {
    font-display: swap;
}

/* ===== إزالة الظلال الثقيلة ===== */

.s-product-card,
.product-card {
    box-shadow: none !important;
  /* =====================================================
   TWILIGHT - CLEAN PERFORMANCE CSS
   CSS ONLY
   ===================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: auto;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* الصور */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* الفيديو */
video {
    max-width: 100%;
    height: auto;
}

/* الحاويات */
main,
section,
.container,
.container-fluid {
    max-width: 100%;
}

/* كروت المنتجات */
.s-product-card,
.s-product-card-content,
.product-card,
.product-item {
    box-sizing: border-box;
}

/* صور المنتجات */
.s-product-card-image {
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.s-product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* البانرات */
.s-banner,
.banner {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.s-banner img,
.banner img {
    display: block;
    width: 100%;
    max-width: 100%;
}

/* منع تجاوز النص */
h1,
h2,
h3,
h4,
h5,
h6,
p {
    overflow-wrap: break-word;
}

/* تحسين أزرار وروابط الجوال */
button,
a {
    -webkit-tap-highlight-color: transparent;
}

/* تقليل الحركات */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* الجوال */
@media (max-width: 768px) {

    body {
        overflow-x: hidden;
    }

    .s-product-card-image {
        aspect-ratio: 1 / 1;
    }

    img {
        max-width: 100%;
    }
}
}