@import url('https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@300;400;500;600;700;800;900&display=swap');

/* Variables moved to theme.css for unified management */
:root {
  --font: 'Noto Kufi Arabic', sans-serif;
  --font-ui: 'Noto Kufi Arabic', sans-serif;
  --nav-h: 68px;
  --sidebar-w: 260px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px;
  --r-lg: 18px; --r-xl: 32px; --r-xxl: 40px; --r-full: 999px;

  /* Mobile-first Safe Area Variables (Capacitor/Mobile Support) */
  --sat: env(safe-area-inset-top,    0px);
  --sar: env(safe-area-inset-right,  0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left,   0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  direction: rtl;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  /* Respect safe areas for PWA/App without breaking Desktop layout */
  padding-top: var(--sat);
  padding-bottom: var(--sab);
  padding-left: var(--sal);
  padding-right: var(--sar);
}
img { max-width: 100%; display: block; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--font); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }

/* ─── TYPOGRAPHY ─── */
.text-hero   { font-size: clamp(28px, 4vw, 42px); font-weight: 800; line-height: 1.25; }
.text-h1     { font-size: clamp(22px, 3vw, 32px); font-weight: 700; line-height: 1.3; }
.text-h2     { font-size: clamp(18px, 2.5vw, 26px); font-weight: 700; line-height: 1.35; }
.text-h3     { font-size: 18px; font-weight: 600; }
.text-h4     { font-size: 16px; font-weight: 600; }
.text-body   { font-size: 15px; line-height: 1.65; }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 11px; }
.text-price  { font-size: 20px; font-weight: 700; color: var(--primary); }
.text-price-lg { font-size: 28px; font-weight: 800; color: var(--primary); }
.text-primary  { color: var(--primary); }
.text-muted    { color: var(--text-muted); }
.text-sub      { color: var(--text-sub); }

/* ─── LAYOUT ─── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 860px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-xs { gap: 6px; } .gap-sm { gap: 10px; } .gap-md { gap: 16px; } .gap-lg { gap: 24px; }
.flex-1 { flex: 1; } .flex-shrink-0 { flex-shrink: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; }

/* ─── CARDS ─── */
.card {
  background: var(--bg-card); border: 1px solid rgba(0,0,0,0.15);
  border-radius: var(--r-xl); padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 10px 30px rgba(0,0,0,0.06); transition: var(--transition);
}
.card:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.08), 0 15px 40px rgba(0,0,0,0.12); transform: translateY(-2px); }
.card-flat { background: var(--bg-card); border: 1px solid rgba(0,0,0,0.12); border-radius: var(--r-xl); padding: 20px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--r-full); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition); border: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { opacity: 0.88; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { opacity: 0.88; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { opacity: 0.88; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--text-sub); border: 0.5px solid var(--border-mid); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-soft { background: var(--primary-soft); color: var(--primary); border: 0.5px solid var(--primary-mid); }
.btn-soft:hover { background: var(--primary-mid); }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--r-full); }
.btn-icon-sq { width: 40px; height: 40px; padding: 0; border-radius: var(--r-sm); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── BADGES ─── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: var(--r-full); border: 1px solid rgba(0,0,0,0.1); }
.badge-primary { background: var(--primary-soft); color: var(--primary); border-color: rgba(138, 79, 189, 0.2); }
.badge-success { background: var(--secondary-soft); color: var(--secondary); border-color: rgba(82, 183, 136, 0.2); }
.badge-danger  { background: var(--accent-soft); color: var(--accent); border-color: rgba(220, 38, 38, 0.15); }
.badge-teal    { background: var(--teal-soft); color: var(--teal); border-color: rgba(63, 191, 176, 0.15); }
.badge-neutral { background: var(--bg-alt); color: var(--text-muted); border-color: rgba(0,0,0,0.12); }
.badge-pro     { background: var(--primary); color: #fff; border-color: var(--primary-mid); }

/* ─── FORMS ─── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.form-label { font-size: 14px; font-weight: 700; color: var(--text); }
.form-input {
  width: 100% !important; height: 52px; border-radius: var(--r-lg); border: 1px solid rgba(0,0,0,0.15);
  padding: 0 16px; background: var(--bg-card); color: var(--text);
  font-family: var(--font); font-size: 15px; outline: none; transition: var(--transition);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.form-input:focus { border-color: var(--primary); border-width: 1.5px; box-shadow: 0 0 0 3px var(--primary-soft), inset 0 2px 4px rgba(0,0,0,0.01); }
.form-input::placeholder { color: var(--text-dim); font-size: 14px; }
.form-textarea { height: auto; padding: 14px 18px; resize: vertical; min-height: 120px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%2378716C' d='M5 8l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; background-size: 20px; padding-left: 42px; }
.form-hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--accent); }

/* ─── PILLS ROW ─── */
.pills-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: var(--r-full); border: 0.5px solid var(--border);
  background: var(--bg-card); cursor: pointer; transition: var(--transition);
  font-size: 13px; font-weight: 500; color: var(--text-sub);
}
.pill:hover { background: var(--bg-alt); border-color: var(--border-mid); }
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill-icon { font-size: 14px; }

