/* ==========================================================================
   CAFE DIGITAL MENU - 100% MOBILE-ONLY REVERSE-ENGINEERED DESIGN
   Pure mobile website. No status-bar, no desktop frame.
   ========================================================================== */

:root {
  /* Color Palette reverse-engineered from reference */
  --bg-app: #FBF7F0;                /* Warm cream / ivory background */
  --text-espresso: #2E1E14;         /* Rich dark coffee brown */
  --text-muted: #7D6C60;            /* Warm taupe / secondary text */
  --text-light-muted: #9E8E82;
  
  --accent-coral: #C15A46;          /* Warm baked terracotta / coral */
  --accent-coral-hover: #A94A38;
  --accent-coral-light: #F6DFD9;    /* Light peach for popular badge */
  --accent-coral-text: #BA5644;     /* Dark coral for badge text */
  
  --accent-olive: #687B4E;          /* Muted sage / olive green */
  --accent-olive-dark: #58693E;     /* Darker olive for price pill */
  --bg-featured: #EEF3E6;           /* Pastel pistachio tint card */
  
  --bg-pill-inactive: #F3ECE3;      /* Cream for inactive category pills */
  --bg-card: #FFFFFF;               /* Crisp warm white card */
  --border-card: #F2ECE2;           /* Gentle border line */
  --bg-price-pill: #F5EFE6;         /* Light sand beige for price pills */

  /* Typography & Radii */
  --font-primary: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-hero: 28px;
  --radius-card: 20px;
  --radius-pill: 50px;
}

/* ==========================================================================
   RESET & PURE MOBILE BASE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-app);
  width: 100%;
  height: 100%;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-app);
  color: var(--text-espresso);
  line-height: 1.5;
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* 100% Full Screen Edge-to-Edge Experience */
.app-frame {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  margin: 0;
  box-shadow: none;
}

/* ==========================================================================
   TOP APP HEADER (Minimal Brand Center)
   ========================================================================== */
.top-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px 12px;
  position: relative;
  z-index: 10;
}

.header-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  direction: rtl;
  padding: 4px 0;
}

.brand-leaves {
  width: 52px;
  height: 42px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: none; /* Centered */
  filter: drop-shadow(0 2px 4px rgba(50, 18, 6, 0.12));
}

.brand-leaves svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-subtitle {
  font-size: 13.5px;
  font-weight: 700;
  color: #3C2014;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0;
  letter-spacing: -0.2px;
}

.sub-heart {
  width: 13px;
  height: 13px;
  color: #B75742;
  display: inline-block;
  flex-shrink: 0;
}

.sub-heart--left {
  transform: rotate(-14deg);
}

.sub-heart--right {
  transform: rotate(14deg);
}

.sub-text {
  display: inline-block;
  white-space: nowrap;
}

/* ==========================================================================
   MAIN SCROLLABLE CONTENT
   ========================================================================== */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 30px;
}

/* ==========================================================================
   HERO BANNER (Exact Visual Match to Reference Design)
   ========================================================================== */
.hero-banner {
  margin: 6px 16px 18px;
  border-radius: 26px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(46, 30, 20, 0.12);
  background-color: #2E1E14;
  aspect-ratio: 828 / 356;
  width: calc(100% - 32px);
}

.hero-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-banner-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 26px;
}

/* Tactile Clickable Hitbox over 'مشاهده منو' button in the design */
.hero-cta-hitbox {
  position: absolute;
  left: 6.4%;
  top: 68%;
  width: 24.5%;
  height: 17.4%;
  border-radius: 50px;
  cursor: pointer;
  z-index: 5;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.hero-cta-hitbox:hover {
  background-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45), 0 4px 14px rgba(185, 89, 69, 0.4);
}

.hero-cta-hitbox:active {
  transform: scale(0.95);
  background-color: rgba(255, 255, 255, 0.22);
}

.hero-cta-hitbox:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

/* Accessibility Utility for Screen Readers & SEO */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   CATEGORY NAVIGATION BAR (Left to Right: همه -> غذا)
   ========================================================================== */
.category-section {
  position: relative;
  margin-bottom: 20px;
  direction: ltr; /* Keeps: همه (Left) -> غذا (Right) */
  width: 100%;
}

