/*
  قاعدة RTL في المشروع:
  استخدم الخصائص المنطقية (margin-inline-start / padding-inline-end / inset-inline-start / text-align: start)
  بدل left و right، وكلاسات Bootstrap اللي فيها s و e (ms-2, pe-3, text-start) بدل l و r.
  كده نفس الـ CSS يشتغل في العربي والإنجليزي والنرويجي من غير ملف تاني.
*/

html {
    font-size: 16px;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f7f7f8;
}

main {
    flex: 1;
}

/* الخط الأساسي للموقع: Cairo (عربي وإنجليزي). ملف واحد متغير الوزن من 200 لـ 1000.
   الملف على الموقع نفسه (wwwroot/fonts) عشان سياسة الأمان CSP، والرخصة في Cairo-OFL.txt */
@font-face {
    font-family: "Cairo";
    src: url("../fonts/Cairo-Variable.woff") format("woff");
    font-weight: 200 1000;
    font-style: normal;
    font-display: swap;
}

:root {
    --bs-body-font-family: "Cairo", "Segoe UI", Tahoma, "Noto Sans Arabic", Arial, sans-serif;
}

body {
    font-family: var(--bs-body-font-family);
}

/* أزرار القوائم في الهيدر تاخد شكل روابط القائمة */
.site-header .nav-link.btn-link {
    text-decoration: none;
    border: 0;
}