/* ─── SECTION HEADER ─── */
.section-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.section-title { font-size: 18px; font-weight: 700; color: var(--text); }
.section-see-all { font-size: 13px; font-weight: 500; color: var(--primary); cursor: pointer; background: none; border: none; }
.section-see-all:hover { text-decoration: underline; }

/* ─── ALERTS / TOASTS ─── */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: var(--bg-card); border: 0.5px solid var(--border-mid); border-radius: var(--r-lg);
  padding: 14px 20px; box-shadow: var(--shadow-lg); z-index: 9999;
  font-size: 14px; font-weight: 500; color: var(--text);
  opacity: 0; transition: all 0.25s ease; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { border-right: 4px solid var(--secondary); }
.toast-error { border-right: 4px solid var(--accent); }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--bg-card); border-radius: var(--r-xxl) var(--r-xxl) 0 0;
  padding: 28px 24px 40px; width: 100%; max-width: 600px;
  transform: translateY(40px); transition: transform 0.25s ease;
  border: 1px solid rgba(0,0,0,0.18);
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}
.modal-overlay.open .modal-box { transform: translateY(0); }
.modal-handle { width: 40px; height: 4px; background: var(--border-strong); border-radius: 2px; margin: 0 auto 20px; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 20px; }
@media(min-width:600px) {
  .modal-overlay { align-items: center; }
  .modal-box { border-radius: var(--r-xxl); transform: scale(0.95); }
  .modal-overlay.open .modal-box { transform: scale(1); }
  .modal-handle { display: none; }
}

/* ─── SPINNER ─── */
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--border-mid); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 56px; margin-bottom: 14px; }
.empty-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }

/* ─── NAVBAR ─── */
.navbar {
  height: var(--nav-h); background: var(--bg-card); border-bottom: 1px solid rgba(0,0,0,0.12);
  position: sticky; top: 0; z-index: 500; box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex; align-items: center; padding: 0 32px; gap: 0;
  /* Safe area integration for navbar */
  padding-top: var(--sat);
  height: calc(var(--nav-h) + var(--sat));
}
/* Ensure logo stays on the right in both directions */
[dir="ltr"] .navbar { flex-direction: row-reverse; }

.nav-logo { display: flex; align-items: center; gap: 12px; margin-inline-start: 0; margin-inline-end: 24px; }
.nav-logo-icon { width: 38px; height: 38px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.nav-logo-text { font-family: 'Noto Kufi Arabic', sans-serif; font-weight: 800; font-size: 22px; color: var(--primary); margin-inline: 12px; }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; justify-content: flex-start; }
.nav-link { padding: 8px 16px; border-radius: var(--r-full); font-size: 14px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.nav-link:hover { color: var(--text); background: var(--bg-alt); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-post-btn { background: var(--accent); color: #fff; border-radius: var(--r-full); padding: 9px 22px; font-size: 14px; font-weight: 700; font-family: var(--font-ui); transition: var(--transition); box-shadow: 0 4px 12px rgba(138, 79, 189, 0.2); }
.nav-post-btn:hover { opacity: 0.88; }
.nav-icon-btn { width: 40px; height: 40px; border-radius: var(--r-full); background: var(--bg-alt); border: 0.5px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); font-size: 16px; position: relative; }
.nav-icon-btn:hover { background: var(--border); }
.nav-badge { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; border: 1.5px solid var(--bg-card); }

.notif-bubble {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--bg-card);
  border-left: 1px solid rgba(0,0,0,0.12); padding: 24px 12px;
  position: sticky; top: var(--nav-h);
  /* min-height keeps sticky behaviour; flex stretch fills the full parent height */
  min-height: calc(100vh - var(--nav-h));
  align-self: stretch;
  overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
}
.sidebar-section-label { font-size: 10px; font-weight: 700; color: var(--text-dim); letter-spacing: .08em; text-transform: uppercase; padding: 0 12px; margin: 14px 0 4px; }
.sidebar-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: var(--r-lg); cursor: pointer; transition: var(--transition);
  font-size: 14px; font-weight: 500; color: var(--text-muted); width: 100%; text-align: right;
}
.sidebar-item:hover { color: var(--text); background: var(--bg-alt); }
.sidebar-item.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.sidebar-item-icon { font-size: 17px; width: 24px; text-align: center; flex-shrink: 0; }
.sidebar-divider { height: 0.5px; background: var(--border); margin: 8px 0; }