.category-scroll-container {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 4px 16px 6px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.category-scroll-container::-webkit-scrollbar {
  display: none;
}

.category-track {
  display: flex;
  gap: 10px;
  width: max-content;
  padding: 2px 0;
}

.category-pill {
  border: none;
  background-color: #F6EDE3;
  color: #3C2014;
  border-radius: 24px;
  padding: 12px 14px 10px;
  min-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.category-pill:active {
  transform: scale(0.95);
}

.pill-icon-wrapper {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3C2014;
  transition: color 0.2s ease;
}

.pill-icon-wrapper svg {
  width: 28px;
  height: 28px;
}

.pill-label {
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  font-family: var(--font-primary);
  letter-spacing: -0.2px;
  transition: color 0.2s ease;
}

/* Active Category Pill (e.g. "همه") */
.category-pill.active {
  background-color: #BE735D;
  color: #FFFFFF;
  box-shadow: 0 5px 14px rgba(190, 115, 93, 0.35);
}

.category-pill.active .pill-icon-wrapper {
  color: #FFFFFF;
}

.category-pill.active .pill-label {
  color: #FFFFFF;
  font-weight: 800;
}

/* Custom Scroll Progress Track Bar */
.category-scroll-track-wrapper {
  padding: 0 16px;
  margin-top: 6px;
  width: 100%;
}

.category-scroll-track {
  width: 100%;
  height: 3.5px;
  background-color: #EFE6D9;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.category-scroll-thumb {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 54px;
  background-color: #BE735D;
  border-radius: 4px;
  transition: transform 0.06s ease-out, width 0.15s ease;
}

/* ==========================================================================
   FEATURED PRODUCT BANNER ("پیشنهاد ویژه امروز" - Exact Reference Match)
   ========================================================================== */
.featured-card-wrapper {
  padding: 0 16px;
  margin-bottom: 22px;
  width: 100%;
}

.featured-card {
  position: relative;
  width: 100%;
  aspect-ratio: 786 / 283;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(46, 30, 20, 0.08);
  border: 1px solid rgba(104, 123, 78, 0.15);
  background-color: #EFF2E6;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
}

.featured-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(46, 30, 20, 0.12);
}

.featured-card:active {
  transform: scale(0.975);
}

.featured-card-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 24px;
}

.featured-card-overlay {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  pointer-events: none;
  transition: background-color 0.15s ease;
}

.featured-card:active .featured-card-overlay {
  background-color: rgba(60, 32, 20, 0.06);
}

.featured-card:focus-visible {
  outline: 2.5px solid #687E4C;
  outline-offset: 2px;
}

/* ==========================================================================
   MENU SECTION ("منوی کافه")
   ========================================================================== */
.menu-section {
  padding: 0 16px;
  position: relative;
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* In RTL, flex-start aligns to the RIGHT */
  margin-bottom: 14px;
  direction: rtl;
}

.menu-header-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  direction: rtl;
}

.menu-header-icon {
  width: 29px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-header-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.menu-heading {
  font-family: var(--font-primary);
  font-size: 20px;
  font-weight: 800;
  color: #3C2014;
  letter-spacing: -0.3px;
  line-height: 1.2;
  margin: 0;
}

.menu-header-doodle {
  width: 13px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-header-doodle svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Product Cards List */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 3px 12px rgba(46, 30, 20, 0.04);
  border: 1px solid var(--border-card);
  position: relative;
  direction: rtl; /* Right to Left: Thumbnail on Right, Details Center, Add Button on Left */
}

.product-thumb-wrap {
  width: 86px;
  height: 74px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.product-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-details {
  flex: 1;
  min-width: 0;
  direction: rtl;
  text-align: right;
}

.product-header-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.product-name {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-espresso);
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.product-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.popular-badge {
  background-color: var(--accent-coral-light);
  color: var(--accent-coral-text);
}

.badge-heart {
  font-size: 9px;
}

.product-desc {
  font-size: 10.8px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-pill {
  background-color: var(--bg-price-pill);
  color: var(--text-espresso);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 800;
  display: inline-block;
  width: fit-content;
}



/* ==========================================================================
   CORNER DECORATIVE LAYER (Vector Animated Olive Branch & Kawaii Waving Cat)
   ========================================================================== */
.bottom-decorative-layer {
  position: relative;
  width: calc(100% + 32px);
  margin-left: -16px;
  margin-right: -16px;
  height: 18px;
  margin-top: -8px;
  pointer-events: none;
  z-index: 10;
}

/* Left Botanical Olive Branch with Breeze Sway Animation */
.deco-botanical-leaves {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 96px;
  pointer-events: none;
}

.botanical-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.04));
}

.animated-branch {
  transform-origin: 4px 125px;
  animation: plantBreeze 3.4s ease-in-out infinite alternate;
}

@keyframes plantBreeze {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(3.2deg) skewX(1deg);
  }
  100% {
    transform: rotate(-2deg) skewX(-0.8deg);
  }
}

/* Right Compact Kawaii Cat (Exact Match to Reference Photo) */
.deco-peeking-cat {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: row;
  direction: ltr; /* Text on left, cat on right */
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
  z-index: 5;
}

.cat-speech-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
  user-select: none;
  line-height: 1.3;
  direction: rtl;
}

.cat-speech-text {
  font-family: var(--font-primary);
  font-size: 13.5px;
  font-weight: 800;
  color: #5C3A21;
  white-space: nowrap;
  letter-spacing: -0.3px;
  text-shadow: 0 0 3px #FAF3EA, 0 0 6px #FFFFFF;
}

