/* =============================================
   MUTHAMIN — نظام UI متكامل لمتجر سلة
   النسخة: 2.0 | جاهز للنسخ المباشر
   ============================================= */

/* ═══════════════════════════════
   1. المتغيرات الأساسية
═══════════════════════════════ */
:root {
    --primary:       #111111;
    --accent:        #ff8a00;
    --accent-hover:  #e67c00;
    --accent-light:  #fff3e6;
    --accent-mid:    #ffe0b2;
    --text:          #1a1a1a;
    --muted:         #6b6b6b;
    --border:        #eaeaea;
    --bg:            #f6f6f7;
    --white:         #ffffff;
    --success:       #16a34a;
    --danger:        #dc2626;

    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     16px;

    --shadow-sm:     0 1px 4px rgba(0,0,0,0.06);
    --shadow-md:     0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:     0 8px 28px rgba(0,0,0,0.10);

    --transition:    0.22s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ═══════════════════════════════
   2. القاعدة العامة
═══════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    direction: rtl;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* ═══════════════════════════════
   3. الهيدر
═══════════════════════════════ */
.site-header {
    background: var(--primary);
    color: #fff;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.site-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
}

.site-header nav a {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
    margin-inline-start: 20px;
    transition: color var(--transition);
}

.site-header nav a:hover {
    color: #fff;
}


/* ═══════════════════════════════
   4. بانر / هيرو
═══════════════════════════════ */
.hero-banner {
    background: var(--primary);
    color: #fff;
    padding: 48px 24px;
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 50%, rgba(255,138,0,0.12) 0%, transparent 60%);
    pointer-events: none;
}

.hero-badge {
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 14px;
    letter-spacing: 0.5px;
}

.hero-banner h1 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.hero-banner p {
    font-size: 14px;
    color: rgba(255,255,255,0.65);
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}


/* ═══════════════════════════════
   5. الأزرار — النظام الكامل
═══════════════════════════════ */

/* الزر الأساسي */
.btn,
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 13px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
    line-height: 1;
}

.btn:hover,
.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255,138,0,0.3);
}

.btn:active,
.btn-primary:active {
    transform: translateY(0);
}

/* زر الإضافة للسلة */
.btn-add-to-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 13px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
}

.btn-add-to-cart:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255,138,0,0.35);
}

/* زر ثانوي */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 13px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* زر الشراء — أكبر وأقوى */
.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 800;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all var(--transition);
    width: 100%;
}

.btn-checkout:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(255,138,0,0.4);
}

/* حالة زر صغير (داخل البطاقة) */
.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    width: auto;
}


/* ═══════════════════════════════
   6. بطاقة المنتج
═══════════════════════════════ */
.product-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #ffd094;
}

/* شارة المنتج (جديد / خصم / الأكثر مبيعاً) */
.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    z-index: 2;
    letter-spacing: 0.3px;
}

.product-badge.badge-sale   { background: var(--danger); }
.product-badge.badge-new    { background: var(--success); }

/* صورة المنتج */
.product-image,
.product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* محتوى البطاقة */
.product-card-body {
    padding: 14px 16px;
}

.product-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
    color: var(--text);
}

.product-card-meta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 12px;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}


/* ═══════════════════════════════
   7. السعر
═══════════════════════════════ */
.price {
    color: var(--accent);
    font-weight: 800;
    font-size: 17px;
}

.price-old {
    color: var(--muted);
    font-size: 13px;
    text-decoration: line-through;
    margin-inline-end: 4px;
}

.price-discount {
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}


/* ═══════════════════════════════
   8. شبكة المنتجات
═══════════════════════════════ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}


/* ═══════════════════════════════
   9. حقول الإدخال
═══════════════════════════════ */
input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    color: var(--text);
    background: var(--white);
    transition: all var(--transition);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,138,0,0.12);
}

input::placeholder,
textarea::placeholder {
    color: #bbb;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
}

.form-group {
    margin-bottom: 14px;
}


/* ═══════════════════════════════
   10. الصناديق العامة
═══════════════════════════════ */
.box,
.checkout-box,
.order-summary {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.box-header {
    font-size: 15px;
    font-weight: 700;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}


/* ═══════════════════════════════
   11. عنوان القسم
═══════════════════════════════ */
.section-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 22px;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}


/* ═══════════════════════════════
   12. الإشعارات والتنبيهات
═══════════════════════════════ */
.notice,
blockquote {
    background: var(--accent-light);
    border-inline-end: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    color: #7a4a00;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.notice.notice-success {
    background: #f0fdf4;
    border-color: var(--success);
    color: #14532d;
}

.notice.notice-danger {
    background: #fef2f2;
    border-color: var(--danger);
    color: #7f1d1d;
}


/* ═══════════════════════════════
   13. ملخص الطلب
═══════════════════════════════ */
.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 7px 0;
    color: var(--muted);
}

.summary-row.total {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    border-top: 2px solid var(--border);
    margin-top: 8px;
    padding-top: 14px;
}

.summary-row.total span:last-child {
    color: var(--accent);
}


/* ═══════════════════════════════
   14. شارات الثقة
═══════════════════════════════ */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.trust-badge {
    font-size: 11px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}


/* ═══════════════════════════════
   15. التابز
═══════════════════════════════ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    cursor: pointer;
    border: none;
    background: none;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    white-space: nowrap;
}

.tab-btn:hover      { color: var(--text); }
.tab-btn.active     { color: var(--accent); border-bottom-color: var(--accent); }


/* ═══════════════════════════════
   16. كروت الإحصائيات
═══════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}


/* ═══════════════════════════════
   17. Responsive — الجوال
═══════════════════════════════ */
@media (max-width: 768px) {
    .site-header { padding: 0 16px; }

    .hero-banner { padding: 32px 16px; }
    .hero-banner h1 { font-size: 22px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .checkout-layout {
        display: flex;
        flex-direction: column;
    }

    .box,
    .checkout-box,
    .order-summary { padding: 16px; }
}

@media (max-width: 360px) {
    .products-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .price { font-size: 15px; }
}