/* ─── APP LAYOUT ─── */
.app-wrapper { display: flex; min-height: calc(100vh - var(--nav-h)); }
.main-area { flex: 1; min-width: 0; padding: 32px; }
.content-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.php-main { flex: 1; width: 100%; }
.main-area-full { flex: 1; min-width: 0; }

/* ─── LISTING CARD ─── */
.listing-card {
  background: var(--bg-card); border: 1px solid rgba(0,0,0,0.15); border-radius: var(--r-xl);
  overflow: hidden; cursor: pointer; transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.listing-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,0.1); border-color: rgba(0,0,0,0.22); }
.listing-card-img { width: 100%; height: 160px; object-fit: cover; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; font-size: 42px; position: relative; }
.listing-card-img img { width: 100%; height: 100%; object-fit: cover; }
.listing-card-body { padding: 14px; }
.listing-card-badges { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.listing-card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 5px; line-height: 1.4; }
.listing-card-price { font-size: 17px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.listing-card-meta { display: flex; justify-content: space-between; margin-top: 6px; }
.listing-card-meta span { font-size: 11px; color: var(--text-dim); }

/* ─── FAZ3A CARD ─── */
.faz3a-card {
  background: var(--bg-card); border: 1px solid rgba(0,0,0,0.15); border-radius: var(--r-xl);
  padding: 16px; cursor: pointer; transition: var(--transition); border-right-width: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}
.faz3a-card:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0,0,0,0.12); border-color: rgba(0,0,0,0.2); }
.faz3a-card-icon { font-size: 24px; margin-bottom: 8px; }
.faz3a-card-type { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.faz3a-card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 8px; }
.faz3a-card-meta { font-size: 11px; color: var(--text-dim); }

/* ─── MOBILE BOTTOM TAB ─── */
.mobile-tabbar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-card); border-top: 0.5px solid var(--border);
  padding: 8px 0 20px; box-shadow: 0 -4px 20px rgba(0,0,0,0.08); z-index: 500;
  /* Safe area integration */
  padding-bottom: calc(20px + var(--sab));
}
.mobile-tabbar-items { display: flex; align-items: flex-end; }
.tab-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding-top: 4px; cursor: pointer; border: none; background: transparent; transition: var(--transition);
}
.tab-btn-icon { width: 42px; height: 42px; border-radius: var(--r-full); display: flex; align-items: center; justify-content: center; font-size: 20px; transition: var(--transition); }
.tab-btn.active .tab-btn-icon { background: var(--primary-soft); }
.tab-btn.center .tab-btn-icon { width: 56px; height: 56px; background: var(--primary); box-shadow: 0 4px 14px rgba(184,134,11,0.35); margin-top: -18px; font-size: 24px; }
.tab-btn-lbl { font-size: 10px; font-weight: 500; color: var(--text-dim); }
.tab-btn.active .tab-btn-lbl { color: var(--primary); }

/* ─── HERO BANNER ─── */
.hero-banner {
  background: var(--primary-mid); border: 1px solid rgba(0,0,0,0.15); border-radius: var(--r-xxl);
  padding: 36px 40px; display: flex; align-items: center; justify-content: space-between; overflow: hidden;
  box-shadow: 0 15px 30px -10px rgba(184,134,11,0.2);
}
.hero-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--primary); background: var(--bg-card); border-radius: var(--r-full); padding: 5px 14px; margin-bottom: 14px; border: 0.5px solid var(--primary-mid); }
.hero-title { font-size: clamp(22px, 3vw, 34px); font-weight: 800; line-height: 1.3; margin-bottom: 10px; }
.hero-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 22px; }
.hero-emoji { font-size: 90px; line-height: 1; flex-shrink: 0; }

/* GUEST EXPERIENCE */
.guest-shell { display: flex; flex-direction: column; gap: 18px; max-width: 1100px; }
.guest-hero {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 20px; align-items: stretch; padding: 28px;
  background: linear-gradient(135deg, var(--bg-card), var(--primary-soft));
  border: 1px solid rgba(0,0,0,0.15); border-radius: var(--r-xxl);
  box-shadow: 0 12px 35px rgba(0,0,0,0.08);
}
.guest-hero-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.guest-badge {
  display: inline-flex; align-items: center; padding: 6px 12px; margin-bottom: 14px;
  border-radius: var(--r-full); background: var(--bg-card); border: 1px solid var(--primary-mid);
  color: var(--primary); font-size: 12px; font-weight: 700;
}
.guest-title { font-size: clamp(24px, 4vw, 36px); line-height: 1.35; margin-bottom: 10px; }
.guest-desc { color: var(--text-muted); font-size: 15px; max-width: 640px; margin-bottom: 18px; }
.guest-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.guest-preview { display: grid; gap: 12px; }
.guest-preview-card {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border-radius: var(--r-xl); background: rgba(255,255,255,0.72); border: 1px solid var(--border);
}
.php-hero-panel { padding: 32px; border-radius: 28px; background: var(--bg-card); border: 1.5px solid var(--border); box-shadow: var(--shadow); }
.guest-preview-index {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: var(--primary); color: #fff; font-weight: 800; flex-shrink: 0;
}
.guest-preview-text { font-size: 14px; color: var(--text-sub); line-height: 1.7; min-width: 0; }
.guest-note { padding: 18px 20px; background: var(--bg-card); }
.guest-note-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.guest-note-text { color: var(--text-muted); font-size: 14px; }

