/* ============================================================
   Omnicard — نظام التصميم v2
   خط Tajawal، ثيم داكن غني، يدعم RTL/LTR بالخصائص المنطقية
   ============================================================ */

:root {
    --bg: #0a0f1e;
    --bg-soft: #0e1528;
    --card: #121a30;
    --card-2: #16203c;
    --border: #22304f;
    --border-strong: #31436e;
    --text: #eef2ff;
    --muted: #94a3c4;
    --primary: #38bdf8;
    --primary-2: #6366f1;
    --grad: linear-gradient(135deg, #38bdf8, #6366f1);
    --price: #fbbf24;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    background:
        radial-gradient(900px 400px at 85% -60px, rgba(99, 102, 241, .16), transparent 60%),
        radial-gradient(700px 380px at 8% 0, rgba(56, 189, 248, .12), transparent 55%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.7;
}

.container { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 18px; }

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: #7dd3fc; }

::selection { background: rgba(56, 189, 248, .35); }

/* ============ الترويسة ============ */
.site-header {
    background: rgba(10, 15, 30, .85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 14px; }

.logo { display: flex; align-items: center; gap: 8px; font-size: 1.45rem; font-weight: 800; color: var(--text) !important; }
.logo .logo-mark {
    width: 34px; height: 34px; border-radius: 10px;
    background: var(--grad);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem; color: #fff;
    box-shadow: 0 4px 14px -4px rgba(56, 189, 248, .6);
}
.logo .logo-text b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav > a {
    color: var(--text); font-size: .95rem; font-weight: 500;
    padding: 8px 13px; border-radius: 10px;
}
.main-nav > a:hover { background: var(--card-2); color: var(--primary); }
.lang-switch {
    border: 1px solid var(--border); border-radius: 999px;
    padding: 4px 13px !important; font-size: .82rem !important; color: var(--muted) !important;
}
.lang-switch:hover { border-color: var(--primary); color: var(--primary) !important; }
.inline-form { display: inline; }

.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 1.25rem; padding: 4px 12px; cursor: pointer; }

/* ============ الأزرار ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; cursor: pointer; border-radius: 12px;
    font-size: 1rem; font-family: inherit; font-weight: 700;
    padding: 12px 26px; transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
    background: var(--grad); color: #fff !important;
    box-shadow: 0 8px 20px -8px rgba(99, 102, 241, .7);
}
.btn-primary:hover { box-shadow: 0 10px 26px -8px rgba(56, 189, 248, .8); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 7px 16px; font-size: .875rem; border-radius: 10px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ============ البطاقات ============ */
.card {
    background: linear-gradient(180deg, var(--card-2), var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}
.auth-card { max-width: 460px; margin: 44px auto; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 20px; }
.auth-alt { margin-top: 18px; text-align: center; color: var(--muted); font-size: .95rem; }

/* ============ النماذج ============ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 7px; font-size: .92rem; color: var(--muted); font-weight: 500; }
.form-control {
    width: 100%; padding: 12px 15px;
    background: var(--bg-soft); color: var(--text);
    border: 1px solid var(--border); border-radius: 12px;
    font-size: 1rem; font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(56, 189, 248, .15); }
.form-hint { font-size: .82rem; color: var(--muted); margin-top: 5px; }
select.form-control { cursor: pointer; }

/* ============ التنبيهات ============ */
.alert { border-radius: 12px; padding: 13px 18px; margin: 18px 0; font-size: .95rem; border: 1px solid; }
.alert-success { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .5); color: #6ee7b7; }
.alert-warning { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .5); color: #fcd34d; }
.alert-error { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .5); color: #fca5a5; }
.alert ul { margin: 0; padding-inline-start: 18px; }

/* ============ الشارات ============ */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    border-radius: 999px; padding: 3px 13px; font-size: .78rem; font-weight: 600;
    background: rgba(56, 189, 248, .13); color: #7dd3fc;
}
.badge-success { background: rgba(52, 211, 153, .13); color: #6ee7b7; }
.badge-warning { background: rgba(251, 191, 36, .13); color: #fcd34d; }
.badge-danger { background: rgba(248, 113, 113, .13); color: #fca5a5; }

/* ============ الصفحة الرئيسية ============ */
.hero { text-align: center; padding: 72px 0 48px; position: relative; }
.hero h1 {
    font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; line-height: 1.3;
    margin-bottom: 14px;
}
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 620px; margin: 0 auto 30px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.trust-row {
    display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
    margin-top: 38px;
}
.trust-item {
    display: flex; align-items: center; gap: 8px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 999px; padding: 8px 18px; font-size: .88rem; color: var(--muted);
}
.trust-item .t-ico { font-size: 1.05rem; }

.section-title { font-size: 1.45rem; font-weight: 800; margin: 42px 0 20px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to var(--flow-end, left), var(--border), transparent); }
[dir="rtl"] { --flow-end: left; }
[dir="ltr"] { --flow-end: right; }

/* فئات */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cat-card {
    background: linear-gradient(180deg, var(--card-2), var(--card));
    border: 1px solid var(--border);
    border-radius: var(--radius); padding: 30px 20px; text-align: center;
    color: var(--text) !important; position: relative; overflow: hidden;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.cat-card::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(240px 120px at 50% -30px, rgba(56, 189, 248, .14), transparent);
    opacity: 0; transition: opacity .2s;
}
.cat-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 14px 34px -12px rgba(56, 189, 248, .35); }
.cat-card:hover::before { opacity: 1; }
.cat-icon { font-size: 2.3rem; margin-bottom: 12px; display: block; }
.cat-card .cat-name { font-weight: 700; font-size: 1.08rem; }

.brand-avatar {
    width: 58px; height: 58px; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    background: var(--grad); color: #fff;
    border-radius: 18px; font-size: 1.5rem; font-weight: 800;
    box-shadow: 0 8px 18px -8px rgba(99, 102, 241, .7);
}

/* منتجات مميزة */
.product-card {
    background: linear-gradient(180deg, var(--card-2), var(--card));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; color: var(--text) !important; display: flex; flex-direction: column; gap: 8px;
    transition: transform .2s, border-color .2s;
}
.product-card:hover { transform: translateY(-4px); border-color: var(--primary); }
.product-card .p-brand { font-size: .8rem; color: var(--muted); }
.product-card .p-title { font-weight: 700; font-size: .98rem; line-height: 1.45; flex: 1; }
.product-card .p-price { color: var(--price); font-weight: 800; font-size: 1.05rem; }
.product-card .p-price small { color: var(--muted); font-weight: 400; font-size: .75rem; display: block; }

/* كيف يعمل */
.steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 26px 22px; text-align: center; position: relative;
}
.step .s-num {
    width: 44px; height: 44px; margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--grad); border-radius: 50%;
    font-weight: 800; font-size: 1.15rem; color: #fff;
}
.step h3 { font-size: 1.02rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: .88rem; }

/* ============ التصفح ============ */
.breadcrumb {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin: 22px 0 4px; font-size: .88rem; color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span:last-child { color: var(--text); }

.variant-section { margin-bottom: 30px; }
.variant-title { font-size: 1.12rem; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }

.product-list { display: flex; flex-direction: column; gap: 10px; }
.product-row {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: linear-gradient(180deg, var(--card-2), var(--card));
    border: 1px solid var(--border);
    border-radius: 14px; padding: 16px 20px;
    color: var(--text) !important;
    transition: border-color .15s, transform .15s;
}
.product-row:hover { border-color: var(--primary); transform: translateX(0) translateY(-2px); }
.product-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.product-title { font-weight: 700; }

.price-tag { color: var(--price); font-weight: 800; white-space: nowrap; text-align: center; }
.price-tag.big { font-size: 1.7rem; }
.price-from { font-size: .74rem; color: var(--muted); font-weight: 400; display: block; }

.product-detail { max-width: 580px; margin: 26px auto; }
.product-detail h1 { font-size: 1.45rem; margin-bottom: 12px; }
.product-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.product-specs { margin-bottom: 20px; }
.product-specs > div {
    display: flex; justify-content: space-between; align-items: center;
    padding: 11px 0; border-bottom: 1px solid var(--border);
}
.product-specs dt { color: var(--muted); }

.price-table-title { font-size: .95rem; color: var(--muted); margin-bottom: 10px; }
.price-table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.price-table-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.price-table-row:nth-child(odd) { background: var(--bg-soft); }

/* ============ الشراء ============ */
.checkout-grid { max-width: 660px; margin: 0 auto; }
.checkout-product-title { font-size: 1.28rem; margin-bottom: 10px; }
.pay-option {
    display: block; border: 1px solid var(--border); border-radius: 14px;
    padding: 15px 17px; margin-bottom: 10px; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.pay-option:hover { border-color: var(--border-strong); }
.pay-option:has(input:checked) { border-color: var(--primary); background: rgba(56, 189, 248, .07); }
.pay-option input { margin-inline-end: 10px; accent-color: var(--primary); }
.pay-option-body { display: inline-flex; width: calc(100% - 32px); justify-content: space-between; align-items: center; gap: 10px; vertical-align: top; }
.pay-option-title { display: flex; flex-direction: column; gap: 2px; font-weight: 700; }
.pay-external-title { color: var(--muted); font-size: .9rem; margin: 20px 0 10px; }
.checkout-total {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid var(--border); margin-top: 18px; padding: 18px 0;
    font-weight: 800; font-size: 1.05rem;
}

/* ============ الطلبات والحساب ============ */
.dash-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 20px; }
.stat-card {
    background: linear-gradient(180deg, var(--card-2), var(--card));
    border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
.stat-card .stat-label { color: var(--muted); font-size: .88rem; margin-bottom: 6px; }
.stat-card .stat-value { font-size: 1.65rem; font-weight: 800; color: var(--primary); }
.action-card { display: block; color: var(--text) !important; transition: border-color .15s, transform .15s; }
.action-card:hover { border-color: var(--primary); transform: translateY(-3px); }
.action-card h3 { margin-bottom: 6px; }
.action-card p { color: var(--muted); font-size: .9rem; }

.order-card { margin-bottom: 14px; padding: 20px 24px; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.order-grid { display: grid; gap: 6px 20px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); font-size: .92rem; }
.muted { color: var(--muted); }
.code-details { margin-top: 12px; }
.code-details summary { cursor: pointer; color: var(--primary); font-weight: 700; }
.delivered-code {
    background: var(--bg-soft); border: 1px dashed var(--primary);
    border-radius: 12px; padding: 15px 17px; margin-top: 10px;
    font-size: 1.05rem; letter-spacing: 1px; white-space: pre-wrap; word-break: break-all;
    user-select: all;
}

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.tx-table { width: 100%; border-collapse: collapse; background: var(--card); }
.tx-table th, .tx-table td { padding: 12px 15px; text-align: start; border-bottom: 1px solid var(--border); font-size: .9rem; }
.tx-table th { background: var(--bg-soft); color: var(--muted); font-weight: 600; }
.tx-table tr:last-child td { border-bottom: none; }

/* ============ الأيقونات والأعلام وصور المنتجات ============ */
.ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex-shrink: 0; }
.ico-cat { width: 44px; height: 44px; color: var(--primary); margin-bottom: 12px; }
.ico-globe { width: 20px; height: 20px; color: var(--muted); }
.flag { width: 22px; height: auto; border-radius: 3px; vertical-align: -0.2em; box-shadow: 0 0 0 1px rgba(255,255,255,.15); }

.p-art { width: 100%; height: auto; border-radius: 12px; display: block; object-fit: cover; aspect-ratio: 30/19; }
.brand-logo { width: 64px; height: 64px; object-fit: contain; margin: 0 auto 14px; display: block; border-radius: 14px; background: rgba(255,255,255,.06); padding: 8px; }
.media-img { max-width: 100%; border-radius: 12px; }
.p-art-sm { width: 64px; border-radius: 8px; }
.p-art-lg { max-width: 320px; margin-bottom: 18px; }
.product-hero-art { display: flex; justify-content: center; }
.row-thumb { flex-shrink: 0; }

/* ============ السلة ============ */
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.cart-badge {
    background: var(--grad); color: #fff; border-radius: 999px;
    font-size: .72rem; font-weight: 700; padding: 1px 8px;
}
.cart-item { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; padding: 16px 20px; }
.cart-thumb { flex-shrink: 0; width: 110px; }
.cart-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cart-actions { display: flex; gap: 8px; align-items: center; }
.qty-input { width: 84px; text-align: center; }
.buy-actions { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin-top: 8px; }
.buy-actions .qty-input { height: 100%; }

.checkout-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.checkout-head .cart-thumb { width: 130px; }
.checkout-items { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.checkout-item-row { display: flex; justify-content: space-between; padding: 10px 15px; font-size: .93rem; }
.checkout-item-row:nth-child(odd) { background: var(--bg-soft); }

@media (max-width: 560px) {
    .cart-item { flex-wrap: wrap; }
    .cart-thumb { width: 80px; }
}

/* ============ التذييل ============ */
.site-footer { margin-top: 60px; border-top: 1px solid var(--border); background: var(--bg-soft); }
.footer-grid {
    display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding: 40px 0 26px;
}
.footer-col h4 { font-size: 1rem; margin-bottom: 12px; }
.footer-col p { color: var(--muted); font-size: .9rem; }
.footer-col a { display: block; color: var(--muted); font-size: .9rem; padding: 3px 0; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
    border-top: 1px solid var(--border); padding: 16px 0;
    text-align: center; color: var(--muted); font-size: .85rem;
}

/* زر واتساب العائم */
.whatsapp-float {
    position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 90;
    width: 54px; height: 54px; border-radius: 50%;
    background: #25d366; color: #fff !important;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 24px -6px rgba(37, 211, 102, .55);
    transition: transform .15s;
}
.whatsapp-float:hover { transform: scale(1.08); }
.whatsapp-float svg { width: 28px; height: 28px; fill: #fff; }

/* ============ موبايل ============ */
@media (max-width: 820px) {
    .nav-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute; top: 66px; inset-inline: 0;
        flex-direction: column; align-items: stretch; gap: 4px;
        background: var(--bg-soft); border-bottom: 1px solid var(--border);
        padding: 14px 18px 18px;
    }
    .main-nav.open { display: flex; }
    .main-nav > a, .main-nav form { width: 100%; }
    .main-nav .btn { width: 100%; }
    .hero { padding: 44px 0 34px; }
    .card { padding: 22px 18px; }
}