.cat-heart-svg {
  width: 15px;
  height: 15px;
  margin-top: 3px;
  animation: heartPulse 2s ease-in-out infinite;
}

@keyframes heartPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
}

.cat-peeking-svg {
  width: 86px;
  height: 104px;
  display: block;
  margin-bottom: 0;
  margin-right: -2px; /* Cat clings exactly to the right edge */
  overflow: visible;
}

/* Doodle Rays gentle twinkling animation */
.cat-ray {
  animation: catRayTwinkle 2.5s ease-in-out infinite alternate;
}

.cat-ray:nth-child(1) {
  animation-delay: 0.1s;
}
.cat-ray:nth-child(2) {
  animation-delay: 0.3s;
}
.cat-ray:nth-child(3) {
  animation-delay: 0.5s;
}

@keyframes catRayTwinkle {
  0% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
    transform: translateY(-1.5px);
  }
}

/* Curled resting paw hello/wave animation */
.cat-resting-paw {
  transform-origin: 17px 90px;
  animation: catPawGentle 2.2s ease-in-out infinite;
}

@keyframes catPawGentle {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-5deg) translateY(-1px);
  }
  50% {
    transform: rotate(3deg);
  }
  75% {
    transform: rotate(-2deg);
  }
}


/* ==========================================================================
   MOBILE BOTTOM NAVIGATION (2 Tabs: منو & اطلاعات کافه)
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background-color: #FAF4EB;
  border-top: 1px solid #ECE3D6;
  display: flex;
  flex-direction: column;
  padding: 6px 16px 4px;
  z-index: 80;
  direction: ltr; /* Keeps: Left = منو, Right = اطلاعات کافه */
  box-shadow: 0 -4px 16px rgba(46, 30, 20, 0.04);
}

.bottom-nav-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.nav-item {
  flex: 1;
  max-width: 120px;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #7D6C60;
  cursor: pointer;
  position: relative;
  padding: 4px 10px 2px;
  user-select: none;
  font-family: var(--font-primary);
  transition: color 0.2s ease;
}

.nav-icon-wrap {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7D6C60;
  transition: transform 0.2s ease, color 0.2s ease;
}

.nav-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.nav-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #7D6C60;
  letter-spacing: -0.2px;
  transition: color 0.2s ease;
}

/* Active Tab indicator with coral underline */
.nav-item.active .nav-icon-wrap {
  color: #2E1E14;
  transform: scale(1.06);
}

.nav-item.active .nav-label {
  color: #2E1E14;
  font-weight: 800;
}

.nav-active-bar {
  width: 34px;
  height: 3.5px;
  background-color: var(--accent-coral);
  border-radius: 2px;
  margin-top: 2px;
  opacity: 0;
  transform: scaleX(0.7);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.active .nav-active-bar {
  opacity: 1;
  transform: scaleX(1);
}

/* iOS Home Indicator Line */
.nav-home-indicator {
  width: 134px;
  height: 4.5px;
  background-color: #55504A;
  border-radius: 3px;
  margin: 8px auto 2px;
}

/* ==========================================================================
   EMPTY CATEGORY NOTICE
   ========================================================================== */
.empty-category-notice {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 28px 16px;
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px dashed var(--border-card);
  margin: 10px 0;
}

/* ==========================================================================
   CAFE INFO SHEET MODAL
   ========================================================================== */
.info-sheet-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.info-sheet-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(25, 15, 10, 0.5);
  backdrop-filter: blur(3px);
}

.sheet-panel {
  position: relative;
  width: 100%;
  background-color: var(--bg-app);
  border-radius: 28px 28px 0 0;
  padding: 20px 20px 36px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.25, 1, 0.5, 1);
  max-height: 82vh;
  overflow-y: auto;
}

.info-sheet-modal.active .sheet-panel {
  transform: translateY(0);
}

/* Sheet grabber */
.sheet-grabber {
  width: 38px;
  height: 4px;
  background-color: #D6C8BA;
  border-radius: 2px;
  margin: 0 auto 16px;
}

.sheet-header {
  text-align: center;
  margin-bottom: 20px;
}

.sheet-logo-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.sheet-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-espresso);
}

.sheet-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #FFFFFF;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border-card);
}

.info-icon {
  font-size: 18px;
  line-height: 1.2;
}

.info-item strong {
  font-size: 13px;
  color: var(--text-espresso);
  display: block;
  margin-bottom: 2px;
}

.info-item p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.phone-num {
  direction: ltr;
  text-align: right;
  font-weight: 700;
  color: var(--accent-coral);
}

.sheet-close-btn {
  width: 100%;
  background-color: var(--accent-coral);
  color: #FFFFFF;
  padding: 11px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.sheet-close-btn:active {
  opacity: 0.9;
}
