/* ============================================================
   components.css  — Cards, Categories, Forms, Badges, Toggles
   ============================================================ */

/* ── CATEGORY CHIPS ─────────────────────────────────────── */
.cats {
  display: flex; gap: 8px; padding: 12px 16px;
  overflow-x: auto; scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  background: var(--glass); border: 1px solid var(--bd);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-radius: 50px; padding: 7px 14px;
  font-family: 'Cairo', sans-serif; font-size: 0.78rem; font-weight: 700;
  color: var(--text2); cursor: pointer; white-space: nowrap;
  transition: all .2s; -webkit-user-select: none; user-select: none;
}
.cat.on {
  background: var(--c1); color: #231F20;
  border-color: var(--c1); box-shadow: var(--sha);
}

/* ── PRODUCT GRID ───────────────────────────────────────── */
.pgrid {
  display: grid; grid-template-columns: repeat(2,1fr);
  gap: 10px; padding: 0 12px 12px;
}
.pcard {
  background: var(--glass); border: 1px solid var(--bd);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-radius: 18px; padding: 14px 12px;
  display: flex; flex-direction: column;
  cursor: pointer; transition: all .22s;
  animation: fadeUp .4s ease both;
}
.pcard:active { transform: scale(.95); }

.pcard-ico { font-size: 2.2rem; margin-bottom: 8px; text-align: center; }
.pcard-name {
  font-size: 0.82rem; font-weight: 800; color: var(--text);
  margin-bottom: 4px; line-height: 1.35;
}
.pcard-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.pcard-price {
  font-size: 0.78rem; font-weight: 800; color: var(--c1);
}
.badge {
  font-size: 0.58rem; font-weight: 800;
  background: rgba(253,184,20,.15); color: var(--c1);
  border: 1px solid rgba(253,184,20,.25);
  padding: 2px 7px; border-radius: 50px;
}
.badge.green {
  background: rgba(52,199,89,.12); color: #34C759;
  border-color: rgba(52,199,89,.25);
}
.pcard-add {
  margin-top: auto; padding-top: 10px;
  display: flex; align-items: center; justify-content: flex-end;
}
.add-ic {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--c1); color: #231F20;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 700;
  box-shadow: var(--sha); transition: all .18s;
}
.pcard:active .add-ic { transform: scale(.88); }

/* ── PRODUCT DETAIL SHEET ───────────────────────────────── */
.pd-top {
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--bd);
  display: flex; align-items: flex-start; gap: 14px;
}
.pd-ico { font-size: 3.5rem; flex-shrink: 0; }
.pd-info { flex: 1; }
.pd-name { font-size: 1.05rem; font-weight: 900; color: var(--text); margin-bottom: 5px; }
.pd-price { font-size: 0.95rem; font-weight: 800; color: var(--c1); margin-bottom: 4px; }
.pd-desc { font-size: 0.78rem; color: var(--text2); line-height: 1.7; }

.pd-qty-row {
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.pd-qty-lbl { font-size: 0.82rem; font-weight: 800; color: var(--text); }
.qty-ctrl { display: flex; align-items: center; gap: 12px; }
.qty-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--glass); border: 1px solid var(--bd2);
  color: var(--text); font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-family: 'Cairo', sans-serif; transition: all .15s;
}
.qty-btn:active { transform: scale(.88); background: var(--c1s); }
.qty-n { font-size: 1rem; font-weight: 900; color: var(--text); min-width: 20px; text-align: center; }

.pd-note { padding: 0 20px 14px; }
.pd-note textarea {
  width: 100%; background: var(--glass); border: 1px solid var(--bd);
  border-radius: 12px; padding: 10px 13px;
  font-family: 'Cairo', sans-serif; font-size: 0.82rem;
  color: var(--text); resize: none; outline: none;
  transition: border-color .2s;
}
.pd-note textarea:focus { border-color: rgba(253,184,20,.4); }
.pd-note textarea::placeholder { color: var(--text3); }

.pd-actions { padding: 12px 20px 20px; display: flex; gap: 10px; }
.pd-wa {
  flex: 1; background: #25D366; border: none;
  color: white; padding: 13px; border-radius: 13px;
  font-family: 'Cairo', sans-serif; font-size: 0.82rem;
  font-weight: 800; cursor: pointer;
}
.pd-add {
  flex: 2; background: var(--c1); border: none;
  color: #231F20; padding: 13px; border-radius: 13px;
  font-family: 'Cairo', sans-serif; font-size: 0.88rem;
  font-weight: 900; cursor: pointer; box-shadow: var(--sha);
}

