/* =========================================================
   Rayan Coffee — Digital Menu
   Design tokens (from brief):
   - Dark coffee-bar surfaces, warm gold accent, soft glass cards.
   - Type: Vazirmatn across the page — a single well-crafted Persian
     variable font gives every weight we need (light body copy through
     the heavy display weight for the hero) without stitching together
     mismatched Farsi faces.
   - Signature element: a thin gold "pour ring" glow — echoing the
     circular latte-art mark in the Rayan logo — placed behind the
     hero logo and repeated softly behind category art.
   ========================================================= */

:root {
  --bg: #100c0a;
  --bg-alt: #17110d;
  --coffee-dark: #1c140f;

  --text: #f3e9da;
  --text-muted: rgba(243, 233, 218, 0.55);

  --gold: #c9a24d;
  --gold-hover: rgba(201, 162, 77, 0.6);
  --gold-border: rgba(201, 162, 77, 0.35);
  --gold-shadow: rgba(201, 162, 77, 0.4);

  --card-bg: rgba(255, 255, 255, 0.035);
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.16);
  --blur: 14px;

  --loader-track: rgba(255, 255, 255, 0.15);
  --divider: rgba(255, 255, 255, 0.08);

  --header-h: 3.75rem;
  --nav-h: 3.25rem;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", "Tahoma", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

ul { list-style: none; margin: 0; padding: 0; }

button {
  font-family: inherit;
  cursor: pointer;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 1rem;
}

/* ---------------------------------------------------------
   Loading screen
   --------------------------------------------------------- */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader__logo {
  width: 110px;
  animation: loader-pulse 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 22px var(--gold-shadow));
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes loader-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.75; }
}

@media (prefers-reduced-motion: reduce) {
  .loader__logo { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------
   Header
   --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(16, 12, 10, 0.85);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--divider);
}

.site-header__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  height: var(--header-h);
  padding: 0 0.75rem;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: auto;
  height: auto;
  padding: 0.25rem 0.15rem;
  order: -1;
}
.menu-toggle__icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu-toggle__icon span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}
.menu-toggle__label {
  font-size: 0.58rem;
  line-height: 1;
  color: var(--text-muted);
  white-space: nowrap;
}

.site-header__logo img {
  height: 32px;
  width: auto;
}

.site-header__search {
  position: relative;
  min-width: 0;
}
.site-header__search input {
  width: 100%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.5rem 2.25rem 0.5rem 0.9rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
}
.site-header__search input::placeholder { color: var(--text-muted); }
.site-header__search input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.site-header__search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.site-header__brand {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  color: var(--gold);
  display: none;
}

.head-nav {
  border-top: 1px solid var(--divider);
  overflow-x: auto;
  scrollbar-width: none;
}
.head-nav::-webkit-scrollbar { display: none; }

.head-nav__list {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  height: var(--nav-h);
  align-items: center;
}

.head-nav__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid transparent;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.head-nav__item.is-active,
.head-nav__item:hover {
  border-color: var(--gold-border);
  color: var(--gold);
  background: rgba(201, 162, 77, 0.08);
}
.head-nav__logo {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

/* ---------------------------------------------------------
   Sidebar (mobile drawer, opens from the LEFT)
   --------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(78vw, 320px);
  background: var(--bg-alt);
  border-left: 1px solid var(--divider);
  z-index: 101;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
.sidebar.is-open { transform: translateX(0); }

.sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--divider);
  font-weight: 700;
  color: var(--gold);
}

.sidebar__scroll {
  overflow-y: auto;
  padding: 0.5rem 0;
  flex: 1;
}

.sidebar__link {
  display: block;
  padding: 0.75rem 1.1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  border-bottom: 1px solid var(--divider);
}
.sidebar__link.is-active,
.sidebar__link:hover {
  color: var(--gold);
  background: rgba(201, 162, 77, 0.06);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.sidebar-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 88vh;
  min-height: 88svh; /* mobile browsers: tracks the actual visible viewport
                        (vh alone can be computed against the browser's
                        address bar collapsed state, rendering taller than
                        what's really on screen and hiding the events
                        section below the fold) */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 2.5rem 1.25rem;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 12, 10, 0.5), rgba(16, 12, 10, 0.9));
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 30rem;
}

.hero__logo {
  width: 88px;
  margin: 0 auto 1.25rem;
  filter: drop-shadow(0 0 30px var(--gold-shadow));
}

