@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700&display=swap');

:root {
  --bg-main: #F4F4F6;
  --bg-surface: #FFFFFF;
  --text-main: #1C1C1E;
  --text-muted: #7A7A80;
  --color-gold: #00B289; 
  --color-gold-hover: #00906e;
  --color-danger: #FF3B30;
  --color-success: #34C759;
  --border: #E5E5EA;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
  --radius: 16px;
}

[data-theme="dark"] {
  --bg-main: #121214;
  --bg-surface: #1C1C1E;
  --text-main: #F5F5F7;
  --text-muted: #98989D;
  --border: #2C2C2E;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Tajawal', sans-serif; }
body { background: var(--bg-main); color: var(--text-main); display: flex; flex-direction: column; min-height: 100vh; transition: 0.3s; padding-bottom: 70px; direction: rtl; }
[lang="en"] body { direction: ltr; }

/* البار العلوي */
.app-header { background: var(--bg-surface); padding: 15px 20px; position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--border); }
.location-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.search-bar { background: var(--bg-main); border-radius: 12px; padding: 10px 15px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); }
.search-input { border: none; background: transparent; width: 100%; outline: none; color: var(--text-main); font-size: 14px; }

/* البار السفلي */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-surface); display: flex; justify-content: space-around; border-top: 1px solid var(--border); z-index: 1000; padding: 10px 0; box-shadow: 0 -2px 10px rgba(0,0,0,0.03); }
.bottom-nav-item { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--text-muted); text-decoration: none; gap: 4px; transition: 0.2s; font-weight: 500; }
.bottom-nav-item svg { width: 24px; height: 24px; fill: currentColor; }
.bottom-nav-item.active { color: var(--color-gold); font-weight: bold; }

/* التمرير الأفقي للأقسام */
.horizontal-scroll { display: flex; overflow-x: auto; gap: 15px; padding: 10px 20px; scrollbar-width: none; }
.horizontal-scroll::-webkit-scrollbar { display: none; }

.category-circle { display: flex; flex-direction: column; align-items: center; min-width: 75px; cursor: pointer; gap: 8px; }
.category-icon { width: 65px; height: 65px; border-radius: 20px; background: var(--bg-main); display: flex; justify-content: center; align-items: center; box-shadow: var(--shadow-sm); border: 2px solid transparent; transition: 0.2s; overflow: hidden;}
.category-icon img { width: 100%; height: 100%; object-fit: cover; }
.category-circle.active .category-icon { border-color: var(--color-gold); }
.category-circle span { font-size: 13px; font-weight: bold; color: var(--text-main); text-align: center; }

.filters-row { display: flex; gap: 10px; padding: 0 20px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.filters-row::-webkit-scrollbar { display: none; }
.filter-pill { padding: 8px 16px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 20px; font-size: 13px; font-weight: bold; white-space: nowrap; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 5px; cursor: pointer; transition: 0.2s; color: var(--text-main);}
.filter-pill:hover { border-color: var(--color-gold); }
.filter-pill.active-pill { background: var(--color-gold); color: #fff; border-color: var(--color-gold); }

/* =========== السلايدر والعروض (تم تقييد الحجم بصرامة) =========== */
.offer-banner { width: 280px !important; min-width: 280px !important; max-width: 280px !important; height: 140px !important; border-radius: 16px; object-fit: cover; box-shadow: var(--shadow-sm); border: 1px solid var(--border); flex-shrink: 0; display: block; }

.product-slider-container { position: relative; width: 100%; height: 160px; border-radius: 12px; margin-bottom: 8px; overflow: hidden; background: var(--bg-main); }
.product-slide { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; opacity: 0; transition: opacity 0.4s ease-in-out; }
.product-slide.active { opacity: 1; z-index: 1; }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: white; border: none; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10; font-size: 12px; transition: 0.3s; opacity: 0; }
.product-slider-container:hover .slider-btn, .product-slider-container:active .slider-btn { opacity: 1; }
.slider-btn:hover { background: var(--color-gold); }
.slider-btn.prev { left: 5px; }
.slider-btn.next { right: 5px; }
[lang="en"] .slider-btn.prev { left: auto; right: 5px; transform: translateY(-50%) rotate(180deg); }
[lang="en"] .slider-btn.next { right: auto; left: 5px; transform: translateY(-50%) rotate(180deg); }
.slider-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; z-index: 2; }
.slider-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5); transition: 0.3s; }
.slider-dot.active { background: var(--color-gold); transform: scale(1.3); }

