*{
    margin: 0;
    padding: 0;
}
:root{
    --primary-color:var(--store-primary-color,#F2882C);
}
a {
    text-decoration: none;
}
li{
    list-style: none;
}
/* إعدادات عامة */
header, nav, .last_post {
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

/* تنسيق الهيدر العلوي */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 24px;
    color: #2c3e50;
    margin: 0;
}

.logo img {
    height: 45px;
}

/* شريط البحث */
.search_bar form {
    display: flex;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    overflow: hidden;
    min-width: 300px;
}

.search_input {
    border: none;
    padding: 8px 15px;
    outline: none;
    flex-grow: 1;
}

.button_search {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    cursor: pointer;
    transition: 0.3s;
}

.button_search:hover {
    background: var(--primary-color);
    filter: brightness(.92);
}

/* شريط التنقل (Nav) */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    padding: 0 5%;
    color: white;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 15px 20px;
    display: block;
    transition: 0.3s;
}

nav .sections li a:hover {
    background-color: var(--primary-color);
}

.social li a {
    font-size: 20px;
    color: #fff;
}

.social li a:hover {
    color: var(--primary-color);
}

/* تنسيق شريط المضاف حديثاً والسلة */
.last_post {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5%;
    background: #f9f9f9;
    border-bottom: 2px solid #eee;
}

.news {
    display: flex;
    align-items: center;
    gap: 15px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.news h3 {
    font-size: 16px;
    color: var(--primary-color);
    margin: 0;
}

.news li img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    object-fit: cover;
}