.guest-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 600;
  background: linear-gradient(135deg, var(--primary), #8B6000); color: #fff;
  padding: 12px 20px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; box-shadow: 0 -4px 20px rgba(0,0,0,0.2); font-family: var(--font);
}

/* DYNAMIC FORMS */
.dynamic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dynamic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dyn-pill,
.dyn-more-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-mid);
  background: var(--bg-card);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.dyn-pill:hover,
.dyn-more-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.dyn-pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.dyn-more-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

/* ─── STATS ─── */
.stat-card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: var(--r-lg); padding: 18px 16px; text-align: center; border-top-width: 3px; }
.stat-val { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.stat-lbl { font-size: 12px; color: var(--text-muted); }

/* ─── PROFILE ─── */
.avatar-circle { border-radius: var(--r-full); background: var(--primary-mid); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--primary); border: 2.5px solid var(--primary); flex-shrink: 0; }

/* ─── AUTH PAGES ─── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.auth-card { background: var(--bg-card); border-radius: var(--r-xxl) ; padding: 40px; border: 0.5px solid var(--border); box-shadow: var(--shadow-lg); width: 100%; max-width: 440px; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-icon { width: 64px; height: 64px; background: var(--primary); border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 14px; }
.auth-logo-name { font-size: 28px; font-weight: 800; color: var(--text); }
.auth-logo-tag { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ─── PHONE INPUT ─── */
.phone-input-wrap { display: flex; border: 1px solid var(--border-mid); border-radius: var(--r-md); overflow: hidden; background: var(--bg-card); }
.phone-prefix { padding: 0 16px; border-left: 1px solid var(--border-mid); background: var(--bg-alt); display: flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--text-sub); flex-shrink: 0; }
.phone-input-wrap input { flex: 1; height: 48px; border: none; background: transparent; padding: 0 14px; font-size: 18px; font-weight: 600; color: var(--text); outline: none; letter-spacing: 2px; }
.phone-input-wrap:focus-within { border-color: var(--primary); border-width: 1.5px; box-shadow: 0 0 0 3px var(--primary-soft); }

/* ─── COMMUNITY ─── */
.comm-card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: var(--r-xl); overflow: hidden; display: flex; cursor: pointer; transition: var(--transition); }
.comm-card:hover { box-shadow: var(--shadow-md); }
.comm-accent-bar { width: 5px; flex-shrink: 0; }
.comm-card-body { padding: 16px; flex: 1; }
.comm-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.comm-resp-btn { font-size: 13px; font-weight: 600; padding: 7px 18px; border-radius: var(--r-full); border: 1.5px solid; background: transparent; cursor: pointer; transition: var(--transition); }

/* ─── NOTIFICATIONS ─── */
.notif-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px 20px; border-bottom: 0.5px solid var(--border); cursor: pointer; transition: var(--transition); }
.notif-item:hover { background: var(--bg-alt); }
.notif-item.unread { background: var(--primary-soft); }
.notif-icon { width: 42px; height: 42px; border-radius: var(--r-full); background: var(--bg-alt); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; }

/* ─── STORES ─── */
.store-card { background: var(--bg-card); border: 0.5px solid var(--border); border-radius: var(--r-xl); overflow: hidden; cursor: pointer; transition: var(--transition); }
.store-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.store-cover { width: 100%; height: 120px; object-fit: cover; background: var(--primary-soft); }

