/* Explain: Styles for book cards and slider components for consistent display. */
.swiper-pagination-bullet-active {
    background: var(--primary-color) !important;
}

/* ============================================================
   بطاقات الكتب — عرض موحّد ودقيق في كل المتصفحات ومقاييس التكبير
   ============================================================ */

/* حاوية السلايدر: تمنع أي تمدد خارجي */
.swiper.books-swiper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* المسافة بين البطاقات عبر فجوة CSS مرنة تتأقلم مع أي مقاس/تكبير */
.swiper.books-swiper .swiper-wrapper {
    gap: 1rem;
}

/* عرض البطاقة محسوب بنسبة من العرض، فيبقى دقيقاً عند أي نسبة تكبير
   ولا يخرج عن حدود الحاوية ولا يسبّب تمريراً أفقياً */
.swiper.books-swiper .swiper-slide {
    box-sizing: border-box;
    height: auto;
    width: calc((100% - 1rem) / 2); /* هاتف صغير: بطاقتان */
}

@media (min-width: 480px) {
    .swiper.books-swiper .swiper-slide {
        width: calc((100% - 2rem) / 3);
    }
}

@media (min-width: 640px) {
    .swiper.books-swiper .swiper-slide {
        width: calc((100% - 2rem) / 3);
    }
}

@media (min-width: 768px) {
    .swiper.books-swiper .swiper-slide {
        width: calc((100% - 3rem) / 4);
    }
}

@media (min-width: 1024px) {
    .swiper.books-swiper .swiper-slide {
        width: calc((100% - 4rem) / 5);
    }
}

@media (min-width: 1280px) {
    .swiper.books-swiper .swiper-slide {
        width: calc((100% - 5rem) / 6); /* شاشات كبيرة: ست بطاقات */
    }
}

/* ---------- داخل البطاقة ---------- */

/* جسم البطاقة */
.group > .p-4 {
    width: 100%;
    padding-top: 0 !important;
    padding-bottom: 0.75rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* عنوان الكتاب */
.group > .p-4 a.line-clamp-2 {
    line-height: 1.18 !important;
    margin-bottom: 0.15rem !important;
}

/* سطر المؤلف */
.group > .p-4 > p {
    line-height: 1.15 !important;
    margin-bottom: 0.18rem !important;
}

/* شارة التقييم (إن وُجدت) */
.group > .p-4 .inline-block.bg-gray-50 {
    margin-bottom: 0.3rem !important;
    padding-top: 0.15rem !important;
    padding-bottom: 0.15rem !important;
}

/* المنطقة السفلية ملتصقة بالغلاف */
.group > .p-4 .mt-auto {
    margin-top: 0 !important;
    padding-top: 0.1rem !important;
}

/* حاوية الأسعار تمتد بعرض البطاقة الكامل */
.group > .p-4 .mt-auto .flex.flex-col.gap-1\.5 {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* صف السعر ذو الخلفية يمتد بعرض البطاقة كاملاً مع حشوة نصية مريحة */
.group > .p-4 .mt-auto .flex.flex-col.gap-1\.5 .flex.justify-between {
    width: 100% !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    flex-wrap: wrap !important;
    gap: 0.35rem !important;
}

/* حجم خط الأسعار مع السماح بالالتفاف بدل القصّ */
.group > .p-4 .mt-auto .text-sm {
    font-size: 0.78rem !important;
}

.group > .p-4 .mt-auto .flex.justify-between > span,
.group > .p-4 .mt-auto .flex.justify-between > strong {
    white-space: normal !important;
}

/* أزرار البطاقة */
.group > .p-4 .mt-auto .btn {
    white-space: normal !important;
    font-size: 0.7rem !important;
    min-height: 1.9rem;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    line-height: 1.05;
    gap: 0.3rem;
}

.group > .p-4 .btn i,
.group > .p-4 .mt-auto i {
    line-height: 1;
}