/* ============================================================================
   Catalogy — customer discovery pages (home + store-type listing)
   Mobile-first, responsive, RTL-aware. Plain CSS (no build step), design
   tokens adapted from .docs/customer-pages-design/index.html.
   ========================================================================== */

:root {
  --blue: #1A6FA8;
  --blue-d: #135482;
  --blue-l: #E8F3FB;
  --blue-xl: #F0F7FF;
  --teal: #0D9E8A;
  --green: #16A34A;
  --green-l: #D1FAE5;
  --red: #DC2626;
  --red-l: #FEE2E2;
  --dark: #0F172A;
  --mid: #334155;
  --light: #94A3B8;
  --bg: #F8FAFC;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --shadow: rgba(15, 23, 42, 0.08);

  --shell: 480px;       /* mobile app frame width */
  --shell-wide: 1200px; /* desktop content width */
  --nav-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Cairo', system-ui, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
  line-height: 1.5;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ── App shell ───────────────────────────────────────────────────────────── */
.cust-app {
  max-width: var(--shell);
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 16px);
}

.cust-body { padding: 16px; }

/* ── Home hero / header ──────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--blue-d), var(--blue) 55%, var(--teal));
  color: #fff;
  padding: 32px 20px 26px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset-block-start: -80px; inset-inline-start: -80px;
  width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .06);
}
.hero__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; position: relative; z-index: 1; }
.hero__greeting { font-size: 13px; color: rgba(255, 255, 255, .75); }
.hero__name { font-size: 20px; font-weight: 900; margin-top: 2px; }
.hero__notif {
  width: 40px; height: 40px; border: none; cursor: pointer; color: #fff;
  background: rgba(255, 255, 255, .14); border-radius: 12px; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
}

.search { position: relative; z-index: 1; }
.search input {
  width: 100%; font-family: inherit; font-size: 14px; color: #fff;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 14px; padding: 12px 44px 12px 16px; outline: none;
}
.search input::placeholder { color: rgba(255, 255, 255, .65); }
.search__icon { position: absolute; inset-inline-end: 14px; inset-block-start: 50%; transform: translateY(-50%); font-size: 17px; pointer-events: none; }
.search__btn { display: none; }

/* ── Filters (chips + open toggle) ───────────────────────────────────────── */
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 0 8px; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; white-space: nowrap; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 700; color: var(--mid); background: var(--white);
  border: 1.5px solid var(--border); border-radius: 20px; padding: 7px 14px; transition: .15s;
}
.chip:hover { border-color: var(--blue); }
.chip.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip--clear { color: var(--red); border-color: var(--red-l); }

/* ── Section titles ──────────────────────────────────────────────────────── */
.sec-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 900; color: var(--dark); margin: 18px 0 12px;
}
.sec-more { font-size: 12px; font-weight: 700; color: var(--blue); }

/* ── Open-now horizontal rail ────────────────────────────────────────────── */
.rail { overflow-x: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail__track { display: flex; gap: 12px; padding-bottom: 4px; }
.rail__track .r-card { flex: 0 0 220px; }

/* ── Restaurant card ─────────────────────────────────────────────────────── */
.r-grid { display: flex; flex-direction: column; gap: 12px; }

.r-card {
  display: flex; gap: 0; overflow: hidden; cursor: pointer; background: var(--white);
  border: 1.5px solid var(--border); border-radius: 16px;
  box-shadow: 0 2px 6px var(--shadow); transition: transform .15s, box-shadow .15s;
}
.r-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px var(--shadow); }
.r-card.is-closed { opacity: .85; }

.r-card__img {
  flex: 0 0 92px; width: 92px; height: 92px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue-l), var(--blue-xl));
  font-size: 30px; font-weight: 900; color: var(--blue-d); overflow: hidden;
}
.r-card__img img { width: 100%; height: 100%; object-fit: cover; }

.r-card__body { flex: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; justify-content: space-between; }
.r-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
/* Let the title column shrink so a long name ellipsis-clips instead of pushing
   the status badge outside the card. */