/* ─── FOOTER LAYOUT FIX ─── */
.main-footer {
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  margin-top: auto; /* يدفع الفوتر للأسفل في نظام Flexbox */
  width: 100%;
  position: relative; /* يمنع التداخل مع absolute */
  bottom: auto; top: auto;
}
.store-logo-wrap { padding: 0 16px; margin-top: -28px; }
.store-logo { width: 56px; height: 56px; border-radius: var(--r-full); border: 3px solid var(--bg-card); background: var(--bg-alt); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.store-body { padding: 10px 16px 16px; }
.store-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.store-rating { font-size: 12px; color: var(--text-muted); }

/* ─── CHAT ─── */
.chat-bubble { max-width: 72%; padding: 10px 14px; border-radius: var(--r-lg); margin-bottom: 6px; }
.chat-bubble-me { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: var(--r-xs); }
.chat-bubble-them { background: var(--bg-card); color: var(--text); align-self: flex-start; border: 0.5px solid var(--border); border-bottom-left-radius: var(--r-xs); }
.chat-offer-card { border: 1px solid var(--primary-mid); border-radius: var(--r-lg); padding: 14px; background: var(--primary-soft); width: 220px; }

/* ─── PAGES VISIBILITY ─── */
.page { display: none; animation: fadeUp 0.2s ease; }
.php-hero > div { animation: none; }
.guest-banner-close {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 2;
}
.guest-banner-close:hover { background: rgba(255, 255, 255, 0.25); }
.page.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) { .sidebar { width: 220px; } }
@media (max-width: 768px) {
  .navbar { height: auto; min-height: var(--nav-h); padding: 10px 14px; gap: 10px; }
  .nav-links { display: none; }
  .nav-logo { margin-left: 0; gap: 8px; min-width: 0; }
  .nav-logo-icon { width: 34px; height: 34px; font-size: 18px; }
  .nav-logo-text { font-size: 17px; }
  .nav-right { gap: 8px; margin-right: auto; }
  .nav-post-btn { padding: 8px 14px; font-size: 12px; }
  .nav-icon-btn { width: 36px; height: 36px; font-size: 15px; }
  .sidebar { display: none; }
  .mobile-tabbar { display: block; }
  .mobile-tabbar { padding: 8px 10px calc(10px + var(--sab)); }
  .mobile-tabbar-items { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 2px; }
  .tab-btn-icon { width: 38px; height: 38px; font-size: 18px; }
  .tab-btn.center .tab-btn-icon { width: 50px; height: 50px; margin-top: -14px; font-size: 22px; }
  .tab-btn-lbl { font-size: 9px; }
  .main-area { padding: 16px; padding-bottom: 124px; }
  .main-footer { margin-bottom: 85px; padding: 18px 16px !important; }
  .hero-banner { padding: 22px 20px; flex-direction: column; align-items: flex-start; gap: 14px; }
  .hero-emoji { font-size: 58px; }
  .guest-hero { grid-template-columns: 1fr; padding: 22px 18px; }
  .guest-actions .btn { width: 100%; }
  .guest-banner {
    left: 12px; right: 12px; bottom: calc(82px + var(--sab));
    border-radius: 20px; padding: 14px;
  }
  .dynamic-grid { grid-template-columns: 1fr; gap: 12px; }
  .dyn-pill,
  .dyn-more-btn {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 12px;
  }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-auto { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 480px) {
  .navbar { padding: 10px 12px; }
  .nav-post-btn { padding: 8px 10px; font-size: 11px; }
  .nav-logo-text { font-size: 15px; }
  .hero-emoji { display: none; }
  .hero-banner { padding: 20px 18px; }
  .hero-title { font-size: 20px; }
  .guest-shell { gap: 14px; }
  .guest-title { font-size: 24px; }
  .guest-desc, .guest-preview-text, .guest-note-text { font-size: 13px; }
  .guest-banner {
    flex-direction: column; align-items: stretch; gap: 10px;
    bottom: calc(88px + var(--sab));
  }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-auto { grid-template-columns: 1fr; }
  .stats-row-mobile { grid-template-columns: repeat(2, 1fr); }
}

/* ─── HERO SLIDER ─── */
:root { --p-gold: #C9922A; --bg-hero: #0F1117; --t-gray: #9CA3AF; --bg2: var(--bg-card); }
.slider-container { position: relative; margin: 0 0 20px 0; border-radius: 20px; overflow: hidden; height: 200px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); background: var(--bg2); }
.slider-wrapper { height: 100%; width: 100%; position: relative; }
.slide { position: absolute; inset: 0; padding: 24px; display: flex; align-items: center; opacity: 0; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); transform: scale(1.02); }
.slide.active { opacity: 1; transform: scale(1); z-index: 1; }
.slide-content { position: relative; z-index: 2; width: 100%; }
.slide-badge { background: var(--p-gold); color: #fff; font-size: 10px; font-weight: 700; padding: 4px 12px; border-radius: 20px; width: fit-content; margin-bottom: 12px; text-transform: uppercase; }
.slide-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; color: #fff; line-height: 1.3; }
.slide-title span { color: var(--p-gold); }
.slide-desc { font-size: 13px; color: var(--t-gray); max-width: 85%; line-height: 1.6; margin-bottom: 18px; }
.slide-deco { position: absolute; left: 20px; bottom: 10px; font-size: 80px; opacity: 0.15; filter: grayscale(0.5); pointer-events: none; }
.slider-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 10; }
.dot { width: 8px; height: 8px; border-radius: 10px; background: rgba(255,255,255,0.3); transition: 0.3s; cursor: pointer; }
.dot.active { width: 24px; background: var(--p-gold); }
.btn-p { background: var(--p-gold, #C9922A); color: #fff; border: none; padding: 8px 20px; border-radius: 20px; font-weight: 700; cursor: pointer; font-size: 13px; transition: 0.2s; }
.btn-p:hover { opacity: 0.9; transform: translateY(-1px); }

/* New Homepage Sections */
.weather-strip { margin: 0 16px 0 16px; }
.quick-services-row { margin: -8px 16px 8px 16px; }
.main-categories-grid { margin: 0 16px 10px 16px; }
.php-main .section-hd { padding: 0 16px; }

/* Weather Strip */
.weather-strip { display: flex; align-items: center; justify-content: space-between; background: var(--bg-card); color: var(--text); border: 0.5px solid var(--border); padding: 12px 16px; border-radius: 16px; }
.w-info { display: flex; align-items: center; gap: 12px; }
.w-icon { font-size: 28px; }
.w-text { display: flex; flex-direction: column; min-width: 0; }
.w-temp { font-size: 20px; font-weight: 700; }
.w-desc { font-size: 11px; opacity: 0.7; }
.w-details { display: flex; align-items: center; gap: 12px; }
.w-item { display: flex; flex-direction: column; align-items: center; }
.w-label { font-size: 10px; opacity: 0.6; }
.w-val { font-size: 13px; font-weight: 600; }
.w-sep { width: 1px; height: 24px; background: var(--border-mid); }

/* Quick Services */
.quick-services-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.q-card { display: flex; align-items: center; gap: 14px; padding: 20px; border-radius: 16px; cursor: pointer; transition: all 0.2s ease; }
.q-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.q-icon { font-size: 28px; }
.q-txt { display: flex; flex-direction: column; min-width: 0; }
.q-txt span { font-weight: 700; font-size: 15px; }
.q-txt small { font-size: 11px; opacity: 0.8; }
.quick-services-row .faz3a-card { background: var(--bg-card); color: var(--text); border: 0.5px solid var(--border); }
.quick-services-row .blood-card { background: var(--bg-card); color: var(--text); border: 0.5px solid var(--border); }

/* Urgent Cases & Pulse */
.urgent-bg { background-color: #FEF2F2 !important; border-color: #FECACA !important; }
[data-theme="dark"] .urgent-bg { background-color: rgba(127, 29, 29, 0.2) !important; border-color: #7F1D1D !important; }

.icon-pulse { animation: icon-pulse 1.5s infinite ease-in-out; display: inline-block; }
@keyframes icon-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Main Categories */
.main-categories-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cat-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; text-align: center; cursor: pointer; transition: all 0.2s ease; }
.cat-box:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--p-gold, #C9922A); }
.cat-img { font-size: 32px; line-height: 1; }
.cat-label { font-size: 12px; font-weight: 600; color: var(--text-sub); }

@media (max-width: 768px) {
    .weather-strip { flex-direction: column; gap: 12px; align-items: stretch; }
    .main-categories-grid { gap: 10px; }
    .cat-box { padding: 12px 8px; }
    .cat-img { font-size: 28px; }
    .cat-label { font-size: 11px; }
    .php-main .section-hd, .weather-strip, .quick-services-row, .main-categories-grid { margin-left: 0; margin-right: 0; }
    #latest-listings-grid { padding: 0 !important; }
}
@media (max-width: 480px) {
    .main-categories-grid { grid-template-columns: repeat(4, 1fr); }
    .q-card { flex-direction: column; text-align: center; gap: 8px; padding: 16px 10px; }
    .q-txt span { font-size: 13px; }
}
/* أضفه في home.php داخل <style> الموجود أسفل الصفحة */

/* تغيير الـ Hero من عمودين إلى ثلاثة */
.php-hero {
  display: grid;
  grid-template-columns: 20% 30% 50%;
  gap: 12px;
  min-height: 300px;
  align-items: stretch;
}

/* قسم الإعلانات — كل شيء جديد */
.ads-panel {
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
  background: var(--bg-card);
  border: 0.5px solid var(--border-mid);
  box-shadow: var(--shadow-md);
}
.ads-header {
  position: absolute; top: 0; right: 0; left: 0;
  padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(to bottom, var(--bg-card), transparent);
  z-index: 20;
}
.ads-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--p-gold);
  background: rgba(201,146,42,0.12);
  border: 0.5px solid rgba(201,146,42,0.3);
  padding: 3px 10px; border-radius: var(--r-full);
}
.ads-counter { font-size: 9px; color: var(--text-dim); }
.ad-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.7s ease;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  padding: 48px 22px 18px;
}
.ad-slide.active { opacity: 1; }
.ad-slide--banner { padding: 0; }
.ad-slide--banner > div:first-child { border-radius: inherit; }
.ad-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9px; font-weight: 700;
  padding: 3px 10px; border-radius: var(--r-full);
  margin-bottom: 7px; width: fit-content;
}
.ab-gold  { background: var(--primary-soft); border: 0.5px solid var(--primary-mid); color: var(--primary); }
.ab-green { background: var(--secondary-soft); border: 0.5px solid rgba(82,183,136,0.3); color: var(--secondary); }
.ab-teal  { background: var(--teal-soft); border: 0.5px solid rgba(63,191,176,0.25); color: var(--teal); }
.ad-title { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.3; margin-bottom: 5px; }
.ad-sub   { font-size: 11px; color: var(--text-muted); line-height: 1.55; margin-bottom: 10px; }
.ad-price-row { display: flex; align-items: baseline; gap: 6px; margin-bottom: 12px; }
.ad-price { font-size: 24px; font-weight: 800; }
.price-gold  { color: var(--primary); }
.price-green { color: var(--secondary); }
.price-teal  { color: var(--teal); }
.ad-price-lbl { font-size: 10px; color: var(--text-dim); }
.ad-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 12px;
  padding: 9px 18px; border-radius: var(--r-full);
  width: fit-content; cursor: pointer;
  font-family: var(--font); border: none;
  transition: var(--transition);
}
.cta-gold  { background: var(--primary); color: #0E0D0B; }
.cta-green { background: var(--secondary); color: #0E0D0B; }
.cta-teal  { background: var(--teal); color: #0E0D0B; }
.ads-dots {
  position: absolute; bottom: 14px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 20;
}
.ads-dot {
  width: 8px; height: 8px; border-radius: 10px;
  background: rgba(255,255,255,0.18);
  transition: 0.3s; cursor: pointer;
}
.ads-dot.active { width: 24px; background: var(--p-gold); }

/* خلفيات الإعلانات */
/* Ad backgrounds now respect theme gradients */
.ad-1 { background: linear-gradient(155deg, var(--primary-soft) 0%, var(--bg-card) 100%); }
.ad-2 { background: linear-gradient(160deg, var(--bg-alt) 0%, var(--bg-card) 100%); }
.ad-3 { background: linear-gradient(160deg, var(--accent) 0%, var(--bg-card) 100%); }
.ad-1 .big-icon, .ad-2 .big-icon, .ad-3 .big-icon {
  position: absolute; top: 36%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 76px; opacity: 0.25; pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MOBILE-FIRST PWA ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ── 1. Classifieds / Ad Listings Grid ─────────────────────────────────────────
   Mobile-first responsive grid.  Page-level styles (home.php, market.php) may
   override column counts for specific contexts but inherit the gap and base rules.
   ─────────────────────────────────────────────────────────────────────────────── */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));   /* Mobile: 2 columns */
  gap: 10px;
}
@media (min-width: 540px) {
  .listings-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
@media (min-width: 900px) {
  .listings-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
}
@media (min-width: 1280px) {
  .listings-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 1600px) {
  .listings-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
}

/* ── 2. Ad Thumbnail Aspect Ratios (CLS Prevention) ────────────────────────────
   Explicit aspect-ratio reserves space before the image loads, eliminating
   Cumulative Layout Shift while scrolling through the feed.
   ─────────────────────────────────────────────────────────────────────────────── */
.listing-card-img,
.ad-thumb,
.card-image {
  position: relative;
  aspect-ratio: 1 / 1;          /* Square: optimal for classifieds thumbnails */
  overflow: hidden;
  background: var(--bg-alt);
  display: block;
}
.listing-card-img img,
.ad-thumb img,
.card-image > img:not(.featured-verify-badge) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 4:3 landscape variant — useful for vehicle/property listings */
.ad-thumb--landscape,
.listing-card-img--landscape {
  aspect-ratio: 4 / 3;
}
/* 16:9 variant — for store banners / featured hero images */
.ad-thumb--wide,
.listing-card-img--wide {
  aspect-ratio: 16 / 9;
}

/* ── 3. Touch Targets (Apple HIG ≥ 44×44px / WCAG 2.5.5 Enhanced) ─────────────
   Ensures every interactive element is tappable comfortably on mobile.
   Applied via utility classes so existing layout is not disturbed.
   ─────────────────────────────────────────────────────────────────────────────── */
.btn-like,
.btn-chat,
.btn-comment,
.btn-save,
.btn-share,
.btn-follow,
.action-btn,
[data-action] {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Expand the tap area without changing visual size when needed */
  position: relative;
}
/* Invisible tap-area expander for very small icon-only buttons */
.touch-target::after {
  content: '';
  position: absolute;
  inset: -8px;
}

/* ── 4. Safe Area CSS Custom Properties ─────────────────────────────────────────
   Expose safe area values as CSS variables so any component can reference them
   without duplicating env() calls.
   ─────────────────────────────────────────────────────────────────────────────── */
:root {
  --sat: env(safe-area-inset-top,    0px);
  --sar: env(safe-area-inset-right,  0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left,   0px);
}

/* ── 5. Bottom Nav / Fixed Footer Safe Area ─────────────────────────────────── */
.btm-nav,
.mobile-bottom-nav,
.bottom-tab-bar {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* ???????????????????????????????????????????????????????????????????????????????
   PROFESSIONAL APP INTERFACE (OLX/OPENSOOQ STYLE)
   ??????????????????????????????????????????????????????????????????????????????? */

/* 1. STICKY MOBILE HEADER */
@media (max-width: 768px) {
  .navbar {
    position: sticky; top: 0;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255, 0.85);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 8px 14px !important;
  }
  .mobile-search-wrapper {
    padding: 8px 16px;
    background: var(--bg-card);
    position: sticky; top: 58px; /* Below navbar */
    z-index: 490;
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }
  .mobile-search-bar {
    background: var(--bg-alt);
    border-radius: var(--r-lg);
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    color: var(--text-dim);
    font-size: 14px;
    border: 1px solid rgba(0,0,0,0.05);
  }
}

/* 2. CATEGORY APP GRID (4-COLUMNS) */
.category-app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
}
.cat-app-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-decoration: none; transition: transform 0.2s;
}
.cat-app-item:active { transform: scale(0.92); }