/* المنتجات */
.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; padding: 0 20px; margin-top: 15px; }
.product-card { background: var(--bg-surface); border-radius: 16px; padding: 10px; cursor: pointer; transition: 0.3s; border: 1px solid var(--border); display: flex; flex-direction: column;}
.product-card-name { font-weight: bold; font-size: 13px; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-weight: bold; font-size: 15px; color: var(--color-gold); margin-top: auto; }
.product-add-btn { background: rgba(0, 178, 137, 0.1); color: var(--color-gold); border: none; border-radius: 50%; width: 32px; height: 32px; font-size: 18px; font-weight: bold; display: flex; align-items: center; justify-content: center; margin-top: -30px; margin-inline-start: auto; cursor: pointer; z-index: 10; position: relative;}
[lang="en"] .product-add-btn { margin-inline-end: 0; margin-inline-start: auto; }

/* الصفحات والأزرار */
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.btn-primary { background: var(--color-gold); color: #fff; border: none; padding: 12px 24px; border-radius: 12px; font-weight: bold; cursor: pointer; transition: 0.3s; }
.btn-danger { background: rgba(255,59,48,0.15); color: var(--color-danger); border: none; padding: 10px 18px; border-radius: 12px; font-weight: bold; cursor: pointer; }
.w-100 { width: 100%; }

.input-field { width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-surface); color: var(--text-main); outline: none; }
.input-field:focus { border-color: var(--color-gold); }
.form-group { margin-bottom: 24px; }
.form-group label { margin-bottom: 8px; display: inline-block; font-weight: bold; }

.order-card { background: var(--bg-surface); padding: 15px; border-radius: 16px; border: 1px solid var(--border); margin-bottom: 15px; margin-inline: 20px;}
.badge { padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: bold; }
.badge-success { background: rgba(52,199,89,0.15); color: var(--color-success); }
.badge-danger { background: rgba(255,59,48,0.15); color: var(--color-danger); }
.badge-primary { background: rgba(0,178,137,0.15); color: var(--color-gold); }

/* النوافذ والمودال */
.modal-overlay, .panel-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000; opacity: 0; pointer-events: none; transition: 0.3s; }
.modal-overlay.open, .panel-overlay.open { opacity: 1; pointer-events: all; }
.modal { position: fixed; bottom: 0; left: 0; right: 0; z-index: 2100; max-height: 90vh; overflow-y: auto; padding: 25px; border-radius: 24px 24px 0 0; opacity: 0; pointer-events: none; transition: 0.3s transform, 0.3s opacity; transform: translateY(100%); background: var(--bg-surface); }
.modal.open { opacity: 1; pointer-events: all; transform: translateY(0); }

.color-squares-grid, .sizes-grid { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.color-square-btn, .size-btn { padding: 12px 24px; min-width: 65px; border: 1px solid var(--border); border-radius: 12px; background: transparent; color: var(--text-main); font-weight: bold; cursor: pointer; font-size: 15px; text-align: center; transition: 0.2s; }
.color-square-btn.selected, .size-btn.selected { border-color: var(--color-gold); background: var(--color-gold); color: #fff; }

.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-20px); background: var(--text-main); color: var(--bg-surface); padding: 12px 24px; border-radius: 30px; font-weight: bold; opacity: 0; transition: 0.3s; z-index: 9999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--color-success); color: #fff; }
.toast.error { background: var(--color-danger); color: #fff; }

/* تأطير الصور في لوحة الإدارة */
.image-preview-container { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; width: 100%; }
.img-preview-box { position: relative; width: 75px; height: 75px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-main); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.img-preview-box img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.img-preview-box .del-btn { position: absolute; top: -5px; right: -5px; background: var(--color-danger); color: white; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.3); z-index: 10; }

.admin-sizes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); gap: 8px; margin-top: 10px; }
.admin-size-box { display: flex; flex-direction: column; align-items: center; background: var(--bg-surface); padding: 5px; border-radius: 6px; border: 1px solid var(--border); }
.admin-size-box span { font-size: 11px; font-weight: bold; color: var(--text-muted); margin-bottom: 4px; }
.admin-size-box input { width: 100%; text-align: center; padding: 4px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; outline: none; }
.admin-size-box input:focus { border-color: var(--color-gold); }

/* إضافة أنيميشن وتنسيق شعار HAREER في المنتصف */
.brand-center-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  font-weight: 900;
  color: var(--color-gold);
  letter-spacing: 2px;
  animation: pulseGreen 2s infinite ease-in-out;
  pointer-events: none; /* لضمان عدم تعارضه مع أي نقرات مثل سلة المشتريات */
  z-index: 10;
}

@keyframes pulseGreen {
  0% { text-shadow: 0 0 5px rgba(0, 178, 137, 0.2); opacity: 0.8; }
  50% { text-shadow: 0 0 15px rgba(0, 178, 137, 0.8); opacity: 1; }
  100% { text-shadow: 0 0 5px rgba(0, 178, 137, 0.2); opacity: 0.8; }
}