:root {
  --color-primary: #00bfa6;
  --color-primary-dark: #008c7a;
  --color-primary-light: #e0f7f5;
  --color-bg: #fafafa;
  --color-star: #F5B800;
  --color-open: #22c55e;
  --color-text: #2c2c2c;
  --color-text-muted: #9ca3af;
  --color-card-shadow: 0 2px 12px rgba(0, 191, 166, 0.08);
}

* {
  box-sizing: border-box;
}

body.app-mobile {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: var(--color-bg);
  margin: 0;
  min-height: 100vh;
  direction: rtl;
}

.app-shell {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--color-bg);
  position: relative;
  padding-bottom: 88px;
}

.app-shell__inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-header__side {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 72px;
}

.app-header__side--left {
  justify-content: flex-start;
}

.app-header__side--right {
  justify-content: flex-end;
}

.app-header__center {
  flex: 1;
  text-align: center;
}

.app-header__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  line-height: 1.35;
}

@media (min-width: 400px) {
  .app-header__title {
    font-size: 15px;
  }
}

.app-header__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-open);
  margin-top: 4px;
}

.app-header__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-open);
}

.app-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary-light);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.app-icon-btn i {
  font-size: 20px;
  line-height: 1;
}

.app-icon-btn--accent {
  color: var(--color-primary);
}

/* Search */
.app-search-wrap {
  padding: 0 16px 12px;
  background: #fff;
}

.app-search {
  position: relative;
  width: 100%;
}

.app-search input {
  width: 100%;
  padding: 12px 44px 12px 16px;
  border: none;
  border-radius: 14px;
  background: #f0eeec;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text);
  outline: none;
}

.app-search input::placeholder {
  color: #a8a29e;
}

.app-search__icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #a8a29e;
  pointer-events: none;
}

/* Section title */
.app-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  text-align: right;
  padding: 16px 16px 10px;
  margin: 0;
}

/* Carousel */
.app-carousel-wrap {
  padding: 0 0 8px;
}

.app-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0 16px 8px;
  -webkit-overflow-scrolling: touch;
}

.app-carousel-card {
  flex: 0 0 320px;
  width: 320px;
  height: 160px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--color-card-shadow);
  scroll-snap-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.app-carousel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-carousel-card__placeholder {
  width: 100%;
  height: 100%;
  background: #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
}

.app-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 4px;
}

.app-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4d4d4;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.app-dot--active {
  background: var(--color-primary);
  width: 20px;
  border-radius: 4px;
}

/* Category tabs */
.app-categories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 16px 16px;
  -webkit-overflow-scrolling: touch;
}

.app-category-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 24px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.app-category-tab--active {
  background: var(--color-primary);
  color: #fff;
}

/* Product grid */
.app-products {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 16px;
}

.app-product-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--color-card-shadow);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: none;
}

.app-product-card__image-wrap {
  position: relative;
  aspect-ratio: 1;
  background: #e8e8e8;
}

.app-product-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-product-card__no-image {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ebebeb;
  color: #b0b0b0;
}

.app-product-card__no-image svg {
  width: 36px;
  height: 36px;
  opacity: 0.5;
}

.app-product-card__tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #9ca3af;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
}

.app-product-card__heart {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-primary);
  padding: 0;
}

.app-product-card__body {
  padding: 10px 10px 12px;
  position: relative;
}

.app-product-card__price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.app-product-card__price {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
}

.app-product-card__rating {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--color-text-muted);
}

.app-product-card__rating i,
.app-product-card__rating svg {
  color: var(--color-star);
  font-size: 11px;
}

.app-product-card__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
  line-height: 1.4;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.app-product-card__cafe {
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: right;
  margin: 0;
}

.app-product-card__add {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 191, 166, 0.35);
  padding: 0;
}

/* Drawer menu */
.app-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  visibility: hidden;
}
.app-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}
.app-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.3s;
}
.app-drawer.is-open .app-drawer__backdrop {
  opacity: 1;
}
.app-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(300px, 85vw);
  height: 100%;
  background: #fff;
  padding: 20px 16px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
}
.app-drawer.is-open .app-drawer__panel {
  transform: translateX(0);
}
.app-drawer__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--color-text);
}
.app-drawer__link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: none;
  border-radius: 12px;
  background: #f5f5f5;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: right;
  color: var(--color-text);
}
.app-drawer__link:hover {
  background: var(--color-primary-light);
}