/* أيقونات المستخدم والسلة */
.cart ul {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cart li {
    position: relative;
}

.cart li a {
    font-size: 22px;
    color: #333;
    text-decoration: none;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #e74c3c;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: bold;
}

/* تحسين للهواتف */
@media (max-width: 768px) {
    header, nav, .last_post {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .search_bar form {
        min-width: 100%;
    }
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* تنسيقات عامة للبطاقة */
/* حاوية المنتجات الرئيسية */
/* ==========================================================================
   Home Categories Bar Styles
   ========================================================================== */
  :root {
            --primary-color: var(--store-primary-color,#ff5c00);
            --primary-light: #fff1df;
            --text-dark: #2e1306;
            --text-muted: #7f7f7f;
            --bg-light: #fffcf9;
            --border-color: #f7ece4;
        }

        body {
            background-color: #ffffff;
            margin: 0;
            padding: 0;
            font-family: 'Segoe UI', Tahoma, sans-serif;
            overflow-x: hidden;
        }

        .product { position: relative; }
        .stock-label { position:absolute; top:10px; right:10px; z-index:5; padding:7px 14px; border-radius:20px; font-size:13px; font-weight:bold; color:white; background:var(--primary-color); }
        .product_name span { display:block; font-size:18px; font-weight:bold; color:#2c3e50; margin:10px 0; }
        .product_description p { color:#64748b; line-height:1.7; min-height:48px; }

        /* ==========================================================================
           1. سكشن الـ Hero الأساسي (أعلى الصفحة)
           ========================================================================== */
        .market-hero {
            direction: rtl;
            display: grid;
            grid-template-columns: 1fr 1.1fr;
            align-items: center;
            gap: 40px;
            background: #fffbf7;
            border-radius: 24px;
            padding: 60px;
            margin: 20px auto;
            max-width: 1400px;
            box-sizing: border-box;
        }

        .market-hero__content {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: center;
        }

        .market-hero__content h1 {
            font-size: 52px;
            font-weight: 800;
            line-height: 1.3;
            color: var(--text-dark);
            margin: 0 0 20px 0;
        }

        .market-hero__content h1 span {
            color: var(--primary-color);
        }

        .market-hero__content p {
            font-size: 20px;
            line-height: 1.8;
            color: #5f5f5f;
            margin: 0 0 35px 0;
            max-width: 500px;
        }

        .market-hero__buttons {
            display: flex;
            align-items: center;
            gap: 16px;
            width: 100%;
        }

        .market-hero__buttons .btn {
            height: 54px;
            padding: 0 40px;
            border-radius: 12px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            font-weight: 700;
            text-decoration: none;
            transition: all 0.3s ease;
            cursor: pointer;
            box-sizing: border-box;
        }

        .btn-primary {
            background: var(--primary-color);
            color: #ffffff;
            border: none;
        }

        .btn-primary:hover {
            background: #e05200;
            transform: translateY(-2px);
        }

        .btn-outline {
            background: #ffffff;
            color: #000000;
            border: 1px solid #e0e0e0;
        }

        .btn-outline:hover {
            background: #fafafa;
            border-color: #999;
            transform: translateY(-2px);
        }

        .market-hero__media {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .market-hero__media img {
            width: 100%;
            max-width: 500px;
            height: auto;
            object-fit: contain;
        }

        /* المؤشرات النقطية للـ Slider السفلي */
        .hero-bullets {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin-top: 30px;
            width: 100%;
            grid-column: span 2;
        }

        .hero-bullets span {
            width: 8px;
            height: 8px;
            background: #d1d5db;
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .hero-bullets span.active {
            background: var(--primary-color);
            width: 20px;
            border-radius: 10px;
        }

        /* ==========================================================================
           2. سكشن المساحة الإعلانية المصدّرة ديناميكياً (البانر الأوسط)
           ========================================================================== */
        .promo-banner-section {
            max-width: 1400px;
            margin: 40px auto;
            padding: 0 20px;
            box-sizing: border-box;
            position: relative;
        }

        .promo-banner-container {
            width: 100%;
            border-radius: 20px;
            overflow: hidden;
            position: relative;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
            aspect-ratio: 1200 / 320; /* يحافظ على أبعاد الفوتوشوب القياسية لمنع التمدد الخاطئ */
        }

        .promo-banner-container a {
            display: block;
            width: 100%;
            height: 100%;
        }

        .promo-banner-container img {
            width: 100%;
            height: 100%;
            object-fit: cover; /* يضمن ملء المساحة بذكاء دون تشويه المكونات */
            display: block;
            transition: transform 0.5s ease;
        }

        .promo-banner-container:hover img {
            transform: scale(1.015);
        }

        /* أزرار التنقل الجانبية للـ Banner المماثلة للصورة */
        .banner-arrow {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 40px;
            height: 40px;
            background: #ffffff;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 10px rgba(0,0,0,0.1);
            color: #333;
            text-decoration: none;
            font-weight: bold;
            z-index: 5;
            transition: all 0.3s ease;
        }
        .banner-arrow:hover { background: var(--primary-color); color: #fff; }
        .banner-arrow.prev { right: 35px; }
        .banner-arrow.next { left: 35px; }

        /* ==========================================================================
           3. سكشن تسوق حسب الأقسام (البار الدائري الجديد)
           ========================================================================== */
        .home-categories-bar {
            direction: rtl;
            width: 100%;
            max-width: 1400px;
            margin: 40px auto 20px auto;
            padding: 0 20px;
            box-sizing: border-box;
        }

        .categories-bar__title {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 25px;
        }

        .categories-bar__title h2 {
            font-size: 22px;
            font-weight: 800;
            color: var(--text-dark);
            margin: 0;
        }

        .categories-bar__title .line {
            width: 25px;
            height: 4px;
            background: var(--primary-color);
            border-radius: 2px;
        }
.categories-bar__container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 5px;

    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: none;

    direction: rtl;

    scroll-behavior: smooth;
}

        .categories-bar__container::-webkit-scrollbar {
            display: none;
        }

        .category-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 12px;
            text-decoration: none;
            min-width: 140px;
            background: #ffffff;
            border: 1px solid #f5f5f5;
            padding: 20px 10px;
            border-radius: 16px;
            text-align: center;
            transition: all 0.3s ease;
            box-sizing: border-box;
        }

        .category-item__icon {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            /* background: #fff1df;  */
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .category-item__icon img {
            width: 65px;
            height: 65px;
            object-fit: contain;
        }

        .category-item h4 {
            font-size: 16px;
            font-weight: 700;
            color: #000000;
            margin: 0;
        }

        .category-item span {
            font-size: 13px;
            color: var(--text-muted);
        }

        .category-item:hover {
            border-color: var(--primary-color);
            transform: translateY(-4px);
            box-shadow: 0 10px 20px rgba(255, 92, 0, 0.05);
        }

        /* ==========================================================================
           4. سكشن مميزات المتجر (المربعات الأيقونية السفلية)
           ========================================================================== */
        .market-features {
            direction: rtl;
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            max-width: 1400px;
            margin: 50px auto;
            padding: 24px;
            background: #fdfaf7;
            border-radius: 20px;
            box-sizing: border-box;
        }

        .feature-box {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 16px;
            padding: 10px;
            position: relative;
        }

        /* إضافة خط عمودي فاصل بين المميزات تماشياً مع الستايل النظيف */
        .feature-box:not(:last-child)::after {
            content: '';
            position: absolute;
            left: -10px;
            top: 20%;
            height: 60%;
            width: 1px;
            background: #e6dfd9;
        }

        .feature-box .icon {
            font-size: 26px;
            background: #ffe3cb;
            width: 54px;
            height: 54px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            color: var(--primary-color);
        }

        .feature-text {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .feature-box h4 {
            font-size: 16px;
            font-weight: 700;
            color: #000000;
            margin: 0;
        }

        .feature-box p {
            font-size: 13px;
            color: var(--text-muted);
            margin: 0;
            line-height: 1.4;
        }

        /* ==========================================================================
           التجاوب الكامل والشامل مع الشاشات (Responsive Design)
           ========================================================================== */
        
        @media (min-width: 992px) {
            .categories-bar__container {
                justify-content: center; /* توسيط الأقسام تلقائياً في الشاشات الكبيرة */
                gap: 25px;
            }
        }

        @media (max-width: 992px) {
            .market-hero {
                grid-template-columns: 1fr;
                padding: 40px 30px;
                text-align: center;
                gap: 30px;
            }
            .market-hero__content {
                align-items: center;
            }
            .market-hero__buttons {
                justify-content: center;
            }
            .hero-bullets {
                grid-column: span 1;
            }
            .market-features {
                grid-template-columns: repeat(2, 1fr);
                gap: 30px;
            }
            .feature-box::after {
                display: none !important; /* إلغاء الخطوط الجانبية في الشاشات الصغيرة */
            }
        }

        @media (max-width: 768px) {
            .market-hero__content h1 { font-size: 36px; }
            .market-hero__content p { font-size: 16px; }
            .market-hero__buttons { flex-direction: column; }
            .market-hero__buttons .btn { width: 100%; }
            .promo-banner-container { aspect-ratio: 340 / 130; } /* تحسين استيعاب البانر على شاشات الموبايل */
            .banner-arrow { width: 32px; height: 32px; font-size: 14px; }
            .banner-arrow.prev { right: 10px; }
            .banner-arrow.next { left: 10px; }
            .category-item { min-width: 115px; padding: 15px 8px; }
            .category-item__icon { width: 66px; height: 66px; padding: 0; }
            .category-item__icon img { width: 55px; height: 55px; }
            .category-item h4 { font-size: 14px; }
            .market-features {                 grid-template-columns: repeat(2, 1fr);
; gap: 10px; background: #fdfaf7; padding: 10px; }
        }
        /* تنسيقات ترويسة القسم المحدثة لتشمل الأزرار */
   /* ==========================================================================
           تنسيقات عنوان وعناصر التحكم لشريط الأقسام
           /* ========================================================================== */
    

       

        .categories-nav-buttons {
            display: flex !important;
            gap: 12px !important;
            align-items: center !important;
            position: relative !important;
            z-index: 99 !important;
            visibility: visible !important;
            opacity: 1 !important;
        }

        .categories-nav-buttons .nav-btn {
            width: 42px !important;
            height: 42px !important;
            border-radius: 50% !important;
            border: 1px solid #e5e7eb !important;
            background-color: #ffffff !important;
            color: #4b5563 !important;
            cursor: pointer !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            font-size: 16px !important;
            transition: all 0.25s ease !important;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06) !important;
            padding: 0 !important;
            outline: none !important;
        }

        .categories-nav-buttons .nav-btn:hover {
            background-color: var(--primary-color) !important;
            color: #ffffff !important;
            border-color: var(--primary-color) !important;
            box-shadow: 0 4px 12px color-mix(in srgb, var(--primary-color) 25%, transparent) !important;
            transform: translateY(-2px) !important;
        }

        .categories-nav-buttons .nav-btn:active {
            transform: translateY(0px) scale(0.95) !important;
        }

  
.product_content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* توزيع تلقائي للمنتجات */
    gap: 30px;
    padding: 40px 5%;
    direction: rtl;
    background-color: #f9f9f9;
}

.empty-products-message {
    grid-column: 1 / -1;
    max-width: 620px;
    width: 100%;
    margin: 30px auto;
    padding: 34px 22px;
    text-align: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.empty-products-message h1 {
    margin: 0 0 12px;
    color: #2c3e50;
    font-size: 28px;
    line-height: 1.4;
}

.empty-products-message p {
    margin: 0 0 22px;
    color: #64748b;
    font-size: 16px;
    line-height: 1.8;
}

.empty-products-message a {
    display: inline-block;
    padding: 11px 18px;
    color: #fff;
    background: var(--primary-color);
    border-radius: 8px;
    font-weight: 700;
}

/* بطاقة المنتج الواحدة */
.product {
    background: #fff;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* صورة المنتج */
.product_img {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 15px;
    /* اختياري: إضافة خلفية بيضاء أو شفافة لملء الفراغ إذا كانت أبعاد الصورة أصغر من الإطار */
    background-color: #fff; 
}

.product_img img {
    width: 100%;
    height: 100%;
    /* التعديل هنا: يمنع التمديد والقص ويحافظ على أبعاد الصورة الأصلية */
    object-fit: contain; 
    transition: transform 0.45s ease;
}

.product:hover .product_img img,
.product_img:hover img {
    transform: scale(1.08);
}

.wishlist-favorite {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 8;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: #e11d48;
    box-shadow: 0 8px 18px rgba(15,23,42,.12);
    font-size: 18px;
    line-height: 1;
    transition: transform .25s ease, box-shadow .25s ease;
}

.wishlist-favorite:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 12px 24px rgba(15,23,42,.18);
}

.product-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 7;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    max-width: calc(100% - 62px);
}

.product-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    box-shadow: 0 6px 14px rgba(15,23,42,.12);
}

.discount-badge { background: #dc2626; }
.new-badge { background: #0891b2; }
.best-badge { background: #7c3aed; }
.arrival-badge { background: #16a34a; }

.quick-view {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translate(-50%, 12px);
    z-index: 6;
    min-width: 112px;
    padding: 9px 14px;
    border-radius: 8px;
    background: rgba(17, 24, 39, .88);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease, background .25s ease;
}

.product_img:hover .quick-view,
.product:hover .quick-view {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.quick-view:hover {
    background: var(--primary-color);
}

/* تصنيف المنتج */
.product_section a,
.product_section span {
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
    background: color-mix(in srgb, var(--primary-color) 12%, transparent);
    padding: 3px 10px;
    border-radius: 20px;
}

/* اسم المنتج */
.product_name a,
.product_name span {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
    margin: 10px 0;
}

.product-rating-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 28px;
}

.rating-count {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

/* السعر */
.product_price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 20px;
    color: #e74c3c;
    font-weight: 800;
    margin-bottom: 10px;
}

.product_price a {
    text-decoration: none;
    color: inherit;
}

.old-price {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 700;
    text-decoration: line-through;
}

.discount-percent {
    color: #dc2626;
    background: #fee2e2;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 900;
}

/* الوصف */
.product_description a,
.product_description p {
    font-size: 14px;
    color: #7f8c8d;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* عرض سطرين فقط */
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
}

/* التحكم في الكمية */
.qty_input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.qty_input button {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
}

.qty_input input {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
}

/* زر إضافة للسلة */
.addToCart {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
}

.addToCart:hover {
    background-color: var(--primary-color);
    filter: brightness(.92);
}

.addToCart i {
    margin-right: 8px;
}

/* للموبايل */
@media (max-width:991px){

    .market-hero{
        flex-direction:column-reverse;
        text-align:center;
        padding:50px 20px 30px;
        gap:20px;
    }

    .market-hero::before{
        width:620px;
        height:620px;
        left:50%;
        top:auto;
        bottom:-160px;
        transform:translateX(-50%);
    }

    .market-hero__content,
    .market-hero__media{
        width:100%;
        align-items: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        justify-items: center;
    }

    .market-hero__badge{
        font-size:15px;
        padding:10px 18px;
        margin-bottom:20px;
        align-items: center;
    }

    .market-hero__content h1{
        font-size:18px;
        margin-bottom:20px;
    }

    .market-hero__content p{
        font-size:16px;
        line-height:1.7;
        margin-bottom:35px;
    }

    .market-hero__buttons{
        justify-content:center;
        gap:15px;
    }

    .btn{
        width:100%;
        height:68px;
        font-size:24px;
    }

    .market-hero__media img{
        max-width:620px;
    }
}

/* شاشة أصغر */
@media (max-width:600px){

    .market-hero{
        min-height:auto;
    }

    .market-hero__content h1{
        font-size:30px;
        line-height: 1.5;
        padding-bottom: 20px;
    }

    .market-hero__content p{
        font-size:14px;
    }

    .btn{
        font-size:20px;
        height:60px;
        border-radius:14px;
    }

    .market-hero__media img{
        width:115%;
    }
}

.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #cbd5e1;
    font-size: 16px;
    line-height: 1;
    margin: 8px 0;
}
.star-rating .filled { color: #f59e0b; }
.star-rating .rating-number {
    color: #64748b;
    font-size: 13px;
    margin-right: 6px;
}
.whatsapp-float {
    position: fixed;
    left: 18px;
    bottom: 18px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 28px;
    z-index: 1000;
    box-shadow: 0 10px 24px rgba(0,0,0,.18);
}
.dashboard-shell {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 16px;
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}
.dashboard-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.dashboard-nav a,
.action-btn {
    background: #2c3e50;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    border: 0;
    cursor: pointer;
}
.panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 8px 22px rgba(15,23,42,.06);
}
.form-message {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    line-height: 1.8;
    font-weight: 700;
}
.form-message.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.form-message.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.profile-panel {
    padding: 24px;
}
.profile-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.profile-form label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-weight: 700;
}
.profile-form input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
}
.profile-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 16%, transparent);
}
.profile-form .action-btn {
    grid-column: 1 / -1;
    justify-self: start;
}
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.public-pagination {
    direction: rtl;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0 16px 42px;
    background: #f9f9f9;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}
.public-page-link {
    min-width: 42px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(15,23,42,.05);
    text-align: center;
    font-weight: 700;
}
.public-page-link.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}
.public-page-link.disabled {
    opacity: .45;
    pointer-events: none;
}
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.responsive-table th,
.responsive-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px;
    text-align: right;
    vertical-align: top;
}
.responsive-table th {
    background: #f8fafc;
    color: #334155;
}

@media (max-width: 600px) {
    .product_content {
        grid-template-columns: 1fr;
    }
    .responsive-table thead { display: none; }
    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td { display: block; width: 100%; }
    .responsive-table tr {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 12px;
        overflow: hidden;
    }
    .responsive-table td[data-label]::before {
        content: attr(data-label) ": ";
        display: block;
        color: #64748b;
        font-weight: 700;
        margin-bottom: 4px;
    }
    .profile-form {
        grid-template-columns: 1fr;
    }
    .profile-form .action-btn {
        width: 100%;
        justify-self: stretch;
    }
    .public-pagination {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 10px 28px;
    }
    .public-page-link {
        min-width: 38px;
        padding: 9px 12px;
    }
}

@media (max-width: 480px) {
    .product_img { height: 180px; }
    .product_name a, .product_name span { font-size: 16px; }
    .product_price { font-size: 18px; }
    .qty_input { gap: 6px; }
}

@media (min-width: 480px) and (max-width: 768px) {
    .product_img { height: 190px; }
}
/* Public category page title. */
.section-page-heading {
    width: min(1200px, calc(100% - 32px));
    margin: 28px auto 8px;
}

.section-page-heading h1 {
    margin: 0;
    color: var(--text-color);
    font-size: 28px;
    line-height: 1.4;
}

/* Category page surfaces follow the active theme. */
.section-products-page .section-page-heading {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    background: transparent !important;
}

.section-products-page .product_content {
    background: var(--bg-color);
}

.section-products-page .product {
    position: relative;
    background: var(--card-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 24px var(--shadow-color);
}

.section-products-page .product:hover {
    box-shadow: 0 14px 28px color-mix(in srgb, var(--primary-color) 18%, var(--shadow-color));
}

.section-products-page .product_img {
    background: var(--surface-soft) !important;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.section-products-page .wishlist-favorite {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 16px var(--shadow-color);
}

.section-products-page .product_name a {
    color: var(--text-color);
}

.section-products-page .product_description p {
    color: var(--muted-text);
    line-height: 1.7;
    min-height: 48px;
}

.section-products-page .qty_input button,
.section-products-page .qty_input input {
    background: var(--surface-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

.section-products-page .empty-products-message {
    background: var(--card-color);
    color: var(--text-color);
    border-color: var(--border-color);
    box-shadow: 0 10px 24px var(--shadow-color);
}

.section-products-page .empty-products-message h2 {
    color: var(--text-color);
}

.section-products-page .empty-products-message p {
    color: var(--muted-text);
}

.section-products-page .public-pagination {
    background: var(--bg-color);
}

.section-products-page .public-page-link {
    background: var(--card-color);
    color: var(--text-color);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.section-products-page .public-page-link:hover,
.section-products-page .public-page-link.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

html[data-theme="dark"] .section-products-page .discount-percent {
    background: #4c1d1d;
    color: #fecaca;
}

/* Keep the beginning of the RTL category carousel reachable on desktop. */
@media (min-width: 992px) {
    .categories-bar__container {
        justify-content: flex-start;
    }
}