.hero__title {
  font-size: 1.9rem;
  font-weight: 800;
  margin: 0 0 0.4rem;
}

.hero__subtitle {
  color: var(--text-muted);
  margin: 0 0 2rem;
  font-size: 0.95rem;
}

.hero__categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

.hero-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.hero-card:hover,
.hero-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--gold-border);
  box-shadow: 0 10px 30px -12px var(--gold-shadow);
}

.hero-card__logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--gold-border), 0 0 18px var(--gold-shadow);
}
.hero-card__logo--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--coffee-dark);
  color: var(--gold);
  font-weight: 700;
}

.hero-card__name {
  font-size: 0.95rem;
  font-weight: 600;
}

/* ---------------------------------------------------------
   Events strip
   --------------------------------------------------------- */
.hero__events {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hero__event {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ---------------------------------------------------------
   Menu page
   --------------------------------------------------------- */
.menu-page {
  padding: 1.25rem 1rem 3rem;
  max-width: 48rem;
  margin: 0 auto;
}

.menu-page__title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0.25rem 0 1.5rem;
}

.category-block {
  margin-bottom: 2rem;
  scroll-margin-top: calc(var(--header-h) + var(--nav-h) + 0.75rem);
}

.category-block__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--divider);
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.item-row {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.7rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.item-row:hover,
.item-row:focus-visible {
  border-color: var(--gold-border);
  background: rgba(201, 162, 77, 0.05);
}

.item-row__image {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--coffee-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px var(--gold-border);
}
.item-row__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.item-row__image-placeholder {
  color: var(--gold);
  font-weight: 700;
}

.item-row__body {
  flex: 1;
  min-width: 0;
}

.item-row__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.item-row__name {
  font-weight: 700;
  font-size: 0.98rem;
}

.item-row__price {
  color: var(--gold);
  font-size: 0.85rem;
  white-space: nowrap;
}

.item-row__ingredients {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Item detail page
   --------------------------------------------------------- */
.breadcrumb {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 1rem 1rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 40rem;
  margin: 0 auto;
}
.breadcrumb a:hover { color: var(--gold); }

.item-detail {
  max-width: 40rem;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.item-detail__image {
  position: relative;
  margin: 1rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--coffee-dark);
  box-shadow: 0 0 0 1px var(--gold-border);
}
.item-detail__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.item-detail__image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
}

.badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(16, 12, 10, 0.85);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.item-detail__body {
  padding: 0 1.25rem;
}

.item-detail__name {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
}

.item-detail__price {
  color: var(--gold);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
}

.item-detail__ingredients h2 {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0 0 0.6rem;
}
.item-detail__ingredients ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.item-detail__ingredients li {
  background: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  color: var(--text);
}

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.25rem 3rem;
  border-top: 1px solid var(--divider);
  background: var(--bg-alt);
}
.site-footer__logo {
  width: 56px;
  margin: 0 auto 1rem;
  opacity: 0.9;
}
.site-footer__title {
  font-weight: 700;
  margin: 0;
}
.site-footer__subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0.15rem 0 1rem;
  direction: ltr;
}
.site-footer__address {
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}
.site-footer__phone {
  display: inline-block;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 1rem;
  direction: ltr;
}
.site-footer__instagram {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
.site-footer__instagram:hover { color: var(--gold); }
.site-footer__copy {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin: 0;
}
.site-footer__copy2 {
  color: var(--gold);
  font-size: 0.72rem;
  margin: 0;
}

/* ---------------------------------------------------------
   Breakpoints — tablet / desktop refinements
   --------------------------------------------------------- */
@media (min-width: 768px) {
  .site-header__brand { display: block; }
  .hero__categories { grid-template-columns: repeat(3, 1fr); }
  .item-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
  .item-detail__image { margin: 1.5rem 0 1.5rem 1.5rem; aspect-ratio: 1; }
  .item-detail__body { padding: 1.5rem 1.5rem 0 0; }
  .breadcrumb { padding-top: 1.5rem; }
}

@media (min-width: 1024px) {
  .site-header__row { padding: 0 2rem; }
  .head-nav__list { padding: 0.6rem 2rem; }
  .menu-page { padding-top: 2rem; }
  .hero__categories { grid-template-columns: repeat(4, 1fr); }
  .sidebar { border-left: 1px solid var(--divider); }
}
