/* ===== Restaurants page (index) ===== */
.page-restaurants{
  --radius:14px;
  background: var(--gradient-bg);
  min-height: 100vh;
}

/* كبسولات */
.caps{ display:flex; gap:.75rem; overflow-x:auto; padding:0 0.25rem; }
.cap{
  min-width:86px; height:86px; border-radius:16px;
  background:var(--surface,#fff); border:1px solid var(--card-border,#e5e7eb);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.35rem;
  box-shadow:0 1px 6px rgba(0,0,0,.04);
  flex-shrink:0;
}
.cap .label{ font-weight:800; font-size:.85rem; }

/* Mobile caps adjustments */
@media (max-width: 576px) {
  .caps {
    gap: 0.75rem;
    padding: 0 0.25rem;
    margin-bottom: 1rem;
  }

  .cap {
    min-width: 80px;
    height: 80px;
    border-radius: 18px;
  }

  .cap .label {
    font-size: 0.85rem;
    font-weight: 700;
  }

  .cap i {
    font-size: 2rem;
  }
}

/* تبويبات */
.tabs{ display:flex; gap:1rem; border-bottom:1px solid var(--card-border,#e5e7eb); padding-bottom:.25rem; overflow-x:auto; }
.tabs a{
  position:relative; padding:.35rem .1rem; text-decoration:none;
  color:var(--muted,#7d8790); font-weight:800; white-space:nowrap; flex-shrink:0;
}
.tabs a.active{ color:var(--brand,#1cb5e0); }
.tabs a.active::after{
  content:""; position:absolute; right:0; left:0; bottom:-10px;
  height:3px; border-radius:3px; background:var(--brand,#1cb5e0);
}

/* Mobile tabs adjustments */
@media (max-width: 576px) {
  .tabs {
    gap: 1rem;
    padding-bottom: 0.25rem;
    margin-bottom: 1rem;
  }

  .tabs a {
    padding: 0.4rem 0.1rem;
    font-size: 0.95rem;
    font-weight: 700;
  }
}
/* عدّاد المفضلة داخل التبويب */
.tabs .count-badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:18px; height:18px; font-size:.72rem; line-height:1;
  border-radius:10px; margin-inline-start:.35rem; padding:0 6px;
  background:color-mix(in oklab,var(--brand,#1cb5e0) 15%,transparent);
  color:var(--brand-ink,#000046);
}

/* بطاقة المطعم */
.rest-row{
  background:linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border:1px solid var(--card-border,#e5e7eb);
  border-radius:var(--radius); padding:18px;
  display:flex; gap:1rem; align-items:center;
  box-shadow:0 2px 12px rgba(0,0,0,.06);
  transition: all 0.3s ease;
}
.rest-row--hover:hover{
  transform:translateY(-3px);
  box-shadow:0 8px 25px rgba(30,60,114,0.15);
  border-color: rgba(30,60,114,0.2);
}
.cursor-pointer{ cursor:pointer; }
.rest-row[role="link"]:focus-visible{
  outline:none; box-shadow:0 0 0 3px color-mix(in oklab,var(--brand,#1cb5e0) 30%,transparent);
}

.rest-logo{ width:54px; height:54px; border-radius:12px; object-fit:cover; flex:0 0 54px; }
.rest-logo--placeholder i{ font-size:1.1rem; }

.rest-title{ margin:0; font-weight:900; font-size:1rem; letter-spacing:.1px; }
.rest-sub{ color:var(--muted,#7d8790); font-size:.85rem; }

/* تقييم النجوم */
.star i{ color:var(--brand,#1cb5e0); }

/* شارات الحالة */
.badge-open,.badge-closed{ font-size:.72rem; border-radius:999px; padding:.15rem .6rem; white-space:nowrap; }
.badge-open{ background:var(--okBg,#e8f7ee); color:var(--okTxt,#0e8f46); }
.badge-closed{ background:var(--ngBg,#fdecea); color:var(--ngTxt,#d93025); }

/* شارة "مغلق" */
.ribbon-closed{
  position:absolute; top:10px; right:10px; background:var(--brand-ink,#000046);
  color:#fff; font-size:.72rem; border-radius:999px; padding:.2rem .55rem;
  box-shadow:var(--shadow-sm,0 4px 14px rgba(0,0,0,.06));
}

/* أزرار الأيقونات */
.icon-btn{
  width:40px; height:40px; border-radius:50%; display:inline-flex;
  align-items:center; justify-content:center; border:2px solid var(--card-border,#e5e7eb);
  background:linear-gradient(135deg, #fff 0%, #f8f9fa 100%); color:inherit; text-decoration:none;
  transition: all 0.3s ease;
  box-shadow:0 2px 8px rgba(0,0,0,.06);
}
.icon-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(30,60,114,0.2);
  border-color: rgba(30,60,114,0.3);
}
.icon-btn:focus{ outline:none; box-shadow:0 0 0 3px color-mix(in oklab,var(--brand,#1cb5e0) 30%,transparent); }

/* ألوان الأيقونات */
.icon-btn--heart i{ color:var(--brand,#1cb5e0); }
.icon-btn--bag i{ color:var(--brand-ink,#000046); }
.icon-btn--bag:hover i,
.icon-btn--heart:hover i{ color:#fff; }

/* شارة عدّاد السلة */
.dot-badge{
  position:absolute; top:-6px; right:-6px; min-width:18px; height:18px;
  padding:0 4px; border-radius:999px; font-size:11px; line-height:18px;
  background:var(--brand,#1cb5e0); color:#fff; text-align:center;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
}

/* حالة مفضلة نشطة */
.icon-btn--heart[data-fav="1"]{
  border-color:color-mix(in oklab,var(--brand,#1cb5e0) 70%,#fff 30%);
  background:color-mix(in oklab,var(--brand,#1cb5e0) 12%,#fff 88%);
}
.icon-btn--heart[data-fav="1"] i{ color:var(--brand,#1cb5e0); }
.icon-btn--heart:active{ transform:scale(.96); }

/* Empty state */
.empty-state{
  background:var(--surface,#fff);
  border:1px dashed var(--card-border,#e5e7eb);
  border-radius:var(--radius,14px);
  padding:16px; color:var(--muted,#7d8790); text-align:center;
}
.empty-state .bi{ font-size:1.1rem; margin-inline-start:.35rem; }

/* تصغير الشعار في الشاشات الصغيرة */
@media (max-width:576px){
  .rest-logo{ width:52px; height:52px; }

  .rest-row {
    padding: 16px;
    gap: 1rem;
    margin-bottom: 1rem;
    border-radius: 16px;
  }

  .rest-title {
    font-size: 0.975rem;
    margin-bottom: 0.3rem;
    font-weight: 800;
  }

  .rest-sub {
    font-size: 0.825rem;
  }

  .badge-open, .badge-closed {
    font-size: 0.725rem;
    padding: 0.2rem 0.7rem;
    min-height: 26px;
    display: flex;
    align-items: center;
    font-weight: 700;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  .icon-btn i {
    font-size: 1rem;
  }

  .star i {
    font-size: 0.925rem;
  }

  .text-muted.small {
    font-size: 0.775rem;
  }

  /* Better touch targets for restaurant cards */
  .rest-row {
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .rest-row:active {
    transform: scale(0.98);
  }

  /* Improve spacing for mobile */
  .d-flex.align-items-center.gap-2 {
    gap: 0.6rem !important;
  }

  .d-flex.justify-content-between.align-items-start {
    align-items: flex-start;
    gap: 0.6rem;
  }

  /* Better layout for restaurant info */
  .flex-grow-1 {
    min-width: 0;
    flex: 1;
  }

  /* Improve form spacing on mobile */
  .d-flex.align-items-center.justify-content-between.mt-2 {
    margin-top: 1rem !important;
    gap: 0.75rem;
  }

  .form-select {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
}

/* ===== Pagination (Bootstrap 5) لون العلامة ===== */
.pagination .page-link{ color:var(--brand-ink,#000046); }
.pagination .page-link:focus{ box-shadow:0 0 0 .2rem color-mix(in oklab,var(--brand,#1cb5e0) 30%,transparent); }
.pagination .page-item.active .page-link{
  background-color:var(--brand,#1cb5e0);
  border-color:var(--brand,#1cb5e0);
}
/* ===== Restaurant Show (Visions Grandeur) ===== */

/* Hero */
.hero{
  position:relative; overflow:hidden; border-radius:20px;
  background:linear-gradient(135deg,var(--brand-ink),var(--brand));
  color:#fff;
  margin-bottom: 2rem;
}
.hero-img{
  width:100%; height:240px; object-fit:cover; opacity:.18;
  filter:contrast(1.05) saturate(1.1);
}
.hero-overlay{
  position:absolute; inset:0; display:flex; align-items:end;
  padding:1.5rem 1.5rem;
  background:linear-gradient(180deg,rgba(0,0,0,0) 20%, rgba(0,0,0,.25) 55%, rgba(0,0,0,.45) 100%);
}
.hero-title{ font-weight:900; letter-spacing:.3px; margin:0; font-size: 1.5rem; }
.hero-sub{ color:#e6f7ff; font-size:1rem; }

/* حالة التشغيل */
.pill{
  display:inline-flex; align-items:center; gap:.5rem;
  padding:.3rem .8rem; border-radius:999px; font-size:.85rem; font-weight:700;
  background:rgba(255,255,255,.15); color:#fff; backdrop-filter:blur(4px);
  border:1px solid rgba(255,255,255,.25);
  margin-top: 0.5rem;
}
.pill-open{ background:rgba(16,185,129,.2); border-color:rgba(16,185,129,.35); }
.pill-closed{ background:rgba(148,163,184,.18); border-color:rgba(148,163,184,.35); }

/* Toolbar أعلى الهيرو */
.tool-row{ display:flex; gap:.75rem; flex-wrap:wrap; margin-top: 1rem; }
.tool-row .btn{ border-radius:12px; padding: 0.5rem 1rem; font-weight: 600; }
.btn-outline-light{
  --bs-btn-color:#fff; --bs-btn-border-color:rgba(255,255,255,.6);
  --bs-btn-hover-bg:#fff; --bs-btn-hover-color:#111;
}

/* عنوان القسم */
.cat-title{
  position:sticky; top:.5rem; z-index:3;
  background:linear-gradient(180deg,#fff 70%, rgba(255,255,255,.6));
  padding:.8rem 1rem; margin:1.5rem 0 1rem; border-radius:14px;
  font-weight:900; color:#0e1a2b; border:1px solid #eef2f6;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

/* بطاقة الصنف */
.item{
  position:relative; display:flex; gap:1rem; align-items:stretch;
  background:var(--card); border-radius:16px; border:1px solid #eef2f6;
  box-shadow:var(--shadow); padding:1rem;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  margin-bottom: 0.5rem;
}
.item:hover{ transform:translateY(-2px); box-shadow:0 10px 28px rgba(16,24,40,.1); border-color:#e3eef6; }
.thumb{
  width:90px; height:90px; border-radius:16px; object-fit:cover; flex:0 0 90px;
  background:#f1f5f9;
}
.thumb-empty{ display:flex; align-items:center; justify-content:center; color:#9aa9b7; font-size:1.25rem; }

.name{ margin:0; font-weight:800; font-size:1.1rem; color:var(--text); }
.desc{ color:var(--muted); font-size:.9rem; line-height:1.5; margin-top:.2rem; }

/* السعر بتدرج Visions Grandeur */
.price{
  font-weight:900; font-size:1.05rem; white-space:nowrap; color:#0f3e5f;
  background:linear-gradient(135deg, color-mix(in oklab,var(--brand) 14%, transparent), color-mix(in oklab,var(--brand-ink) 8%, transparent));
  padding:.3rem .6rem; border-radius:12px; border:1px solid #d7ecf6;
  align-self: flex-start;
}

/* نموذج الإضافة */
.actions{ display:flex; gap:.6rem; flex-wrap:wrap; align-items:center; margin-top: 0.5rem; }
.qty{ max-width:100px; border-radius:12px; padding: 0.5rem; font-size: 0.9rem; }
.notes{ border-radius:12px; padding: 0.5rem; font-size: 0.9rem; }
.btn-add{
  border-radius:12px; font-weight:800; letter-spacing:.2px;
  box-shadow:0 8px 18px rgba(28,181,224,.25);
  padding: 0.5rem 1rem;
  min-height: 44px;
}

/* تنعيم تنبيهات */
.alert{ border-radius:14px; }

/* استجابة */
@media (max-width:576px){
  .hero{
    margin-bottom: 1.5rem;
  }
  .hero-img{ height:200px; }
  .hero-overlay{
    padding: 1.25rem;
  }
  .hero-title{
    font-size: 1.25rem;
  }
  .hero-sub{
    font-size: 0.9rem;
  }
  .pill{
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    margin-top: 0.25rem;
  }
  .tool-row{
    gap: 0.5rem;
    margin-top: 0.75rem;
  }
  .tool-row .btn{
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    min-height: 40px;
  }
  .cat-title{
    padding: 0.7rem 0.9rem;
    margin: 1.25rem 0 0.75rem;
    font-size: 1rem;
  }
  .item{
    padding: 0.9rem;
    gap: 0.8rem;
  }
  .thumb{
    width: 80px;
    height: 80px;
    flex-basis: 80px;
    border-radius: 14px;
  }
  .name{
    font-size: 1rem;
  }
  .desc{
    font-size: 0.85rem;
  }
  .price{
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
  }
  .actions{
    gap: 0.5rem;
    margin-top: 0.75rem;
  }
  .qty{
    max-width: 80px;
    padding: 0.4rem;
    font-size: 0.9rem;
  }
  .notes{
    padding: 0.4rem;
    font-size: 0.9rem;
  }
  .btn-add{
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    min-height: 42px;
  }
}

/* Dark theme تحسينات بسيطة */
[data-theme="dark"] .cat-title{
  background:linear-gradient(180deg,var(--surface) 70%, color-mix(in oklab,var(--surface) 80%, transparent));
  border-color:var(--card-border); color:#e9eef6;
}
[data-theme="dark"] .item{ border-color:var(--card-border); }
[data-theme="dark"] .price{
  color:#e8f7ff; border-color:color-mix(in oklab,var(--brand) 30%, var(--card-border));
}