/* ── SERVICE CARD ───────────────────────────────────────── */
.svc-list { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; }
.svc-card {
  background: var(--glass); border: 1px solid var(--bd);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-radius: 16px; padding: 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: all .22s;
}
.svc-card:active { transform: scale(.97); }
.svc-ico { font-size: 2rem; flex-shrink: 0; }
.svc-info { flex: 1; }
.svc-name { font-size: 0.88rem; font-weight: 800; color: var(--text); margin-bottom: 3px; }
.svc-price { font-size: 0.75rem; color: var(--c1); font-weight: 700; }
.svc-arr { color: var(--text3); font-size: 0.8rem; }

/* ── SECTION HEADER ─────────────────────────────────────── */
.sec-hdr {
  font-size: 0.75rem; font-weight: 900;
  color: var(--text2); text-transform: uppercase;
  letter-spacing: .07em; padding: 14px 16px 8px;
}

/* ── STAT CARD (admin) ──────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; padding: 12px 16px; }
.stat {
  background: var(--glass); border: 1px solid var(--bd);
  backdrop-filter: var(--blur); border-radius: 16px;
  padding: 14px;
}
.stat-l { font-size: 0.72rem; color: var(--text2); font-weight: 700; margin-bottom: 6px; }
.stat-v { font-size: 1.35rem; font-weight: 900; color: var(--text); }
.stat-v span { font-size: 0.8rem; color: var(--c1); font-weight: 800; margin-right: 4px; }

/* ── FORM ELEMENTS ──────────────────────────────────────── */
.form-box {
  background: var(--glass); border: 1px solid var(--bd);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-radius: 18px; padding: 18px; margin: 12px 16px;
}
.form-box h3 { font-size: 0.88rem; font-weight: 800; margin-bottom: 14px; }

.fl {
  font-size: 0.73rem; font-weight: 700; color: var(--text2);
  margin-bottom: 5px; display: block;
}
.fi, .fs {
  width: 100%; background: var(--glass); border: 1px solid var(--bd);
  border-radius: 10px; padding: 10px 13px;
  font-family: 'Cairo', sans-serif; font-size: 0.84rem;
  color: var(--text); outline: none; transition: border-color .2s;
  margin-bottom: 11px; direction: rtl;
  -webkit-appearance: none;
}
.fi:focus, .fs:focus { border-color: rgba(253,184,20,.45); }
.fi::placeholder { color: var(--text3); }
.fs option { background: var(--bg2); color: var(--text); }

/* ── NEIGHBORHOOD GRID ──────────────────────────────────── */
.nbh-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-bottom: 11px; }
.nbh-opt {
  background: var(--glass); border: 1.5px solid var(--bd);
  border-radius: 10px; padding: 9px 10px;
  font-family: 'Cairo', sans-serif; font-size: 0.78rem;
  font-weight: 700; color: var(--text2);
  cursor: pointer; text-align: center; transition: all .2s;
}
.nbh-opt.on { background: var(--c1s); border-color: var(--c1); color: var(--c1); }

/* ── FILE UPLOAD ────────────────────────────────────────── */
.file-upload {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; background: var(--glass);
  border: 1.5px dashed var(--bd2); border-radius: 12px;
  padding: 20px; cursor: pointer; transition: all .2s;
  margin-bottom: 11px;
}
.file-upload:active { border-color: var(--c1); background: var(--c1s); }
.file-upload input { display: none; }
.file-upload .fu-ico { font-size: 1.8rem; margin-bottom: 6px; }
.file-upload .fu-lbl { font-size: 0.75rem; color: var(--text2); font-weight: 700; }
.file-preview {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass); border: 1px solid var(--bd);
  border-radius: 10px; padding: 9px 13px; margin-bottom: 11px;
}
.file-preview .fp-name { font-size: 0.78rem; color: var(--text); flex: 1; }
.file-preview .fp-del {
  background: none; border: none; color: var(--text3);
  font-size: 1rem; cursor: pointer; padding: 2px;
}

/* ── SUBMIT BUTTON ──────────────────────────────────────── */
.sbtn {
  width: 100%; background: var(--c1); border: none;
  color: #231F20; padding: 13px; border-radius: 13px;
  font-family: 'Cairo', sans-serif; font-size: 0.9rem;
  font-weight: 900; cursor: pointer; box-shadow: var(--sha);
  transition: all .2s; margin-top: 4px;
}
.sbtn:active { transform: scale(.97); }
.sbtn:disabled { opacity: .5; cursor: not-allowed; }

.sbtn-ghost {
  width: 100%; background: var(--glass);
  border: 1px solid var(--bd); color: var(--text2);
  padding: 12px; border-radius: 13px;
  font-family: 'Cairo', sans-serif; font-size: 0.85rem;
  font-weight: 700; cursor: pointer; transition: all .2s;
  margin-top: 8px;
}
.sbtn-ghost:active { transform: scale(.97); }

