:root {
    --primary-color: #000000;
    --secondary-color: #666;
    --light-gray: #f5f5f5;
    --font-family: 'Tajawal', sans-serif;
  }
  body {
    font-family: var(--font-family);
    margin: 0;
    background-color: #ffffff;
    padding-top: 60px;
    padding-bottom: 70px;
  }
  .container { padding: 16px; }
  
  /* Header & Search Bar */
  .app-bar {
    display: flex; align-items: center;
    padding: 8px 16px; background-color: white;
    border-bottom: 1px solid var(--light-gray);
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 1000; height: 60px; box-sizing: border-box; gap: 16px;
  }
  .search-container { flex-grow: 1; display: flex; align-items: center; background-color: var(--light-gray); border-radius: 20px; padding: 8px 12px; }
  .search-container i { color: #999; }
  .search-container input { border: none; outline: none; background: none; font-family: var(--font-family); font-size: 0.9rem; width: 100%; margin-right: 8px; }
  .app-bar .actions i { font-size: 1.5rem; margin-left: 16px; color: var(--primary-color); cursor: pointer; }
  .header-title { font-size: 1.2rem; font-weight: 700; }
  
  /* cart counter bubble */
  .cart-icon { position: relative; color: inherit; text-decoration: none; }
  .cart-counter {
    position: absolute; top: -8px; right: -8px; background: #000; color: #fff;
    border-radius: 999px; padding: 2px 6px; font-size: .7rem; line-height: 1;
  }
  
  /* Main */
  .quick-links { display: flex; justify-content: space-around; background-color: var(--light-gray); padding: 15px; border-radius: 10px; margin-top: 16px; }
  .quick-links .link-item { text-decoration: none; color: var(--primary-color); font-weight: 700; display: flex; align-items: center; gap: 8px; }
  .link-item.disabled { color: #aaa; cursor: not-allowed; }
  
  .section-header { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 16px 0; }
  .section-header h2 { font-size: 1.2rem; margin: 0; }
  .section-header a { text-decoration: none; color: var(--secondary-color); font-size: 0.9rem; }
  
  .product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card { background-color: white; }
  .product-card img { width: 100%; height: 200px; object-fit: cover; border-radius: 5px; }
  .product-card .product-info { padding: 8px 0; }
  .product-card h3 { font-size: 0.9rem; margin: 0 0 4px 0; font-weight: 400; color: #333; }
  .product-card .price { font-size: 1rem; font-weight: bold; color: var(--primary-color); margin: 0; }
  
  /* Categories */
  .category-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .category-card {
    height: 120px; border-radius: 10px; display: flex; justify-content: center; align-items: center;
    text-decoration: none; background-size: cover; background-position: center; position: relative; overflow: hidden; color: white;
  }
  .category-card::before { content: ''; position: absolute; inset: 0; background-color: rgba(0,0,0,0.5); transition: background-color 0.3s; }
  .category-card:hover::before { background-color: rgba(0,0,0,0.3); }
  .category-card span { font-weight: 700; font-size: 1.5rem; z-index: 1; }
  
  /* Profile */
  .profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
  .profile-header i { font-size: 4rem; color: #ccc; }
  .profile-header h3 { margin: 0; font-size: 1.2rem; }
  .profile-header p { margin: 4px 0 0 0; font-size: 0.9rem; color: var(--secondary-color); }
  .profile-menu .menu-item {
    display: flex; justify-content: space-between; align-items: center; padding: 16px; background-color: var(--light-gray);
    border-radius: 8px; margin-bottom: 12px; text-decoration: none; color: var(--dark-text); font-weight: 700;
  }
  
  /* Loader & Empty */
  .loader { text-align: center; padding: 20px; display: none; }
  .loader i { font-size: 2rem; color: var(--primary-color); }
  .empty-state { text-align: center; padding: 50px 20px; color: #999; }
  .empty-state i { font-size: 3rem; margin-bottom: 16px; }
  .empty-state p { font-size: 1.1rem; font-weight: 700; color: #555; margin: 0; }
  .empty-state span { font-size: 0.9rem; }
  
  /* Footer */
  .bottom-nav {
    display: flex; justify-content: space-around; align-items: center; position: fixed; bottom: 0; left: 0; right: 0;
    background-color: white; height: 65px; border-top: 1px solid var(--light-gray); box-sizing: border-box;
  }
  .nav-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--secondary-color); font-size: 0.7rem; }
  .nav-item i { font-size: 1.4rem; margin-bottom: 4px; }
  .nav-item.active { color: var(--primary-color); font-weight: 700; }
  
  /* Logo */
  .logo { height: 45px; width: auto; }
  
  /* No results */
  .no-results-message { text-align: center; padding: 40px 20px; color: #888; display: none; }
  .no-results-message p { font-size: 1.2rem; font-weight: 700; color: #444; margin: 0 0 8px 0; }
  .no-results-message span { font-size: 1rem; }
  
  /* Buttons / Cards (admin helpers) */
  .btn, .btn-sm {
    border: none; cursor: pointer; font-family: inherit; background: #000; color: #fff; border-radius: 10px;
    padding: 10px 14px; transition: transform .15s ease, box-shadow .15s ease;
  }
  .btn-sm { padding: 6px 10px; font-size: .85rem; }
  .btn:hover, .btn-sm:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
  .card { background: #fff; border-radius: 12px; padding: 14px; border: 1px solid var(--light-gray); }
  
  /* Motion */
  .motion-fade { opacity: 0; animation: fadeIn .5s ease forwards; }
  .motion-rise { opacity: 0; transform: translateY(8px); animation: riseIn .45s ease forwards; }
  @keyframes fadeIn { to { opacity: 1; } }
  @keyframes riseIn { to { opacity: 1; transform: translateY(0); } }
  
  /* Product image hover tools */
  .product-image-wrap { position: relative; overflow: hidden; border-radius: 6px; }
  .product-image-wrap img { width: 100%; height: 200px; object-fit: cover; display:block; transition: transform .4s ease; }
  .product-image-wrap:hover img { transform: scale(1.03); }
  .product-image-wrap .favorite-btn,
  .product-image-wrap .add-cart-btn {
    position: absolute; top: 8px; width: 34px; height: 34px; border: none; border-radius: 50%;
    display: grid; place-items: center; background: rgba(255,255,255,.9); box-shadow: 0 4px 14px rgba(0,0,0,.08); cursor: pointer;
  }
  .product-image-wrap .favorite-btn { right: 8px; }
  .product-image-wrap .add-cart-btn { right: 50px; }
  .product-image-wrap .favorite-btn.is-favorite { color: #e63946; }
  
  /* Cart items */
  .cart-summary-container { position: sticky; bottom: 80px; background:#fff; border-top:1px solid var(--light-gray); padding:12px; }
  .cart-item { display:flex; gap:12px; align-items:center; padding:8px 0; border-bottom:1px dashed #eee; }
  .cart-item img { width:80px; height:80px; border-radius:8px; object-fit:cover; }
  .remove-item-btn { background:#f5f5f5; border:none; width:32px; height:32px; border-radius:50%; cursor:pointer; }
  .tiny { color:#888; font-size:.8rem; margin:.2rem 0 0; }
  .row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
  /* ===== Modal (Checkout) ===== */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display:none; align-items: center; justify-content: center; padding:16px; z-index: 2000; }
.modal.open { display:flex; }
.modal-content { background:#fff; border-radius:12px; padding:16px; width:100%; max-width:480px; position: relative; }
.modal-close { position:absolute; left:12px; top:8px; font-size:1.6rem; cursor:pointer; }
/* أزرار صغيرة */
.btn-sm{ padding:6px 10px; border:1px solid #eee; border-radius:8px; background:#fff; cursor:pointer; }
.btn-sm:hover{ background:#000; color:#fff; }

/* موشن بسيط */
.motion-fade{ animation: mf .35s ease both; }
@keyframes mf{ from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:none} }
.motion-rise{ animation: mr .35s ease both; }
@keyframes mr{ from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:none} }

/* كروت */
.card{ background:#fff; border-radius:12px; padding:16px; box-shadow:0 6px 18px rgba(0,0,0,.05); margin:12px 0; }
.row{ display:flex; gap:8px; align-items:center; }
.tiny{ font-size:.85rem; color:#666; }

/* نمط auth */
.auth-form .field{ display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.auth-form input{ border:1px solid #eee; border-radius:10px; padding:10px 12px; font-family:inherit; outline:none; }
.auth-form input:focus{ border-color:#000; }
.form-error{ color:#d00; font-size:.9rem; margin-top:6px; }
/* ===== Admin Shell ===== */
.admin-body{ background:#f6f7fb; }
.admin-shell{ display:grid; grid-template-columns: 260px 1fr; min-height:100vh; }
.admin-sidebar{ background:#101317; color:#fff; display:flex; flex-direction:column; padding:16px; gap:16px; }
.admin-sidebar .brand{ display:flex; align-items:center; gap:10px; font-weight:700; }
.admin-sidebar .brand img{ height:28px; }
.admin-nav{ display:flex; flex-direction:column; gap:8px; }
.admin-nav .nav-item{ text-align:right; padding:10px 12px; border-radius:10px; background:transparent; color:#c9cbd1; border:none; cursor:pointer; }
.admin-nav .nav-item:hover{ background:#1b2027; color:#fff; }
.admin-nav .nav-item.active{ background:#0ea5e9; color:#fff; }
.admin-sidebar-footer{ margin-top:auto; border-top:1px solid #2a2f37; padding-top:12px; }
.admin-sidebar-footer a{ color:#c9cbd1; text-decoration:none; }

.admin-main{ padding:16px 20px; }
.admin-topbar{ display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.pill{ background:#eef2f7; padding:6px 10px; border-radius:999px; font-size:.9rem; }
.btn{ background:#101317; color:#fff; border:none; padding:10px 14px; border-radius:10px; cursor:pointer; }
.btn:hover{ filter:brightness(1.1); }
.btn.ghost{ background:#fff; color:#101317; border:1px solid #e5e7eb; }
.btn.danger{ background:#ef4444; }
.btn.sm{ padding:6px 10px; border-radius:8px; font-size:.92rem; }
.toolbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.input{ background:#fff; border:1px solid #e5e7eb; border-radius:10px; padding:10px 12px; outline:none; min-width:180px; }
.input:focus{ border-color:#0ea5e9; }

/* KPIs */
.grid{ display:grid; gap:12px; }
.grid.two{ grid-template-columns: repeat(2,1fr); }
.kpis{ grid-template-columns: repeat(4, minmax(0,1fr)); }
.kpi{ background:#fff; border-radius:14px; padding:16px; box-shadow:0 6px 20px rgba(0,0,0,.05); display:flex; flex-direction:column; gap:6px; }
.kpi-label{ color:#6b7280; }
.kpi-value{ font-size:2rem; font-weight:800; }

/* Cards & Table */
.card{ background:#fff; border-radius:14px; padding:16px; box-shadow:0 6px 20px rgba(0,0,0,.05); }
.card-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.table{ width:100%; overflow:auto; border-radius:12px; border:1px solid #eef2f7; }
.table table{ width:100%; border-collapse:collapse; }
.table th,.table td{ padding:10px 12px; border-bottom:1px solid #eef2f7; text-align:right; }
.table th{ background:#f9fafb; font-weight:700; }

/* Grid of cards (categories) */
.cards-grid{ display:grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap:14px; }
.cat-card{ background:#fff; border-radius:12px; overflow:hidden; box-shadow:0 6px 20px rgba(0,0,0,.05); }
.cat-card img{ width:100%; height:140px; object-fit:cover; }
.cat-card .body{ padding:10px 12px; display:flex; justify-content:space-between; align-items:center; }

/* Pager */
.pager{ display:flex; align-items:center; gap:8px; margin-top:12px; }

/* Modal */
.modal{ position:fixed; inset:0; background:rgba(16,19,23,.45); display:none; align-items:center; justify-content:center; z-index:2000; padding:16px; }
.modal.show{ display:flex; }
.modal-content{ background:#fff; border-radius:14px; padding:16px; width:100%; max-width:720px; position:relative; }
.modal-close{ position:absolute; left:12px; top:8px; background:#fff; border:1px solid #e5e7eb; border-radius:999px; width:34px; height:34px; cursor:pointer; }
.form .field{ display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.form .actions{ display:flex; gap:10px; }
.actions.end{ justify-content:flex-end; }

/* Uploader */
.uploader{ border:2px dashed #d1d5db; border-radius:12px; padding:14px; text-align:center; background:#fafafa; position:relative; }
.uploader input[type=file]{ position:absolute; inset:0; opacity:0; cursor:pointer; }
.uploader.drag{ background:#eef6ff; border-color:#0ea5e9; }
.uploader img{ max-height:160px; margin-top:8px; border-radius:10px; }

/* Motion */
.motion-fade{ animation:mf .35s ease both; }
@keyframes mf{ from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:none} }
.motion-rise{ animation:mr .35s ease both; }
@keyframes mr{ from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:none} }

/* Toast */
.toast{ position:fixed; bottom:18px; right:18px; background:#101317; color:#fff; padding:10px 14px; border-radius:10px; opacity:0; transform:translateY(8px); pointer-events:none; transition:.25s; z-index:3000; }
.toast.show{ opacity:1; transform:none; }

/* Responsive */
@media (max-width: 1024px){
  .admin-shell{ grid-template-columns: 80px 1fr; }
  .admin-sidebar .brand span{ display:none; }
  .kpis{ grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px){
  .grid.two{ grid-template-columns: 1fr; }
  .kpis{ grid-template-columns: 1fr 1fr; }
}
/* ===== تحسين البطاقات + تفاصيل المنتج + لمسات عامة ===== */

/* ألوان/متغيّرات اختيارية */
:root {
    --brand: #0ea5e9;         /* أزرق */
    --brand-600: #0284c7;
    --ink: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg-soft: #f8fafc;
    --success: #10b981;
    --danger: #ef4444;
  }
  
  /* نص ثانوي */
  .muted { color: var(--muted); }
  
  /* بطاقة عامة */
  .card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,.04);
  }
  
  /* أزرار حديثة */
  .btn { 
    background: var(--brand);
    color: #fff; border: none; cursor: pointer;
    padding: 10px 14px; border-radius: 12px;
    font-weight: 700; transition: transform .12s ease, box-shadow .2s ease, background .2s;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .btn:hover { background: var(--brand-600); transform: translateY(-1px); }
  .btn.success { background: var(--success); }
  .btn.danger  { background: var(--danger); }
  .btn.ghost   { background: #fff; color: var(--ink); border:1px solid var(--border); }
  .btn.sm      { padding: 8px 10px; border-radius: 10px; font-size: .9rem; }
  
  /* مدخلات */
  .input {
    height: 40px; border-radius: 10px; border:1px solid var(--border);
    padding: 0 12px; font-family: inherit; background: #fff;
  }
  
  /* بادج/حبّة */
  .pill {
    background: var(--bg-soft); border:1px solid var(--border);
    color: var(--ink); border-radius: 999px; padding: 4px 10px; font-size: .8rem;
  }
  
  /* عدّاد السلة */
  .cart-icon { position: relative; display: inline-flex; align-items: center; }
  .cart-counter {
    position: absolute; top: -6px; left: -8px;
    min-width: 18px; height: 18px; border-radius: 999px;
    background: var(--danger); color:#fff; font-size: .7rem;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 6px; border:2px solid #fff;
  }
  
  /* تأثير حركي بسيط */
  .motion-fade { animation: mfade .35s ease both; }
  @keyframes mfade { from{opacity:0; transform:translateY(4px)} to{opacity:1; transform:none} }
  .motion-rise { animation: mrise .35s ease both; }
  @keyframes mrise { from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:none} }
  
  /* شبكة المنتجات (بطاقات) – لمسة أجمل */
  .product-grid { gap: 14px; }
  .product-card {
    display: block; background:#fff; border-radius: 12px; overflow: hidden;
    border:1px solid var(--border); transition: transform .12s ease, box-shadow .25s ease;
  }
  .product-card img { height: 210px; object-fit: cover; width: 100%; }
  .product-card .product-info { padding: 10px 12px; }
  .product-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.07); }
  
  /* تفاصيل المنتج */
  .product-detail {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
    align-items: start;
  }
  .pd-gallery img {
    width: 100%;
    border-radius: 14px;
    border:1px solid var(--border);
    background: #fff;
  }
  .pd-info h1 { margin: 0 0 8px 0; font-size: 1.4rem; }
  .pd-info .price { font-size: 1.25rem; font-weight: 800; color:#111; margin: 6px 0 10px; }
  
  /* شارة توصيل/سياسة */
  .badge {
    display:inline-flex; align-items:center; gap:6px;
    background: #ecfeff; color:#0e7490; border:1px solid #cffafe;
    padding: 6px 10px; border-radius: 999px; font-size: .85rem; font-weight:700;
  }
  
  /* جدول بسيط (للأدمِن أو القوائم) */
  .table table { width:100%; border-collapse: collapse; }
  .table th, .table td { padding:10px 12px; text-align:right; border-bottom:1px solid var(--border); }
  .table th { color: var(--muted); font-weight:700; background:#fafafa; }
  
  /* Toast */
  .toast {
    position: fixed; z-index: 10000; inset-inline-start: 50%; bottom: 18px;
    transform: translateX(-50%); background: #111827; color:#fff; padding: 10px 14px;
    border-radius: 12px; box-shadow: 0 8px 20px rgba(0,0,0,.25);
    opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
  
  /* تجاوبية */
  @media (max-width: 900px) {
    .product-detail { grid-template-columns: 1fr; }
    .product-card img { height: 190px; }
  }
  