.app-drawer__panel--info {
  width: min(340px, 90vw);
  padding-top: 56px;
}

.app-drawer__close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #f3f4f6;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-drawer__brand {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.app-drawer__logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 12px;
  display: block;
}

.app-drawer__desc {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-top: 8px;
}

.app-drawer__info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.app-drawer__info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f7f7;
  color: var(--color-text);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.5;
}

.app-drawer__info-row i {
  color: var(--color-primary);
  margin-top: 3px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.app-drawer__info-row--status i {
  color: var(--color-open);
  font-size: 10px;
}

.app-drawer__info-row--status.is-closed i {
  color: #ef4444;
}

.app-header__status--closed .app-header__dot {
  background: #ef4444;
}

.app-carousel-card__link {
  display: block;
  width: 100%;
  height: 100%;
}

.app-bottom-nav__inner {
  max-width: 400px;
  margin: 0 auto;
}

/* Add to cart toast */
#add-to-cart-popup {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 150;
  width: calc(100% - 32px);
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  transform: translateX(-50%) translateY(-150%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease, visibility 0.35s;
}
#add-to-cart-popup.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.toast-popup__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast-popup__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.btn-app {
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-app:active {
  transform: scale(0.98);
}
.btn-app--primary {
  flex: 1;
  padding: 11px 16px;
  background: var(--color-primary);
  color: #fff;
  font-size: 14px;
}
.btn-app--ghost {
  padding: 11px 16px;
  background: #f0f0f0;
  color: #666;
  font-size: 14px;
}

/* Bottom nav */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.04);
}
.app-bottom-nav__inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.app-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  color: #9ca3af;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.2s;
  position: relative;
}

.app-nav-item i {
  font-size: 22px;
  line-height: 1;
}

.app-nav-item--active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.app-nav-item--pay {
  color: #fff;
  background: var(--color-primary);
}
.app-nav-item--pay span {
  color: #fff;
}