.r-card__titles { min-width: 0; }
.r-card__name { display: block; font-size: 14px; font-weight: 800; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-card__meta { display: block; font-size: 11px; color: var(--light); margin-top: 2px; }
.r-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.r-card__delivery { font-size: 11px; font-weight: 600; color: var(--mid); }

/* rail variant: image on top for a more app-like card */
.rail__track .r-card { flex-direction: column; }
.rail__track .r-card__img { width: 100%; height: 104px; flex-basis: 104px; }

/* ── Status badge ────────────────────────────────────────────────────────── */
.status { flex-shrink: 0; font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.status.is-open { background: var(--green-l); color: var(--green); }
.status.is-closed { background: var(--red-l); color: var(--red); }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 56px 20px; color: var(--light); }
.empty span { font-size: 46px; display: block; margin-bottom: 12px; }
.empty p { font-size: 15px; font-weight: 700; color: var(--mid); }

/* ── Pager ───────────────────────────────────────────────────────────────── */
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 26px; }
.pager a, .pager span { font-weight: 800; }
.pager__btn {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
  border-radius: 12px; border: 1.5px solid var(--border); background: var(--white); color: var(--blue-d); font-size: 16px;
}
.pager__btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.pager__meta { font-size: 13px; color: var(--mid); }

/* ── Bottom nav ──────────────────────────────────────────────────────────── */
.bnav {
  position: fixed; inset-block-end: 0; inset-inline-start: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--shell); height: var(--nav-h); background: var(--white);
  border-top: 1px solid var(--border); box-shadow: 0 -4px 16px var(--shadow);
  display: flex; z-index: 200;
}
[dir="rtl"] .bnav { transform: translateX(50%); }
.bnav__btn {
  flex: 1; border: none; background: none; cursor: pointer; color: var(--light);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-family: inherit; padding-bottom: 4px;
}
.bnav__icon { font-size: 21px; line-height: 1; }
.bnav__label { font-size: 10px; font-weight: 700; }
.bnav__btn.is-active { color: var(--blue); }
.bnav__btn.is-active .bnav__icon { transform: translateY(-2px); }

/* ── Responsive: tablet & desktop ────────────────────────────────────────── */
@media (min-width: 700px) {
  :root { --shell: var(--shell-wide); }

  .cust-app { padding-bottom: 40px; }
  .cust-body { padding: 24px 28px; }

  .hero { padding: 40px 32px 34px; border-radius: 0 0 24px 24px; }
  .hero__inner, .cust-body > * { max-width: var(--shell-wide); margin-inline: auto; }
  .search input { max-width: 620px; }

  /* cards become a responsive grid on wide screens */
  .r-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

  /* bottom nav becomes a top-anchored, centered bar that no longer floats full width */
  .bnav {
    inset-block-end: 24px; width: auto; max-width: none; border: 1px solid var(--border);
    border-radius: 999px; height: 56px; padding: 0 8px; box-shadow: 0 10px 30px var(--shadow);
  }
  [dir="rtl"] .bnav { transform: translateX(50%); }
  .bnav__btn { flex: 0 0 auto; flex-direction: row; gap: 8px; padding: 0 18px; }
  .bnav__label { font-size: 13px; }
}

@media (min-width: 1024px) {
  .r-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── RTL niceties ────────────────────────────────────────────────────────── */
[dir="rtl"] .r-card__name { text-align: right; }

/* ── Header account control (017) ────────────────────────────────────────── */
.hero__actions { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.hero__acct {
  font-family: inherit; font-size: 13px; font-weight: 700; color: #fff; cursor: pointer;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 12px; padding: 9px 14px; line-height: 1;
}

/* ── Customer login page (017) ───────────────────────────────────────────── */
.auth { padding: 24px 16px 40px; }
.auth__card {
  background: var(--white); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: 0 6px 24px var(--shadow); padding: 28px 22px; max-width: 420px; margin: 0 auto;
}
.auth__title { font-size: 22px; font-weight: 900; color: var(--dark); }
.auth__subtitle { font-size: 14px; color: var(--mid); margin-top: 6px; margin-bottom: 20px; }
.auth__error {
  background: var(--red-l); color: var(--red); border-radius: 12px;
  padding: 10px 14px; font-size: 13px; font-weight: 600; margin-bottom: 16px;
}
.auth__field { margin-bottom: 16px; }
.auth__field label { display: block; font-size: 13px; font-weight: 700; color: var(--mid); margin-bottom: 6px; }
.auth__input {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--dark);
  background: var(--bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; outline: none;
}
.auth__input:focus { border-color: var(--blue); background: var(--white); }
.auth__remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mid); margin-bottom: 20px; cursor: pointer; }
.auth__submit {
  width: 100%; font-family: inherit; font-size: 15px; font-weight: 800; color: #fff; cursor: pointer;
  background: var(--blue); border: none; border-radius: 14px; padding: 13px 16px;
}
.auth__submit:hover { background: var(--blue-d); }
.auth__forgot { display: block; text-align: center; margin-top: 16px; font-size: 13px; color: var(--blue); }