/* الأسعار: الأرقام تتعرض من الشمال لليمين حتى في الصفحة العربي، ومتتكسرش على سطرين */
.price {
    unicode-bidi: plaintext;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.site-logo {
    max-height: 40px;
    width: auto;
}

/* ألوان حالة البائع: 0 قيد المراجعة / 1 مقبول / 2 مرفوض / 3 موقوف */
.vendor-status-0 { background-color: #b7791f; }
.vendor-status-1 { background-color: #2f855a; }
.vendor-status-2 { background-color: #c53030; }
.vendor-status-3 { background-color: #4a5568; }

/* ملخص أخطاء الفورم: يختفي لو مفيش أخطاء */
.validation-summary-valid {
    display: none;
}

.validation-summary-errors ul {
    margin: 0;
    padding-inline-start: 1.2rem;
}

/* ألوان حالة المنتج: 0 مسودة / 1 قيد المراجعة / 2 منشور / 3 مرفوض / 4 موقوف */
.product-status-0 { background-color: #718096; }
.product-status-1 { background-color: #b7791f; }
.product-status-2 { background-color: #2f855a; }
.product-status-3 { background-color: #c53030; }
.product-status-4 { background-color: #4a5568; }

/* صور المنتجات */
.product-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background-color: #e9ecef;
}

.product-card {
    color: inherit;
}

.product-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3em;
}

.thumb-sm {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 0.375rem;
    background-color: #e9ecef;
}

.image-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.image-tiles img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 0.375rem;
}

/* منتج مالوش صور */
.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

/* عرض صور المنتج */
.gallery-arrow {
    background-color: rgba(0, 0, 0, 0.45);
    border-radius: 50%;
    background-size: 55% 55%;
    width: 2.5rem;
    height: 2.5rem;
}

.product-gallery .carousel-control-prev,
.product-gallery .carousel-control-next {
    width: 15%;
}

/* الصور المصغّرة: Bootstrap بيرسم المؤشرات خطوط صغيرة فوق الصورة، هنا بنخليها صور تحت */
.product-gallery .gallery-thumbs {
    position: static;
    margin: 0.5rem 0 0;
    padding: 0;
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.product-gallery .gallery-thumbs [data-bs-target] {
    width: 4.5rem;
    height: 4.5rem;
    margin: 0;
    padding: 0;
    text-indent: 0;
    border: 2px solid transparent;
    border-radius: 0.375rem;
    overflow: hidden;
    background: none;
    opacity: 0.6;
    flex: 0 0 auto;
}

.product-gallery .gallery-thumbs .active {
    border-color: var(--bs-primary);
    opacity: 1;
}

.product-gallery .gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* وصف المنتج نص عادي: نحافظ على السطور زي ما البائع كتبها */
.product-description {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* اسم طويل من غير مسافات مايكسرش الصفحة */
h1,
td,
.product-name {
    overflow-wrap: anywhere;
}

/* مربع لون صغير (من غير style في الصفحة عشان سياسة الأمان) */
.color-swatch {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    vertical-align: middle;
    opacity: 1;
    background: none;
}

/* ألوان حالة الطلب: 0 جديد / 1 مؤكد / 2 جاري التجهيز / 3 تم الشحن / 4 تم التسليم / 5 ملغي / 6 مرتجع */
.order-status-0 { background-color: #b7791f; }
.order-status-1 { background-color: #2b6cb0; }
.order-status-2 { background-color: #6b46c1; }
.order-status-3 { background-color: #2c7a7b; }
.order-status-4 { background-color: #2f855a; }
.order-status-5 { background-color: #718096; }
.order-status-6 { background-color: #c53030; }

.qty-input {
    width: 5rem;
}

.reject-reason {
    width: 11rem;
}

.qr-code {
    width: 200px;
    height: 200px;
    image-rendering: pixelated;
}

/* الشات */
.chat-thread {
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-msg {
    max-width: 85%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
}

.chat-msg.mine {
    align-self: flex-end;
    background-color: #e7f1ff;
}

.chat-msg.theirs {
    align-self: flex-start;
    background-color: #f1f3f5;
}

.chat-meta {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.15rem;
}

.chat-body {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

/* حالة المحادثة: 0 مستنية رد / 1 اتردّ عليها / 2 مقفولة */
.chat-status-0 { background-color: #b7791f; }
.chat-status-1 { background-color: #2f855a; }
.chat-status-2 { background-color: #718096; }

/* لوجو المتجر */
.store-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 0.5rem;
    background-color: #fff;
    border: 1px solid #dee2e6;
}

.store-logo-sm {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 0.375rem;
    background-color: #fff;
}

/* النجوم */
.stars {
    color: #f59f00;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.stars-empty {
    color: #dee2e6;
}

.site-search {
    min-width: 12rem;
    flex: 1 1 auto;
    max-width: 22rem;
}

/* حالة المرتجع: 0 جديد / 1 مقبول / 2 مرفوض / 3 وصل / 4 الفلوس رجعت / 5 ملغي */
.return-status-0 { background-color: #b7791f; }
.return-status-1 { background-color: #2b6cb0; }
.return-status-2 { background-color: #c53030; }
.return-status-3 { background-color: #6b46c1; }
.return-status-4 { background-color: #2f855a; }
.return-status-5 { background-color: #718096; }

/* الفاتورة: زرار الطباعة مايظهرش في الورقة */
@media print {
    .no-print {
        display: none !important;
    }

    .invoice-page .container {
        max-width: 100%;
    }
}

/* أعمدة المبيعات اليومية في لوحة الإدارة */
.stats-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}

.stats-label {
    width: 3rem;
    flex: 0 0 auto;
    color: #6c757d;
}

.stats-bar {
    flex: 1 1 auto;
    height: 0.9rem;
    accent-color: var(--bs-primary);
}

.stats-value {
    width: 7rem;
    flex: 0 0 auto;
    text-align: end;
}

.vendor-reply {
    background-color: #f8f9fa;
    border-inline-start: 3px solid #adb5bd;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
}

/* العرض بوقت محدد */
.deal-box {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    background-color: #fff5f5;
    border: 1px solid #feb2b2;
}

/* البانرات */
.banner-img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 1;
    object-fit: cover;
}

.home-slider .banner-img {
    max-height: 420px;
}

.deals-section {
    background-color: #fff5f5;
    border-radius: 0.75rem;
    padding: 1rem;
}

/* حالة الاشتراك: 0 مستني الدفع / 1 فعال / 2 منتهي / 3 ملغي */
.subscription-status-0 { background-color: #b7791f; }
.subscription-status-1 { background-color: #2f855a; }
.subscription-status-2 { background-color: #718096; }
.subscription-status-3 { background-color: #718096; }

/* حالة الإعلان: 0 مستني / 1 مقبول / 2 مرفوض / 3 متوقف */
.ad-status-0 { background-color: #b7791f; }
.ad-status-1 { background-color: #2f855a; }
.ad-status-2 { background-color: #c53030; }
.ad-status-3 { background-color: #718096; }

/* الإشعارات */
.notify-count {
    position: absolute;
    top: 0;
    inset-inline-end: -0.25rem;
    font-size: 0.65rem;
}

.notify-unread {
    background-color: #f0f7ff;
}

/* أيقونة التواصل العايمة (شات / واتساب). المكان يمين أو شمال من الإعدادات، ثابت مهما كانت لغة الصفحة */
.contact-fab {
    position: fixed;
    bottom: 1.25rem;
    z-index: 1040;
}

.contact-fab-right {
    right: 1.25rem;
}

.contact-fab-left {
    left: 1.25rem;
}

.contact-fab-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--bs-primary);
    color: #fff;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .2);
    cursor: pointer;
    list-style: none;
    text-decoration: none;
}

a.contact-fab-button:hover,
.contact-fab-button:hover {
    color: #fff;
    filter: brightness(1.1);
}

.contact-whatsapp-button {
    background-color: #1fa855;
}

.contact-fab summary::-webkit-details-marker {
    display: none;
}

.contact-fab-menu {
    position: absolute;
    bottom: 68px;
    min-width: 200px;
}

.contact-fab-right .contact-fab-menu {
    right: 0;
}

.contact-fab-left .contact-fab-menu {
    left: 0;
}

.contact-whatsapp {
    color: #1a8a47;
}

/* ملصق الشحن وورقة التجهيز: الورقة في صفحة لوحدها عند الطباعة */
.packing-check {
    display: inline-block;
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid #212529;
}

@media print {
    .shipping-label {
        break-after: page;
        page-break-after: always;
    }
}

/* تكبير صور المنتج */
.zoomable {
    cursor: zoom-in;
}

.zoom-stage {
    overflow: hidden;
    position: relative;
}

.zoom-image {
    max-width: 100%;
    max-height: calc(100vh - 80px);
    object-fit: contain;
    cursor: zoom-in;
    transition: transform .2s ease;
}

.zoom-image.zoomed {
    transform: scale(2.5);
    cursor: zoom-out;
}

.zoom-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.75rem;
    line-height: 1;
    opacity: .85;
}

.zoom-prev {
    inset-inline-start: 1rem;
}

.zoom-next {
    inset-inline-end: 1rem;
}

/* شريط الأقسام تحت الهيدر: الفرعي بيفتح لما الماوس يقف على القسم (الكمبيوتر) */
.category-nav .nav-link {
    white-space: nowrap;
    padding: .5rem .75rem;
    font-size: .925rem;
}

@media (min-width: 768px) and (hover: hover) {
    .category-dropdown:hover > .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

.category-nav {
    overflow: visible;
}

.category-mega {
    width: min(900px, 90vw);
    padding: 1rem;
}

/* شاشة المدن: كروت المحافظات بتتفتح وتتقفل */
.city-card > summary,
.city-edit > summary {
    cursor: pointer;
    list-style: none;
}

.city-card > summary::-webkit-details-marker,
.city-edit > summary::-webkit-details-marker {
    display: none;
}

.city-card > summary::before {
    content: "▸";
    display: inline-block;
    transition: transform .15s;
}

.city-card[open] > summary::before {
    transform: rotate(90deg);
}

[dir="rtl"] .city-card > summary::before {
    content: "◂";
}

[dir="rtl"] .city-card[open] > summary::before {
    transform: rotate(-90deg);
}

.city-edit > summary {
    display: inline-block;
}

/* زرار "اختار مدينتك" في الهيدر */
.location-button {
    max-width: 14rem;
}

/* صفحة المتجر: البانر والبحث */
.store-banner {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
}

@media (max-width: 576px) {
    .store-banner {
        height: 140px;
    }
}

.store-search {
    max-width: 22rem;
}

/* كارت رابط المتجر في "متجري" */
.store-qr {
    width: 140px;
    height: 140px;
    image-rendering: pixelated;
}

/* مساعد الموقع في أيقونة التواصل */
.help-panel {
    width: min(340px, calc(100vw - 2.5rem));
    max-height: min(560px, calc(100vh - 110px));
    display: flex;
    flex-direction: column;
}

.help-body {
    overflow-y: auto;
}

.help-question {
    white-space: normal;
    font-size: .875rem;
}

.help-answer ul {
    padding-inline-start: 1.25rem;
}

/* الإعلانات المبوبة */
.listing-card-image {
    flex: 0 0 140px;
    background: var(--bs-tertiary-bg);
}

.listing-card-image img {
    width: 140px;
    height: 100%;
    min-height: 110px;
    object-fit: cover;
    display: block;
}

.listing-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.listing-main-image {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    background: #000;
    cursor: zoom-in;
}

.listing-thumb-small {
    width: 80px;
    height: 64px;
    object-fit: cover;
    border-radius: .25rem;
    cursor: pointer;
}

.listing-thumb {
    width: 110px;
    height: 84px;
    border-radius: .375rem;
    overflow: hidden;
    background: var(--bs-tertiary-bg);
    flex: 0 0 auto;
}

.listing-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-thumb-sm {
    width: 64px;
    height: 52px;
}

.listing-thumb-edit {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
}

.listing-thumb-edit img {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: .25rem;
}

.listing-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bs-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.listing-category-tile:hover {
    border-color: var(--bs-primary);
}

/* مواصفات الإعلان (سنة الصنع، الكيلومترات، عدد الأوض…) */
.listing-specs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .5rem;
}

.listing-specs > div {
    background: var(--bs-tertiary-bg);
    border-radius: .5rem;
    padding: .5rem .75rem;
}

.listing-specs dt {
    font-weight: normal;
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

.listing-specs dd {
    margin: 0;
    font-weight: 600;
}

.listing-card-specs {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.listing-card .card-body {
    min-width: 0;
}

.option-sort {
    width: 4.5rem;
}

.app-icon-preview {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    box-shadow: 0 .25rem .5rem rgba(0, 0, 0, .15);
}

/* ---------- تطبيق الموبايل (PWA) ---------- */

/* الشريط اللي تحت على الموبايل */
.mobile-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    background: var(--bs-body-bg);
    border-top: 1px solid var(--bs-border-color);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -.25rem .75rem rgba(0, 0, 0, .06);
}

.mobile-nav a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 58px;
    font-size: .72rem;
    color: var(--bs-secondary-color);
    text-decoration: none;
}

.mobile-nav a.active {
    color: var(--bs-primary);
    font-weight: 600;
}

.mobile-nav svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.mobile-nav-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-top: -14px;
    border-radius: 50%;
    background: var(--bs-primary);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    box-shadow: 0 .25rem .5rem rgba(0, 0, 0, .2);
}

@media (max-width: 767.98px) {
    body.has-mobile-nav {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    /* أيقونة التواصل العايمة فوق الشريط */
    .contact-fab {
        bottom: calc(72px + env(safe-area-inset-bottom));
    }
}

/* بانر "ثبّت التطبيق" */
.install-banner {
    position: fixed;
    inset-inline: .75rem;
    bottom: .75rem;
    z-index: 1045;
    display: flex;
    align-items: center;
    gap: .6rem;
    max-width: 560px;
    margin-inline: auto;
    padding: .6rem .75rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: .9rem;
}

.install-banner img {
    border-radius: 10px;
    flex: 0 0 auto;
}

.install-banner-text {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.3;
}

@media (max-width: 767.98px) {
    .install-banner {
        bottom: calc(70px + env(safe-area-inset-bottom));
    }
}

/* "حسابي" على الموبايل */
.account-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: 1rem .5rem;
    text-align: center;
    font-size: .9rem;
}

.account-tile-icon {
    font-size: 1.6rem;
}

/* التطبيق متثبت (فاتح من الأيقونة): مفيش داعي لروابط التثبيت */
@media (display-mode: standalone) {
    .install-banner {
        display: none !important;
    }
}

.category-image-preview {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: .5rem;
}

/* ---------- قايمة الأقسام في صفحة التسوّق: الرئيسي وتحته أقسامه ---------- */
.category-tree .list-group-item {
    border-inline: 0;
}

.category-tree .cat-all {
    font-weight: 600;
}

.category-tree .cat-main {
    display: flex;
    align-items: stretch;
    padding: 0;
    background-color: var(--bs-tertiary-bg);
}

.category-tree .cat-main.cat-open {
    background-color: var(--bs-primary-bg-subtle);
}

.category-tree .cat-main.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.category-tree .cat-main-link {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    padding: .6rem .9rem;
    font-weight: 600;
    color: var(--bs-body-color);
    text-decoration: none;
}

.category-tree .cat-main.active .cat-main-link,
.category-tree .cat-main.active .cat-toggle {
    color: #fff;
}

.category-tree .cat-name {
    flex: 1 1 auto;
    min-width: 0;
}

.category-tree .cat-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.category-tree .cat-count {
    flex: 0 0 auto;
    font-size: .75rem;
    font-weight: normal;
    color: var(--bs-secondary-color);
    background: var(--bs-body-bg);
    border-radius: 1rem;
    padding: 0 .5rem;
}

.category-tree .cat-main.active .cat-count {
    color: var(--bs-primary);
}

.category-tree .cat-toggle {
    flex: 0 0 auto;
    width: 2.6rem;
    border: 0;
    border-inline-start: 1px solid var(--bs-border-color);
    background: transparent;
    color: var(--bs-secondary-color);
}

.category-tree .cat-chevron {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .15s ease;
}

.category-tree .cat-toggle.collapsed .cat-chevron {
    transform: rotate(-45deg);
}

[dir="rtl"] .category-tree .cat-toggle.collapsed .cat-chevron {
    transform: rotate(135deg);
}

/* الأقسام الفرعية: داخلة لجوه بخط جانبي، أصغر وأفتح */
.category-tree .cat-children {
    display: flex;
    flex-direction: column;
    margin-inline-start: 1.25rem;
    border-inline-start: 2px solid var(--bs-border-color);
    padding: .25rem 0;
}

.category-tree .cat-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .4rem .9rem;
    font-size: .9rem;
    color: var(--bs-secondary-color);
    text-decoration: none;
}

.category-tree .cat-child:hover {
    color: var(--bs-body-color);
    background: var(--bs-tertiary-bg);
}

.category-tree .cat-child.active {
    color: var(--bs-primary);
    font-weight: 600;
    margin-inline-start: -2px;
    border-inline-start: 2px solid var(--bs-primary);
}

.category-tree .cat-classifieds {
    background: var(--bs-warning-bg-subtle);
}

/* فلاتر المقاس واللون */
.attr-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.attr-chip .color-swatch {
    width: 1.1rem;
    height: 1.1rem;
    padding: 0;
    border: 1px solid var(--bs-border-color);
    border-radius: 50%;
    pointer-events: none;
}

.shop-sort {
    display: flex;
    gap: .25rem;
}

/* صفحة القسم الرئيسي */
.category-banner {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: .75rem;
}

.category-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    padding: .75rem .5rem;
    text-align: center;
    color: var(--bs-body-color);
}

.category-tile:hover {
    border-color: var(--bs-primary);
}

.category-tile img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
}

.category-tile-icon {
    font-size: 2rem;
    line-height: 1.2;
}

.category-tile-name {
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.2;
}

/* ---------- بلوكات الأقسام في الرئيسية ---------- */
.home-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    padding: .9rem .4rem .7rem;
    text-align: center;
    color: var(--bs-body-color);
    transition: border-color .15s ease, transform .15s ease;
}

.home-cat:hover {
    border-color: var(--bs-primary);
    transform: translateY(-2px);
}

.home-cat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    font-size: 1.8rem;
    line-height: 1;
    object-fit: cover;
}

.home-cat-tone-0 { background: #e7f0ff; }
.home-cat-tone-1 { background: #e9f9ef; }
.home-cat-tone-2 { background: #fff3e6; }
.home-cat-tone-3 { background: #f3ecff; }
.home-cat-tone-4 { background: #ffeef2; }
.home-cat-tone-5 { background: #e6fbfb; }
.home-cat-tone-6 { background: #fffbe6; }

.home-cat-name {
    font-weight: 600;
    font-size: .88rem;
    line-height: 1.25;
}

.home-cat-count {
    font-size: .75rem;
    color: var(--bs-secondary-color);
}

/* ---------- دواير الماركات ---------- */
.brand-strip {
    display: flex;
    gap: .9rem;
    overflow-x: auto;
    padding-bottom: .25rem;
    scrollbar-width: thin;
}

.brand-circle {
    flex: 0 0 auto;
    width: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    text-align: center;
    text-decoration: none;
    color: var(--bs-body-color);
}

.brand-circle-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--bs-border-color);
    background: var(--bs-body-bg);
    overflow: hidden;
    font-size: .7rem;
    font-weight: 700;
    padding: .35rem;
    word-break: break-word;
}

.brand-circle-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-circle.active .brand-circle-logo,
.brand-circle:hover .brand-circle-logo {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px var(--bs-primary-bg-subtle);
}

.brand-circle-name {
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.2;
}

.brand-circle-count {
    font-size: .72rem;
    color: var(--bs-secondary-color);
}

/* Bootstrap مافيهوش row-cols-lg-7 (7 أقسام في السطر على الكمبيوتر) */
@media (min-width: 992px) {
    .row-cols-lg-7 > * {
        flex: 0 0 auto;
        width: 14.285714%;
    }
}

/* ---------- تمييز الإعلانات ---------- */
.listing-featured-badge {
    background: #f0b400;
    color: #3d2c00;
}

.listing-card.listing-featured {
    border: 2px solid #f0b400;
    background: #fffdf4;
}

[data-bs-theme="dark"] .listing-card.listing-featured {
    background: rgba(240, 180, 0, .08);
}

.promo-package {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .75rem;
    padding: .9rem 1rem;
    cursor: pointer;
}

.btn-check:checked + .promo-package {
    border: 2px solid var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

.promo-package-icon {
    font-size: 1.6rem;
    width: 2.2rem;
    text-align: center;
}
