/* ========================================================
   SOAQ MARKETPLACE - DESIGN SYSTEM & STYLESHEET
   نظام التصميم الاحترافي لمنصة سوق المتعددة التجار
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #0d9488;
    --primary-light: #14b8a6;
    --primary-dark: #0f766e;
    --primary-subtle: rgba(13, 148, 136, 0.12);
    
    --secondary: #f59e0b;
    --secondary-hover: #d97706;
    --secondary-subtle: rgba(245, 158, 11, 0.12);

    --dark-bg: #0b1120;
    --dark-surface: #131d33;
    --dark-card: #1a2642;
    --dark-card-hover: #223254;
    --dark-border: rgba(255, 255, 255, 0.08);

    --light-bg: #f8fafc;
    --light-surface: #ffffff;
    --light-card: #ffffff;
    --light-border: #e2e8f0;

    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 25px rgba(13, 148, 136, 0.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 26px;
    --radius-full: 9999px;

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
    scroll-behavior: smooth;
    direction: rtl;
}

body {
    background-color: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* التمرير المخصص */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* روابط وعناصر أساسية */
a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================================
   الشريط العلوي و الترويسة (Header & Navigation)
   ======================================================== */

.top-bar {
    background: var(--dark-bg);
    color: var(--text-muted);
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid var(--dark-border);
}
.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.top-links {
    display: flex;
    gap: 20px;
    align-items: center;
}
.top-links a:hover {
    color: var(--primary-light);
}

.header-main {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--light-border);
    transition: var(--transition);
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 24px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 26px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.5px;
}
.brand-logo .logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.search-box {
    flex: 1;
    max-width: 580px;
    position: relative;
}
.search-box input {
    width: 100%;
    padding: 12px 20px 12px 48px;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    font-size: 14.5px;
    color: var(--text-primary);
    transition: var(--transition);
}
.search-box input:focus {
    outline: none;
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}
.search-box button {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.search-box button:hover {
    background: var(--primary-dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.action-btn.cart-btn {
    background: #f1f5f9;
    color: var(--text-primary);
}
.action-btn.cart-btn:hover {
    background: var(--primary-subtle);
    color: var(--primary);
}
.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--secondary);
    color: white;
    font-size: 11px;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.4);
}

.action-btn.vendor-cta {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-hover));
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}
.action-btn.vendor-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}

/* شريط الأقسام السريع */
.categories-nav {
    background: white;
    border-bottom: 1px solid var(--light-border);
    padding: 10px 0;
}
.categories-list {
    display: flex;
    gap: 24px;
    list-style: none;
    overflow-x: auto;
    padding-bottom: 4px;
    white-space: nowrap;
}
.categories-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}
.categories-list a:hover,
.categories-list a.active {
    color: var(--primary);
    background: var(--primary-subtle);
}

/* ========================================================
   قسم البانر الرئيسي والترويج (Hero Section)
   ======================================================== */

.hero-section {
    padding: 30px 0;
}
.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.hero-main-banner {
    position: relative;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #093b37 0%, #0d9488 50%, #064e3b 100%);
    color: white;
    padding: 50px 40px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 380px;
    box-shadow: var(--shadow-xl);
}
.hero-main-banner::after {
    content: '';
    position: absolute;
    left: -50px;
    bottom: -50px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, transparent 70%);
    border-radius: var(--radius-full);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    width: fit-content;
    margin-bottom: 18px;
    color: #fef08a;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.hero-title {
    font-size: 38px;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 14px;
}
.hero-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 500px;
    margin-bottom: 26px;
}
.hero-btns {
    display: flex;
    gap: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-hover));
    color: white;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
    transition: var(--transition);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.45);
}

.btn-white {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-white:hover {
    background: white;
    color: var(--dark-bg);
}

.hero-side-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--light-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.side-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.side-card.merchant-highlight {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    color: white;
    border: 1px solid #334155;
}

/* ========================================================
   بطاقات ومميزات المنصة (Feature Badges)
   ======================================================== */

.features-bar {
    padding: 20px 0;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.feature-box {
    background: white;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}
.feature-box:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}
.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: var(--primary-subtle);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.feature-title {
    font-size: 15px;
    font-weight: 700;
}
.feature-sub {
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* ========================================================
   شبكة المنتجات (Product Cards Grid)
   ======================================================== */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}
.section-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    position: relative;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -14px;
    right: 0;
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: var(--radius-full);
}
.section-link {
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-link:hover {
    gap: 10px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(13, 148, 136, 0.4);
}

.product-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    background: #f8fafc;
    overflow: hidden;
}
.product-image-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .product-image-wrap img {
    transform: scale(1.06);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--secondary);
    color: white;
    font-size: 11.5px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.product-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-vendor {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.product-vendor:hover {
    color: var(--primary);
}

.product-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 42px;
}
.product-name:hover {
    color: var(--primary);
}