.app-nav-item__badge {
  position: absolute;
  top: 2px;
  left: 50%;
  margin-left: 8px;
  background: var(--color-primary);
  color: #fff;
  font-size: 9px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Utilities (no Tailwind build) */
.translate-x-full {
  transform: translateX(100%);
}
.invisible {
  visibility: hidden;
}
.opacity-0 {
  opacity: 0;
}
.hidden {
  display: none !important;
}
.fixed {
  position: fixed;
}
.inset-0 {
  inset: 0;
}
.top-0 {
  top: 0;
}
.right-0 {
  right: 0;
}
.h-full {
  height: 100%;
}
.w-full {
  width: 100%;
}
.z-\[105\] {
  z-index: 105;
}
.z-\[110\] {
  z-index: 110;
}
.z-\[120\] {
  z-index: 120;
}
.z-\[130\] {
  z-index: 130;
}
.transition-transform {
  transition-property: transform;
}
.transition-all {
  transition-property: all;
}
.duration-300 {
  transition-duration: 300ms;
}
.duration-500 {
  transition-duration: 500ms;
}
.overflow-y-auto {
  overflow-y: auto;
}
.shadow-xl {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}
.bg-white {
  background: #fff;
}
.bg-black\/40 {
  background: rgba(0, 0, 0, 0.4);
}
.scale-95 {
  transform: scale(0.95);
}
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-center {
  justify-content: center;
}
.items-end {
  align-items: flex-end;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-3 {
  gap: 0.75rem;
}
.p-4 {
  padding: 1rem;
}
.p-5 {
  padding: 1.25rem;
}
.border-b {
  border-bottom: 1px solid #f3f4f6;
}
.border-t {
  border-top: 1px solid #f3f4f6;
}
.border-gray-100 {
  border-color: #f3f4f6;
}
.text-lg {
  font-size: 1.125rem;
}
.text-xl {
  font-size: 1.25rem;
}
.text-2xl {
  font-size: 1.5rem;
}
.text-sm {
  font-size: 0.875rem;
}
.text-xs {
  font-size: 0.75rem;
}
.font-bold {
  font-weight: 700;
}
.text-gray-400 {
  color: #9ca3af;
}
.text-gray-500 {
  color: #6b7280;
}
.text-gray-600 {
  color: #4b5563;
}
.text-\[\#2c2c2c\] {
  color: #2c2c2c;
}
.text-right {
  text-align: right;
}
.rounded-xl {
  border-radius: 0.75rem;
}
.rounded-2xl {
  border-radius: 1rem;
}
.rounded-t-2xl {
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
}
.rounded-full {
  border-radius: 9999px;
}
.object-cover {
  object-fit: cover;
}
.w-5 {
  width: 1.25rem;
}
.h-5 {
  height: 1.25rem;
}
.w-10 {
  width: 2.5rem;
}
.h-10 {
  height: 2.5rem;
}
.w-14 {
  width: 3.5rem;
}
.h-14 {
  height: 3.5rem;
}
.w-56 {
  width: 14rem;
}
.h-56 {
  height: 14rem;
}
.h-7 {
  height: 1.75rem;
}
.w-7 {
  width: 1.75rem;
}
.flex-1 {
  flex: 1;
}
.min-w-0 {
  min-width: 0;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.whitespace-pre-line {
  white-space: pre-line;
}
.leading-relaxed {
  line-height: 1.625;
}
.block {
  display: block;
}
.max-w-\[430px\] {
  max-width: 430px;
}
.max-h-\[90vh\] {
  max-height: 90vh;
}
.bg-gray-100 {
  background: #f3f4f6;
}
.bg-gray-200 {
  background: #e5e7eb;
}
.shadow-2xl {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.top-4 {
  top: 1rem;
}
.bottom-24 {
  bottom: 6rem;
}
.left-1\/2 {
  left: 50%;
}
.-translate-x-1\/2 {
  transform: translateX(-50%);
}
.max-w-\[398px\] {
  max-width: 398px;
}

/* Desktop */
@media (min-width: 768px) {
  .app-products {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 0 24px 24px;
  }
  .app-section-title,
  .app-search-wrap,
  .app-categories {
    padding-left: 24px;
    padding-right: 24px;
  }
  .app-carousel {
    padding: 0 24px 8px;
  }
  .app-carousel-card {
    flex: 0 0 380px;
    width: 380px;
    height: 200px;
  }
  .app-header {
    padding: 16px 24px;
  }
}

@media (min-width: 1024px) {
  .app-products {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

@media (min-width: 1280px) {
  .app-products {
    grid-template-columns: repeat(5, 1fr);
  }
}

.app-loading {
  text-align: center;
  padding: 32px;
  color: var(--color-text-muted);
  grid-column: 1 / -1;
}

.app-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--color-text-muted);
  grid-column: 1 / -1;
}

/* Modal & cart — primary green */
.btn-primary,
.app-product-card__add {
  background: var(--color-primary) !important;
}

.text-primary,
.app-product-card__price {
  color: var(--color-primary) !important;
}

.bg-primary {
  background-color: var(--color-primary) !important;
}

#cart-count {
  background: var(--color-primary) !important;
}

/* Cart page (shopping_cart_interface.php) */
body.cart-page {
  padding-bottom: 88px;
}

.cart-page__container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .cart-page__container {
    padding: 0 24px;
  }
}

.cart-page__paybar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: center;
}

.cart-page__paybtn {
  width: 100%;
  max-width: 1280px;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 191, 166, 0.35);
}

.cart-page__paybtn:active {
  transform: scale(0.99);
}

.cart-page .btn-primary,
.cart-page button[type="submit"].btn-primary {
  border: none;
  box-shadow: none;
}

.cart-page #wooden-tray-option {
  border-width: 1px;
}

/* Product detail modal */
.item-modal__media {
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  min-height: 180px;
  max-height: min(58vh, 520px);
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

.item-modal__image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(54vh, 480px);
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.item-modal__body {
  padding: 20px;
}

.item-modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: right;
  margin: 0 0 6px;
  line-height: 1.4;
}

.item-modal__cafe {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: right;
  margin: 0 0 12px;
}

.item-modal__price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.item-modal__price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.item-modal__price-unit {
  font-size: 14px;
  color: var(--color-text-muted);
}

.item-modal__description {
  font-size: 14px;
  line-height: 1.85;
  color: #4b5563;
  text-align: right;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: visible;
  max-height: none;
  margin: 0 0 20px;
  -webkit-line-clamp: unset;
  display: block;
}
