@font-face {
  font-family: "Vazir";
  src: url("../fonts/Vazir-Thin.woff2") format("woff2");
  font-weight: 100;
  font-style: normal;
}

@font-face {
  font-family: "Vazir";
  src: url("../fonts/Vazir-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: "Vazir";
  src: url("../fonts/Vazir.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Vazir";
  src: url("../fonts/Vazir-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: "Vazir";
  src: url("../fonts/Vazir-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
}

/* =====================
   RESET & BASE
   ===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --white:   #ffffff;
  --mid:     #5c5950;
  --warm:    #a29b89;
  --bg:      #f9f8f6;
  --card-bg: #ffffff;
  --border:  #e8e5df;
  --text-primary:   #3a3830;
  --text-secondary: #7a7468;
  --accent:  #5c5950;
  --radius:  14px;
  --shadow:  0 2px 16px rgba(92,89,80,0.08);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Vazir', system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
  direction: rtl;
}

/* =====================
   HEADER
   ===================== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 32px 24px 24px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: fadeDown 0.6s ease both;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.logo img {
  height: 65px;
}

.logo-icon {
  font-size: 28px;
  animation: spin 6s linear infinite;
}

.logo-text {
  font-size: 26px;
  font-weight: 600;
  color: var(--mid);
  letter-spacing: -0.5px;
}

.header-tagline {
  font-size: 13px;
  color: var(--warm);
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* =====================
   CATEGORY NAV
   ===================== */
.category-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 128px;
  z-index: 99;
  overflow-x: auto;
  scrollbar-width: none;
  animation: fadeDown 0.6s 0.1s ease both;
}

.category-nav::-webkit-scrollbar { display: none; }

.nav-inner {
  display: flex;
  gap: 4px;
  padding: 12px 20px;
  width: max-content;
  min-width: 100%;
  justify-content: flex-start;
}

.nav-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  padding: 7px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-btn:hover {
  border-color: var(--warm);
  color: var(--mid);
  background: rgba(162,155,137,0.08);
}

.nav-btn.active {
  background: var(--mid);
  border-color: var(--mid);
  color: var(--white);
  font-weight: 500;
}

/* =====================
   MAIN CONTENT
   ===================== */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* =====================
   LOADING
   ===================== */
.loading-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--warm);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

/* =====================
   CATEGORY SECTION
   ===================== */
.category-section {
  margin-bottom: 56px;
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.5s ease forwards;
}

.category-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--mid);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--warm);
  border-radius: 2px;
}

/* =====================
   ITEMS GRID
   ===================== */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* =====================
   MENU CARD
   ===================== */
.menu-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: default;
  position: relative;
}

.menu-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--warm);
}

.menu-card.unavailable {
  opacity: 0.45;
  pointer-events: none;
}

/* Card Image */
.card-image-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.menu-card:hover .card-image-wrap img {
  transform: scale(1.04);
}

.card-no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: var(--border);
  background: linear-gradient(135deg, #f5f3ef 0%, #ece9e2 100%);
}

/* Unavailable badge */
.unavailable-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(92,89,80,0.75);
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  backdrop-filter: blur(4px);
}

/* Card Body */
.card-body {
  padding: 14px 16px 16px;
}

.card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
  line-height: 1.4;
}

.card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.5;
  margin-bottom: 12px;
  min-height: 18px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-price {
  font-size: 14px;
  font-weight: 600;
  color: var(--mid);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-price .currency {
  font-size: 11px;
  font-weight: 400;
  color: var(--warm);
}

.card-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.card-dot.available {
  background: #8aaa85;
}

/* =====================
   FOOTER
   ===================== */
.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--warm);
  font-size: 13px;
  border-top: 1px solid var(--border);
  background: var(--white);
}

/* =====================
   ANIMATIONS
   ===================== */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 600px) {
  .site-header {
    padding: 22px 16px 16px;
    top: 0;
  }

  .logo-text { font-size: 22px; }

  .category-nav {
    top: 110px;
  }

  .items-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .main-content {
    padding: 28px 14px 50px;
  }

  .category-title {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  .items-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================
   STAGGER ANIMATION FOR CARDS
   ===================== */
.menu-card {
  opacity: 0;
  animation: fadeUp 0.4s ease forwards;
}