.product-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 14px;
}
.price-current {
    font-size: 18px;
    font-weight: 900;
    color: var(--primary);
}
.price-old {
    font-size: 13.5px;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-card .add-cart-btn {
    width: 100%;
    background: #f1f5f9;
    color: var(--text-primary);
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}
.product-card .add-cart-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

/* ========================================================
   شبكة المتاجر والتجار المتميزين (Merchants Grid)
   ======================================================== */

.merchants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.merchant-card {
    background: white;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition);
}
.merchant-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.merchant-logo {
    width: 76px;
    height: 76px;
    border-radius: var(--radius-full);
    border: 3px solid var(--primary-subtle);
    padding: 4px;
    background: white;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.merchant-name {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 4px;
}
.merchant-city {
    font-size: 12.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}
.merchant-btn {
    padding: 8px 20px;
    border-radius: var(--radius-full);
    background: var(--primary-subtle);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}
.merchant-btn:hover {
    background: var(--primary);
    color: white;
}

/* ========================================================
   لوحات التحكم (Admin & Merchant Dashboard Styles)
   ======================================================== */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
}
.dashboard-sidebar {
    width: 270px;
    background: var(--dark-bg);
    color: white;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--dark-border);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-light);
    margin-bottom: 32px;
    padding: 0 10px;
}
.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 14px;
}
.sidebar-link:hover,
.sidebar-link.active {
    background: var(--primary);
    color: white;
}
.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--dark-border);
}

.dashboard-main {
    flex: 1;
    background: #f1f5f9;
    padding: 30px;
    overflow-y: auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.dashboard-header h1 {
    font-size: 24px;
    font-weight: 800;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--light-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.stat-value {
    font-size: 26px;
    font-weight: 900;
    color: var(--text-primary);
    margin-top: 4px;
}
.stat-title {
    font-size: 13.5px;
    color: var(--text-secondary);
    font-weight: 600;
}
.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.stat-icon.teal { background: var(--primary-subtle); color: var(--primary); }
.stat-icon.amber { background: var(--secondary-subtle); color: var(--secondary); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.12); color: var(--info); }
.stat-icon.green { background: rgba(16, 185, 129, 0.12); color: var(--success); }

/* الجداول (Data Tables) */
.table-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--light-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 30px;
}
.table-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--light-border);
}
.table-title {
    font-size: 17px;
    font-weight: 800;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    font-size: 14px;
}
.data-table th {
    background: #f8fafc;
    padding: 14px 20px;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--light-border);
}
.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--light-border);
    vertical-align: middle;
}
.data-table tr:hover td {
    background: #f8fafc;
}

/* الشارات (Badges) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
}
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-success { background: #d1fae5; color: #047857; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-primary { background: var(--primary-subtle); color: var(--primary); }

/* ========================================================
   سلة التسوق والدفع (Cart & Checkout)
   ======================================================== */

.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    padding: 30px 0;
}
.cart-items-box {
    background: white;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-lg);
    padding: 24px;
}
.cart-summary-box {
    background: white;
    border: 1px solid var(--light-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    height: fit-content;
}
.cart-item-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--light-border);
}
.cart-item-img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: #f1f5f9;
}
.cart-item-info {
    flex: 1;
}

/* ========================================================
   تذييل الصفحة (Footer)
   ======================================================== */

.site-footer {
    background: var(--dark-bg);
    color: var(--text-muted);
    padding: 60px 0 20px;
    margin-top: auto;
    border-top: 1px solid var(--dark-border);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand {
    font-size: 24px;
    font-weight: 900;
    color: white;
    margin-bottom: 14px;
}
.footer-desc {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 20px;
}
.footer-col h4 {
    color: white;
    font-size: 16px;
    margin-bottom: 18px;
    font-weight: 800;
}
.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-col a:hover {
    color: var(--primary-light);
}
.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--dark-border);
    font-size: 13.5px;
}

/* تنبيهات النظام */
.alert-box {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.alert-box.success { background: #d1fae5; color: #047857; }
.alert-box.error { background: #fee2e2; color: #b91c1c; }

/* Responsive Media Queries */
@media (max-width: 992px) {
    .hero-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .cart-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-layout { flex-direction: column; }
    .dashboard-sidebar { width: 100%; }
}
@media (max-width: 640px) {
    .features-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 28px; }
    .search-box { display: none; } /* يظهر بزر بحث أو في شريط منفصل */
}