/* ── TOGGLE ROW ─────────────────────────────────────────── */
.tog-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--glass); border: 1px solid var(--bd);
  border-radius: 13px; padding: 12px 14px; margin-bottom: 10px;
}
.tog-lbl { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.tog {
  position: relative; width: 42px; height: 24px;
  background: var(--bd2); border-radius: 50px;
  cursor: pointer; transition: background .25s; flex-shrink: 0;
}
.tog.on { background: var(--c1); }
.tog::after {
  content: ''; position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: right .25s;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.tog.on::after { right: calc(100% - 21px); }

/* ── ITEM CARD (admin list) ─────────────────────────────── */
.item-card {
  background: var(--glass); border: 1px solid var(--bd);
  backdrop-filter: var(--blur); border-radius: 14px;
  padding: 12px 14px; margin: 0 16px 9px;
  display: flex; align-items: center; gap: 11px;
}
.item-ico { font-size: 1.7rem; flex-shrink: 0; }
.item-info { flex: 1; min-width: 0; }
.item-name { font-size: 0.85rem; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.item-sub  { font-size: 0.73rem; color: var(--text2); }
.item-actions { display: flex; gap: 7px; }
.ib-del, .ib-edit {
  width: 30px; height: 30px; border-radius: 9px; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.8rem; transition: all .18s;
}
.ib-del  { background: rgba(255,59,48,.12); color: #ff3b30; }
.ib-edit { background: var(--c1s); color: var(--c1); }
.ib-del:active, .ib-edit:active { transform: scale(.88); }

/* ── ZONE CARD (admin) ──────────────────────────────────── */
.zone-card {
  background: var(--glass); border: 1px solid var(--bd);
  backdrop-filter: var(--blur); border-radius: 14px;
  padding: 12px 14px; margin: 0 16px 9px;
  display: flex; align-items: center; gap: 11px;
}
.zone-pin { font-size: 1.6rem; flex-shrink: 0; }
.zone-info { flex: 1; }
.zone-name { font-size: 0.85rem; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.zone-meta { font-size: 0.73rem; color: var(--text2); }

/* ── TAB BAR (admin) ────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 6px; padding: 12px 16px 0;
  overflow-x: auto; scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab {
  background: var(--glass); border: 1px solid var(--bd);
  backdrop-filter: var(--blur); border-radius: 50px;
  padding: 7px 16px; font-family: 'Cairo', sans-serif;
  font-size: 0.78rem; font-weight: 700; color: var(--text2);
  cursor: pointer; white-space: nowrap; transition: all .2s;
  -webkit-user-select: none; user-select: none;
}
.tab.on { background: var(--c1); color: #231F20; border-color: var(--c1); }

/* ── PIN PAD (admin login) ──────────────────────────────── */
.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 26px; }
.pin-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--bd2); background: transparent; transition: all .2s;
}
.pin-dot.on { background: var(--c1); border-color: var(--c1); box-shadow: 0 0 10px rgba(253,184,20,.45); }

.pin-pad { display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; max-width: 280px; margin: 0 auto; }
.pk-key {
  background: var(--glass); border: 1px solid var(--bd);
  backdrop-filter: var(--blur); border-radius: 14px;
  padding: 16px; font-family: 'Cairo', sans-serif;
  font-size: 1.3rem; font-weight: 700; color: var(--text);
  cursor: pointer; text-align: center;
  transition: all .15s; -webkit-user-select: none; user-select: none;
}
.pk-key:active { background: var(--c1s); border-color: rgba(253,184,20,.5); transform: scale(.9); }

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty {
  text-align: center; padding: 48px 24px; color: var(--text2);
}
.empty .e-ico { font-size: 2.8rem; margin-bottom: 10px; }
.empty .e-msg { font-size: 0.82rem; line-height: 1.8; }

/* ── LIGHT MODE OVERRIDES ───────────────────────────────── */
body.light .pcard,
body.light .svc-card,
body.light .stat,
body.light .form-box,
body.light .item-card,
body.light .zone-card,
body.light .tog-row { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.09); }

body.light .fi,
body.light .fs { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.1); color: #1C1C1E; }
body.light .fi::placeholder { color: rgba(0,0,0,.32); }
body.light .fs option { background: #f5f5f7; color: #1c1c1e; }

body.light .cat,
body.light .tab { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.09); color: #555; }
body.light .cat.on,
body.light .tab.on { background: var(--c1); color: #231F20; border-color: var(--c1); }

body.light .pk-key { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.09); }
body.light .pk-key:active { background: var(--c1s); }
body.light .nbh-opt { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.09); color: #555; }
body.light .nbh-opt.on { background: var(--c1s); border-color: var(--c1); color: var(--c1); }
