:root {
  --peach: #f5a97f;
  --peach-dark: #e0855a;
  --bg: #faf7f5;
  --surface: #ffffff;
  --text-primary: #241f1c;
  --text-secondary: #6f6560;
  --text-tertiary: #a89e98;
  --hairline: #ece5e1;
  --danger: #d9534f;
  --success: #3fa66a;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(36, 31, 28, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Tahoma", "Segoe UI", system-ui, sans-serif;
  direction: rtl;
}

body {
  min-height: 100vh;
  padding-bottom: 76px; /* مساحة للـ bottom nav */
}

a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 15px;
}

.btn-primary {
  background: var(--peach);
  color: #fff;
  font-weight: 600;
}
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary:hover:not(:disabled) { background: var(--peach-dark); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--hairline);
  color: var(--text-primary);
}

.btn-text {
  background: transparent;
  color: var(--text-secondary);
}

input, select, textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--hairline);
  background: var(--surface);
  color: var(--text-primary);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--peach);
}

/* ── Top bar ─────────────────────────────────────────── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.top-bar__title { font-size: 18px; font-weight: 700; }
.top-bar__logout {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
  font-size: 13px;
}

/* ── Bottom nav ──────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 10;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  box-shadow: 0 -2px 10px rgba(36, 31, 28, 0.05);
}
.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0 8px;
  color: var(--text-tertiary);
  font-size: 12px;
}
.bottom-nav__item.active { color: var(--peach-dark); font-weight: 700; }
.bottom-nav__icon { font-size: 20px; }

/* ── Generic layout ──────────────────────────────────── */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin: 22px 0 10px;
}
.muted { color: var(--text-secondary); font-size: 13px; }
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--hairline);
  border-top-color: var(--peach);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  bottom: 90px;
  right: 50%;
  transform: translateX(50%);
  background: var(--text-primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 13px;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ── Auth page ───────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 26px 22px;
}
.auth-logo { font-size: 26px; font-weight: 800; text-align: center; margin-bottom: 4px; color: var(--peach-dark); }
.auth-sub { text-align: center; color: var(--text-secondary); font-size: 13px; margin-bottom: 22px; }
.auth-field { margin-bottom: 14px; }
.auth-error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 16px; }
#recaptcha-container { margin: 10px 0; }

/* ── Reservation card ────────────────────────────────── */
.reservation-card { display: flex; flex-direction: column; gap: 6px; }
.reservation-card__top { display: flex; justify-content: space-between; align-items: center; }
.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--hairline);
  color: var(--text-secondary);
}
.status-pill.confirmed { background: rgba(63,166,106,0.14); color: var(--success); }
.status-pill.pending { background: rgba(245,169,127,0.18); color: var(--peach-dark); }
.status-pill.cancelled { background: rgba(217,83,79,0.12); color: var(--danger); }

/* ── Store ───────────────────────────────────────────── */
.category-row { margin-bottom: 20px; }
.product-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.product-card {
  min-width: 150px;
  max-width: 150px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.product-card img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: var(--hairline);
}
.product-card__body { padding: 10px; }
.product-card__name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.product-card__price { font-size: 13px; color: var(--peach-dark); font-weight: 700; }
.product-card button { width: 100%; margin-top: 8px; font-size: 12px; padding: 7px; }

.cart-fab {
  position: fixed;
  bottom: 90px;
  left: 18px;
  background: var(--peach);
  color: #fff;
  padding: 12px 18px;
  border-radius: 30px;
  font-weight: 700;
  box-shadow: var(--shadow);
  z-index: 20;
}

/* ── Settings ────────────────────────────────────────── */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}
.settings-row:last-child { border-bottom: none; }
.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  background: var(--hairline);
  border-radius: 30px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.toggle.on { background: var(--peach); }
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: right 0.15s ease;
}
.toggle.on::after { right: 20px; }


