:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --black: #0a0a0a;
  --text: #111111;
  --muted: #666666;
  --gold: #c6a15b;
  --gold-hover: #b08b44;
  --danger: #dc2626;
  --border: #e5e5e5;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Cairo', sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 12px;
}

.hidden { display: none !important; }

/* شريط الأدمن */
.admin-toolbar {
  background: var(--black);
  color: #fff;
  padding: 8px 0;
  border-bottom: 1px solid var(--gold);
}
.admin-toolbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-badge { font-weight: 700; font-size: 0.85rem; color: var(--gold); }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* الهيدر المنظم */
.navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  padding: 8px 12px;
  gap: 8px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--black);
  text-decoration: none;
  letter-spacing: 1px;
  white-space: nowrap;
}

.search-box {
  flex: 1;
  max-width: 450px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  padding: 7px 32px 7px 26px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  background: #f5f5f5;
  color: var(--text);
}

.search-box input:focus {
  outline: none;
  border-color: var(--black);
  background: #ffffff;
}

.search-icon { position: absolute; right: 11px; font-size: 0.85rem; pointer-events: none; }
.search-clear { position: absolute; left: 10px; background: none; border: none; cursor: pointer; color: var(--muted); font-weight: 800; }

.nav-actions { display: flex; align-items: center; gap: 6px; }

/* شريط الأقسام المنظم */
.nav-categories {
  background: #fafafa;
  border-top: 1px solid var(--border);
}

.cat-bar-inner {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  overflow-x: auto;
}