.cat-app-icon {
  width: 58px; height: 58px;
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
}
/* Colorful Backgrounds */
.cat-bg-1 { background: #E0F2FE; color: #0369A1; } /* Blue */
.cat-bg-2 { background: #DCFCE7; color: #15803D; } /* Green */
.cat-bg-3 { background: #FEF9C3; color: #854D0E; } /* Yellow */
.cat-bg-4 { background: #FFEDD5; color: #9A3412; } /* Orange */
.cat-bg-5 { background: #F3E8FF; color: #7E22CE; } /* Purple */
.cat-bg-6 { background: #FCE7F3; color: #BE185D; } /* Pink */
.cat-bg-7 { background: #E0E7FF; color: #4338CA; } /* Indigo */
.cat-bg-8 { background: #CCFBF1; color: #0F766E; } /* Teal */

.cat-app-label {
  font-size: 11px; font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

/* 3. BENTO LISTING FEED (2-COLUMNS) */
@media (max-width: 600px) {
  .listings-grid.app-style {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 12px;
    gap: 12px;
  }
  .listing-card.app-style {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    background: var(--bg-card);
    border-radius: var(--r-lg);
  }
  .listing-card.app-style .listing-card-img {
    height: 140px;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
}


/* 4. VISIBILITY UTILITIES */
@media (min-width: 769px) {
  .mobile-only { display: none !important; }
}
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .cats-section-container {
    padding: 12px !important;
    margin: 8px 12px 24px !important;
    border-radius: var(--r-lg) !important;
  }
}


/* 5. CENTER POST BUTTON STYLES */
.center-post-btn {
  position: relative;
  z-index: 10;
  margin-top: -30px; /* Float up */
}
.post-circle {
  width: 54px; height: 54px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 15px rgba(138, 79, 189, 0.4);
  border: 4px solid var(--bg-card);
  color: #fff;
  font-size: 28px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.center-post-btn:active .post-circle {
  transform: scale(0.9) rotate(45deg);
}
.center-post-btn .tab-btn-lbl {
  margin-top: 4px;
  font-weight: 800;
  color: var(--primary);
}


/* ─── SPONSORED STRIP (Category Aware) ─── */
.sponsored-strip-container {
  overflow-x: auto;
  padding: 4px 16px 20px;
  margin: 0 -16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sponsored-strip-container::-webkit-scrollbar { display: none; }

.sponsored-strip {
  display: flex;
  gap: 16px;
  width: max-content;
}

.sponsored-card {
  width: 280px;
  height: 140px;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  text-decoration: none !important;
}

.sponsored-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-mid);
}

.sponsored-card--banner {
  background-size: cover;
  background-position: center;
  padding: 0;
}

.sponsored-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
}

.sponsored-content {
  position: relative;
  z-index: 2;
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sponsored-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: var(--r-full);
  width: fit-content;
  margin-bottom: 8px;
  border: 0.5px solid var(--primary-mid);
}

.sponsored-card--banner .sponsored-badge {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-color: rgba(255,255,255,0.4);
  backdrop-filter: blur(4px);
}

.sponsored-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.sponsored-card--banner .sponsored-title {
  color: #fff;
}

.sponsored-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.sponsored-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

.sponsored-price small {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.8;
}

.sponsored-icon {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 48px;
  opacity: 0.12;
  pointer-events: none;
}
