/* =========================================================
   SALLA CUSTOM CSS
   Responsive / Clean / Production-ready
   يحافظ على الهوية الحالية ونظام 3 صور في الصف
   ========================================================= */

/* =========================
   1) إعدادات عامة
   ========================= */

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

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background-color: #ffffff;
    margin: 5rem auto 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}


/* =========================
   2) شبكة البانرات
   ========================= */

/*
   نطبق إعدادات الشبكة فقط على .grid التي تحتوي banner-entry
   حتى لا نؤثر على بقية Grid الموجودة داخل قالب سلة.
*/
.grid:has(.banner-entry) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: 10px;
    align-items: start;
    justify-content: center;
}


/* =========================
   3) البانرات / الصور
   ========================= */

.banner-entry {
    position: relative;
    display: block;

    width: 100%;
    max-width: 390px;

    /*
       النسبة الأصلية تقريباً:
       390 × 680
       استخدام aspect-ratio يمنع التشوه ويجعل الحجم Responsive.
    */
    aspect-ratio: 39 / 68;
    height: auto;

    margin-inline: auto;

    overflow: hidden;
    border-radius: 10px;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    isolation: isolate;
}


/* الصور داخل البانر إن وجدت */
.banner-entry img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
}


/* الروابط داخل البانر */
.banner-entry > a {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
}


/* =========================
   4) أجهزة التابلت
   ========================= */

@media (max-width: 1200px) {

    .grid:has(.banner-entry) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .banner-entry {
        width: 100%;
        max-width: 390px;
    }
}


/* =========================
   5) الجوال
   ========================= */

@media (max-width: 768px) {

    /*
       نحافظ على 3 عناصر في الصف،
       لكن بدون Fixed Width حتى لا يحدث Horizontal Overflow.
    */
    .grid:has(.banner-entry) {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;

        width: 100%;
        max-width: 100%;

        padding-inline: 8px;
        margin-inline: auto;
    }

    .banner-entry {
        width: 100%;
        max-width: none;
        aspect-ratio: 39 / 68;
        border-radius: 9px;
    }
}


/* =========================
   6) الجوال الصغير
   ========================= */

@media (max-width: 480px) {

    .grid:has(.banner-entry) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        padding-inline: 6px;
    }

    .banner-entry {
        width: 100%;
        max-width: none;
        aspect-ratio: 39 / 68;
        border-radius: 8px;
    }
}


/* =========================
   7) الشاشات الصغيرة جداً
   ========================= */

@media (max-width: 360px) {

    .grid:has(.banner-entry) {
        gap: 5px;
        padding-inline: 5px;
    }

    .banner-entry {
        border-radius: 7px;
    }
}


/* =========================================================
   FOOTER
   ========================================================= */

.store-footer {
    width: 100%;
    margin-top: 0;
    padding: 2rem 1rem 0;
    background-color: #ffffff !important;
}


/* الجزء الداخلي للفوتر */
.store-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: 100%;

    padding: clamp(20px, 4vw, 30px);

    text-align: center;

    background-color: #ededed !important;

    border-radius: 20px 20px 0 0;
}


/* =========================
   شبكة محتويات الفوتر
   ========================= */

.store-footer__inner .container {
    display: grid;
    grid-template-columns: minmax(0, 1fr);

    width: 100%;
    max-width: 1280px;

    margin-inline: auto;

    gap: 1.25rem;

    text-align: center;
    align-items: start;
}


/* =========================
   عناوين الفوتر
   ========================= */

.store-footer__inner h3 {
    margin-top: 0;
    margin-bottom: 1rem;

    font-size: 1.25rem;
    line-height: 1.4;
}


/* =========================
   روابط الفوتر
   ========================= */

.store-footer__inner a {
    color: #f8a13b;
    text-decoration: none;
    transition:
        opacity 0.2s ease,
        text-decoration-color 0.2s ease;
}

.store-footer__inner a:hover {
    text-decoration: underline;
}

.store-footer__inner a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 3px;
}


/* =========================
   تابلت
   ========================= */

@media (min-width: 768px) {

    .store-footer__inner .container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================
   ديسكتوب
   ========================= */

@media (min-width: 1024px) {

    .store-footer__inner .container {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}


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

@media (max-width: 767px) {

    .store-footer {
        padding: 1.5rem 0.75rem 0;
    }

    .store-footer__inner {
        padding: 22px 15px;
        border-radius: 16px 16px 0 0;
    }

    .store-footer__inner .container {
        gap: 1rem;
    }
}


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

img {
    max-width: 100%;
}


/*
   احترام إعداد تقليل الحركة للمستخدم.
*/
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}