/* ── Products Admin ─────────────────────────────────── */
.admin-page { padding-top: 86px; padding-bottom: 96px; }
.manage-hero-card, .manage-card, .home-status-card {
  background: var(--surface);
  border-radius: var(--radius-lg, 24px);
  box-shadow: var(--shadow);
  padding: 18px;
  margin: 14px 16px;
}
.manage-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.manage-hero-card h1 { margin: 6px 0; font-size: 24px; }
.manage-hero-card p { margin: 0; color: var(--text-secondary); line-height: 1.7; }
.home-eyebrow { color: var(--peach-dark); font-weight: 800; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.home-status-card.info { color: var(--text); }
.home-status-card.error { color: var(--danger); background: rgba(217,83,79,.10); }
.home-status-card.success { color: var(--success); background: rgba(63,166,106,.10); }

.form-grid { display: grid; gap: 14px; margin-bottom: 14px; }
.form-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label, .dialog-card label, .advanced-details label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  color: var(--text);
}
.form-grid input, .form-grid select, .dialog-card input, .dialog-card textarea, .advanced-details input {
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 12px 13px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.required span::after { content: " *"; color: var(--danger); }
.advanced-details {
  border: 1px dashed var(--hairline);
  border-radius: 16px;
  padding: 12px;
  margin: 10px 0 14px;
  color: var(--text-secondary);
}
.advanced-details summary { cursor: pointer; font-weight: 800; color: var(--text); }
.manage-actions-row { display:flex; gap:10px; flex-wrap:wrap; align-items:center; justify-content:flex-start; }
.mini-check { display:flex; gap:8px; align-items:center; color:var(--text-secondary); font-weight:700; }

.product-summary-grid {
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:10px;
  margin: 14px 16px;
}
.summary-tile {
  background: var(--surface);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
  border: 1px solid var(--hairline);
}
.summary-tile span { display:block; color:var(--text-secondary); font-size:12px; }
.summary-tile strong { display:block; font-size:24px; margin-top:4px; color:var(--peach-dark); }

.product-admin-list { display:grid; gap:12px; margin:14px 16px; }
.product-admin-card {
  display:grid;
  grid-template-columns: 94px 1fr;
  gap:14px;
  background:var(--surface);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:12px;
  border:1px solid var(--hairline);
}
.product-admin-card.archived { opacity:.68; }
.product-admin-image {
  width:94px; height:94px; border-radius:18px; overflow:hidden;
  background:var(--hairline); display:grid; place-items:center; font-size:30px;
}
.product-admin-image img { width:100%; height:100%; object-fit:cover; display:block; }
.product-admin-body { min-width:0; }
.product-admin-title-row { display:flex; justify-content:space-between; align-items:start; gap:10px; }
.product-admin-title-row strong { font-size:16px; }
.product-admin-body p { margin:6px 0; color:var(--text-secondary); }
.product-admin-meta { display:flex; gap:8px; flex-wrap:wrap; margin:10px 0; color:var(--text-secondary); font-size:13px; }
.product-admin-meta span {
  background:rgba(0,0,0,.04); border-radius:999px; padding:6px 9px;
}
.product-admin-meta .badge.warn { background: rgba(245,169,127,.22); color: var(--peach-dark); font-weight:800; }
.product-admin-actions { display:flex; gap:8px; flex-wrap:wrap; }
.status-pill.active { background: rgba(63,166,106,0.14); color: var(--success); }
.status-pill.off { background: rgba(217,83,79,0.12); color: var(--danger); }

.saloora-dialog {
  border:0;
  padding:0;
  border-radius:24px;
  width:min(760px, calc(100vw - 24px));
  background:transparent;
}
.saloora-dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-card {
  background:var(--surface);
  border-radius:24px;
  padding:18px;
  box-shadow:0 24px 70px rgba(0,0,0,.22);
}
.dialog-head { display:flex; justify-content:space-between; gap:12px; align-items:start; margin-bottom:16px; }
.dialog-head h2 { margin:0 0 6px; }
.dialog-head p { margin:0; color:var(--text-secondary); }
.icon-btn {
  border:0; background:var(--hairline); width:38px; height:38px;
  border-radius:50%; font-size:24px; cursor:pointer;
}
.image-uploader-card {
  border:1px solid var(--hairline);
  border-radius:18px;
  padding:14px;
  display:grid;
  gap:12px;
  margin:14px 0;
}
.image-uploader-card p { margin:4px 0 0; color:var(--text-secondary); }
.image-preview {
  min-height:120px;
  border:1px dashed var(--hairline);
  border-radius:16px;
  display:grid;
  place-items:center;
  color:var(--text-secondary);
  overflow:hidden;
}
.image-preview.has-image img { width:100%; max-height:240px; object-fit:contain; background:#fff; }
.switch-row { display:flex !important; flex-direction:row; justify-content:space-between; align-items:center; border:1px solid var(--hairline); border-radius:16px; padding:12px; }
.dialog-actions { display:flex; justify-content:flex-start; gap:10px; margin-top:16px; }
.home-load-more { margin:12px auto 96px; display:block; }

@media (max-width: 720px) {
  .manage-hero-card { flex-direction:column; align-items:stretch; }
  .form-grid.two-cols { grid-template-columns:1fr; }
  .product-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .product-admin-card { grid-template-columns:76px 1fr; }
  .product-admin-image { width:76px; height:76px; }
}

/* ── Home Feed V12 — compact mobile-like posts, no full-screen width ───────── */
.saloora-shell {
  background:
    radial-gradient(circle at 12% 16%, rgba(245,169,127,.10), transparent 28%),
    linear-gradient(180deg, #fffaf6 0%, var(--bg) 55%, #fff 100%);
}
.saloora-home-shell {
  overflow-x: hidden;
}
.home-page {
  width: min(100%, 1120px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 16px 108px;
}
.home-hero-card {
  width: min(100%, 760px);
  margin: 0 auto 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: linear-gradient(135deg, #fff, #fff4ee);
  border: 1px solid #efe2dc;
  border-radius: 26px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.home-hero-card h1 {
  margin: 4px 0 8px;
  font-size: clamp(23px, 3.6vw, 34px);
  line-height: 1.25;
  color: var(--text-primary);
}
.home-hero-card p { margin: 0; color: var(--text-secondary); line-height: 1.75; }
.home-eyebrow { color: var(--peach-dark); font-weight: 900; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.home-refresh-btn {
  flex: 0 0 auto;
  background: var(--peach);
  color: #fff;
  font-weight: 900;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(245,169,127,.24);
}
.home-refresh-btn:disabled { opacity: .55; cursor: wait; }
.home-status-card {
  width: min(100%, 660px);
  margin: 0 auto 14px;
}
.home-status-card.info { color: var(--text); }
.home-status-card.error { color: var(--danger); background: rgba(217,83,79,.10); }
.home-status-card.success { color: var(--success); background: rgba(63,166,106,.10); }
.home-content {
  width: 100%;
  display: grid;
  gap: 14px;
}
.home-strip {
  width: min(100%, 760px);
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.home-feed-section {
  width: min(100%, 600px);
  margin-inline: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.home-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.home-section-head h2 { margin: 0; font-size: 18px; }
.home-section-subtitle { color: var(--text-secondary); font-size: 12px; font-weight: 700; }
.sticky-feed-title {
  position: sticky;
  top: 56px;
  z-index: 4;
  width: 100%;
  background: rgba(250,247,245,.92);
  backdrop-filter: blur(10px);
  padding: 10px 2px;
  border-radius: 0 0 18px 18px;
}
.home-chip-row,
.home-card-row,
.home-reels-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}
.home-chip {
  flex: 0 0 auto;
  background: #fff7f2;
  border: 1px solid #f0ded3;
  color: var(--peach-dark);
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 900;
  scroll-snap-align: start;
}
.home-mini-card {
  flex: 0 0 170px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  overflow: hidden;
  scroll-snap-align: start;
}
.home-mini-image {
  height: 112px;
  display: grid;
  place-items: center;
  background: #f5eee9;
  color: var(--peach-dark);
  font-size: 30px;
  overflow: hidden;
}
.home-mini-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-mini-body { padding: 12px; }
.home-mini-body strong { display: block; margin-bottom: 5px; line-height: 1.35; }
.home-mini-body p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.45; }
.home-mini-body small { display: inline-block; margin-top: 8px; color: var(--peach-dark); font-weight: 900; }
.home-reel-card {
  flex: 0 0 118px;
  height: 178px;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  background: #2d2521;
  color: #fff;
  scroll-snap-align: start;
}
.home-reel-card img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .9; }
.home-reel-card strong {
  position: absolute;
  inset: auto 8px 8px;
  font-size: 12px;
  line-height: 1.35;
  text-shadow: 0 2px 8px rgba(0,0,0,.55);
}
.home-reel-placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-size: 28px; }
.home-featured-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  align-items: center;
}
.home-featured-card img { width: 150px; height: 110px; border-radius: 18px; object-fit: cover; background: var(--hairline); }
.home-featured-card strong { font-size: 18px; }
.home-featured-card p { margin: 8px 0 0; color: var(--text-secondary); line-height: 1.7; }
.home-posts-list {
  display: grid;
  gap: 16px;
  justify-items: center;
}
.home-post-card {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border: 1px solid rgba(236,229,225,.95);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(36,31,28,.07);
}
.home-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px 10px;
}
.home-post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff0e7, #f5a97f);
  color: #fff;
  font-weight: 900;
  border: 1px solid rgba(245,169,127,.35);
}
.home-post-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-post-author { min-width: 0; flex: 1; }
.home-post-author strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-post-author span { display: block; color: var(--text-tertiary); font-size: 11px; font-weight: 700; margin-top: 2px; }
.home-post-menu {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  font-weight: 900;
  padding: 0;
}
.home-post-text { padding: 0 14px 12px; }
.home-post-text h3 { margin: 0 0 7px; font-size: 16px; line-height: 1.45; }
.home-post-text p { margin: 0; color: var(--text-secondary); line-height: 1.75; white-space: pre-wrap; font-size: 14px; }
.home-post-media {
  width: 100%;
  background: #f4eee9;
  overflow: hidden;
  border-top: 1px solid rgba(236,229,225,.7);
  border-bottom: 1px solid rgba(236,229,225,.7);
}
.home-post-image {
  width: 100%;
  height: auto;
  max-height: 620px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  background: var(--hairline);
}
.home-post-actions {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 12px;
  color: var(--peach-dark);
  border-top: 1px solid rgba(236,229,225,.55);
}
.home-post-actions span {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  padding: 7px 8px;
  border-radius: 999px;
  background: #fff8f4;
}
.home-load-more { margin: 16px auto 96px; display:block; background: var(--surface); border: 1px solid var(--hairline); color: var(--peach-dark); font-weight: 900; }
.home-skeleton {
  width: min(100%, 600px);
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.skeleton-line,
.skeleton-pill,
.skeleton-post {
  background: linear-gradient(90deg, #f2ebe7, #fff, #f2ebe7);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: 999px;
}
.skeleton-title { width: 55%; height: 18px; margin-bottom: 14px; }
.skeleton-row { display:flex; gap:10px; margin-bottom:14px; }
.skeleton-pill { width: 90px; height: 34px; }
.skeleton-post { height: 420px; border-radius: 22px; margin-bottom: 12px; }
.skeleton-post.short { height: 130px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.home-debug-raw {
  width: min(100%, 760px);
  margin: 14px auto 90px;
  background: #fff;
  border: 1px dashed var(--hairline);
  border-radius: 18px;
  padding: 12px;
  direction: ltr;
}
.home-debug-raw pre { white-space: pre-wrap; overflow: auto; max-height: 480px; font-size: 11px; }
@media (max-width: 720px) {
  .home-page { padding: 10px 10px 96px; }
  .home-hero-card { width: 100%; flex-direction: column; align-items: stretch; border-radius: 22px; padding: 18px; }
  .home-refresh-btn { width: 100%; }
  .home-strip { width: 100%; border-radius: 20px; padding: 14px; }
  .home-feed-section { width: 100%; }
  .home-post-card { max-width: 100%; border-radius: 20px; }
  .home-post-image { max-height: 560px; }
  .home-featured-card { grid-template-columns: 1fr; }
  .home-featured-card img { width: 100%; height: 180px; }
  .sticky-feed-title { top: 50px; }
}