.cat-tab {
  background: transparent;
  border: none;
  padding: 4px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.cat-tab.active { background: var(--black); color: #ffffff; }

/* الأزرار */
.btn {
  border: none;
  border-radius: 9px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.88rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.btn-primary { background: var(--black); color: #ffffff; }
.btn-gold { background: var(--gold); color: #ffffff; }
.btn-outline { background: #fff; border: 1.5px solid var(--border); color: var(--black); }
.btn-outline-light { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.25); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-lg { padding: 11px 26px; font-size: 0.98rem; }
.btn-block { width: 100%; }

.cart-btn {
  background: var(--black);
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge {
  background: var(--gold);
  color: #fff;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
}

/* البانر الفاخر */
.hero {
  background: linear-gradient(135deg, #0a0a0a 0%, #1c1c1e 100%);
  color: #fff;
  padding: 48px 0;
  text-align: center;
  border-bottom: 2px solid var(--gold);
}
.hero-tag {
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.2px;
}
.hero h1 { font-size: 2rem; margin: 12px 0 8px; font-weight: 800; }
.hero p { color: #d4d4d8; max-width: 560px; margin: 0 auto 20px; font-size: 0.96rem; }

/* قسم المنتجات */
.products-section { padding: 30px 12px; }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 10px;
}
.section-header h2 { font-size: 1.35rem; font-weight: 800; color: var(--black); }

.view-controls { display: flex; gap: 6px; }
.view-btn {
  background: #f4f4f5;
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}
.view-btn.active { background: var(--black); color: #fff; border-color: var(--black); }

.products-wrapper { position: relative; }
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

/* التمرير يمين وشمال */
.products-grid.slider-mode {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 12px;
  padding-bottom: 10px;
}
.products-grid.slider-mode .product-card {
  min-width: 220px;
  max-width: 220px;
  flex-shrink: 0;
}

.slider-arrow {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  border: 1px solid var(--gold);
  cursor: pointer;
  z-index: 20;
}
.slider-arrow.prev { right: -6px; }
.slider-arrow.next { left: -6px; }

/* كارت المنتج */
.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.card-admin-controls {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  gap: 4px;
  z-index: 10;
}
.icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.edit-icon-btn { background: var(--black); color: var(--gold); }
.delete-icon-btn { background: var(--danger); color: #fff; }

.product-img-wrap { position: relative; cursor: pointer; background: #f4f4f5; }
.product-img { width: 100%; height: 240px; object-fit: cover; display: block; }
.zoom-hint {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(10,10,10,0.75);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 5px;
}

.product-body { padding: 10px; display: flex; flex-direction: column; flex: 1; }
.product-cat { font-size: 0.72rem; color: var(--gold-hover); font-weight: 800; }
.product-title { font-size: 0.95rem; font-weight: 800; margin: 2px 0 4px; color: var(--black); cursor: pointer; }
.product-price { font-size: 1rem; font-weight: 800; color: var(--black); margin-bottom: 8px; }

.size-selector { display: flex; gap: 3px; margin-bottom: 8px; flex-wrap: wrap; }
.size-btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
}
.size-btn.selected { background: var(--black); color: #fff; border-color: var(--black); }
.product-body .btn { margin-top: auto; padding: 6px 8px; font-size: 0.8rem; }

/* مقاس التليفونات: 3 كروت جنب بعض */
@media (max-width: 768px) {
  .logo { font-size: 1rem; letter-spacing: 0.5px; }
  .hero { padding: 34px 0; }
  .hero h1 { font-size: 1.45rem; }

  .products-grid:not(.slider-mode) {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .products-grid:not(.slider-mode) .product-img { height: 115px; }
  .products-grid:not(.slider-mode) .product-body { padding: 6px; }
  .products-grid:not(.slider-mode) .product-cat { font-size: 0.62rem; }
  .products-grid:not(.slider-mode) .product-title {
    font-size: 0.74rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .products-grid:not(.slider-mode) .product-price { font-size: 0.78rem; margin-bottom: 4px; }
  .products-grid:not(.slider-mode) .size-btn { padding: 1px 4px; font-size: 0.62rem; }
  .products-grid:not(.slider-mode) .product-body .btn { padding: 4px 2px; font-size: 0.68rem; }
  .products-grid:not(.slider-mode) .zoom-hint { display: none; }
}

/* السلة والنوافذ المنبثقة */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 200; }
.cart-drawer { position: fixed; top: 0; left: -400px; width: 350px; max-width: 90vw; height: 100vh; background: #fff; z-index: 250; display: flex; flex-direction: column; transition: left 0.25s ease; }
.cart-drawer.open { left: 0; }
.drawer-header, .modal-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px; }
.cart-item { display: flex; gap: 10px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.cart-item img { width: 54px; height: 64px; object-fit: cover; border-radius: 7px; }
.cart-item-info { flex: 1; }
.drawer-footer { padding: 14px 18px; border-top: 1px solid var(--border); background: #fafafa; }
.total-row { display: flex; justify-content: space-between; font-size: 1.05rem; margin-bottom: 10px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 10px; }
.modal-box { background: #fff; width: 100%; max-width: 440px; border-radius: 14px; padding: 18px; max-height: 92vh; overflow-y: auto; border: 1px solid var(--border); }
.modal-lg { max-width: 650px; }
.modal-xl { max-width: 800px; }

.demo-hint { background: #fafafa; border: 1px solid var(--gold); color: var(--black); padding: 10px; border-radius: 9px; font-size: 0.82rem; margin: 10px 0; }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 4px; font-size: 0.85rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.9rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sizes-checkboxes { display: flex; gap: 10px; flex-wrap: wrap; }
.switch-auth { text-align: center; margin-top: 10px; font-size: 0.85rem; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px; }
@media (max-width: 650px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-main-img { width: 100%; height: 320px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.detail-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.detail-thumb { width: 56px; height: 64px; object-fit: cover; border-radius: 7px; cursor: pointer; border: 2px solid var(--gold); }

.footer { background: var(--black); color: #fff; padding: 26px 0; text-align: center; margin-top: 36px; border-top: 2px solid var(--gold); }
.footer-note { color: var(--gold); font-size: 0.8rem; margin-top: 4px; }
/* ===== تأثيرات الفخامة واللمسات الحركية الخفيفة ===== */
.hero {
  background: radial-gradient(circle at 50% 0%, #24201a 0%, #0a0a0a 75%);
  position: relative;
  overflow: hidden;
}

.hero h1 {
  letter-spacing: -0.5px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* لمعة ذهبية فاخرة على الأزرار الرئيسية */
.btn-gold, .btn-primary {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-gold:hover, .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(198, 161, 91, 0.32);
}

/* حركة فخمة لكروت المنتجات */
.product-card {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.product-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: 0 16px 32px rgba(10, 10, 10, 0.09);
}

.product-img {
  transition: transform 0.45s ease;
}

.product-card:hover .product-img {
  transform: scale(1.04);
}

/* شارة خصم / جديد أنيقة أعلى الكارت */
.card-ribbon {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--black);
  color: var(--gold);
  border: 1px solid var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  z-index: 5;
  letter-spacing: 0.5px;
}

/* تحسين حركة الأقسام */
.cat-tab {
  transition: all 0.25s ease;
}
.cat-tab:hover:not(.active) {
  background: rgba(198, 161, 91, 0.12);
  color: var(--black);
}
/* ===== ترقية فخامة الكروت والأزرار (Luxury UI Polish) ===== */
.products-section {
  padding-top: 38px;
}

/* أزرار التحكم في العرض (شبكة / تمرير أفقي) */
.view-controls {
  background: #f4f4f5;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid #e4e4e7;
}

.view-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 7px;
  font-weight: 700;
  color: #52525b;
  transition: all 0.2s ease;
}

.view-btn.active {
  background: #0a0a0a;
  color: #c6a15b;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* كارت المنتج الفاخر */
.product-card {
  border-radius: 16px;
  border: 1px solid #eaeaea;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.product-img-wrap {
  background: #121214;
  min-height: 240px;
}

/* أزرار المقاسات الأنيقة */
.size-selector {
  gap: 6px;
  margin-bottom: 12px;
}

.size-btn {
  border: 1.5px solid #e4e4e7;
  background: #fafafa;
  color: #18181b;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.78rem;
  transition: all 0.2s ease;
}

.size-btn:hover {
  border-color: #c6a15b;
}

.size-btn.selected {
  background: #0a0a0a;
  color: #c6a15b;
  border-color: #0a0a0a;
  box-shadow: 0 2px 8px rgba(10, 10, 10, 0.2);
}

/* زر الإضافة للسلة بتصميم بوتيك راقي */
.product-body .btn-primary {
  background: linear-gradient(135deg, #18181b 0%, #09090b 100%);
  color: #ffffff;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.product-body .btn-primary:hover {
  background: linear-gradient(135deg, #c6a15b 0%, #a8833e 100%);
  border-color: #c6a15b;
  color: #ffffff;
}

@media (max-width: 768px) {
  .products-grid:not(.slider-mode) .product-img-wrap {
    min-height: 115px;
  }
  .products-grid:not(.slider-mode) .size-btn {
    padding: 2px 5px;
    font-size: 0.65rem;
    border-radius: 5px;
  }
  .products-grid:not(.slider-mode) .product-body .btn-primary {
    padding: 6px 4px;
    font-size: 0.72rem;
    border-radius: 7px;
  }
}
/* ===== ترقية النعومة الفائقة والحركة التلقائية (V3 Ultra-Smooth) ===== */
.featured-auto-section {
  background: #fafafa;
  padding: 26px 0;
  border-bottom: 1px solid #ececec;
}

.auto-slider-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 2px 10px;
}
.auto-slider-track::-webkit-scrollbar { display: none; }

.auto-mini-card {
  min-width: 190px;
  max-width: 190px;
  background: #ffffff;
  border: 1px solid #eaeaea;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.auto-mini-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
}
.auto-mini-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

/* تنعيم حواف الكروت والأزرار بالكامل */
.product-card {
  border-radius: 20px !important;
  border: 1px solid #ebebeb !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease !important;
}

.product-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold) !important;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08) !important;
}

/* زر الإضافة للسلة الناعم (Pill Style) */
.product-body .btn-primary {
  border-radius: 999px !important;
  background: linear-gradient(135deg, #18181b 0%, #09090b 100%) !important;
  color: #ffffff !important;
  font-weight: 800;
  padding: 9px 14px !important;
  box-shadow: 0 4px 12px rgba(10, 10, 10, 0.14);
  transition: all 0.25s ease !important;
}

.product-body .btn-primary:hover {
  background: linear-gradient(135deg, #c6a15b 0%, #a8833e 100%) !important;
  box-shadow: 0 6px 16px rgba(198, 161, 91, 0.35);
}

/* زر عرض المزيد الفخم */
#loadMoreBtn {
  border-radius: 999px !important;
  padding: 11px 32px !important;
  background: #0a0a0a !important;
  color: #c6a15b !important;
  border: 1.5px solid #c6a15b !important;
  font-weight: 800;
  font-size: 0.92rem;
  box-shadow: 0 6px 18px rgba(10, 10, 10, 0.12);
  transition: all 0.25s ease !important;
}

#loadMoreBtn:hover {
  background: #c6a15b !important;
  color: #ffffff !important;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .product-card { border-radius: 14px !important; }
  .product-body .btn-primary {
    padding: 5px 4px !important;
    font-size: 0.7rem !important;
  }
}
