:root {
  --header-h: 56px;
  --nav-h: 64px;
  --cart-h: 54px;
}

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

html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: #FAF6F1;
  color: #2C1810;
}

::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(250, 246, 241, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid #EDE5DA;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.custom-icon {
  width: 24px; 
  height: 24px;
  object-fit: contain;
}

.app-content {
  position: fixed;
  top: var(--header-h);
  bottom: var(--nav-h);
  left: 0;
  right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.app-content.has-cart {
  bottom: calc(var(--nav-h) + var(--cart-h));
}

/* Pages Transition */
.page {
  display: none;
  min-height: 100%;
}

.page.active {
  display: block;
  animation: pi 0.25s ease;
}

@keyframes pi {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.banner {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  margin: 16px;
  background: #2C1810;
}

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

.banner-content {
  position: relative;
  z-index: 20;
}

.banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
  margin-bottom: 8px;
}

.cat-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px;
  scroll-snap-type: x mandatory;
}

.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 68px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform 0.2s;
}

.cat-item:active {
  transform: scale(0.93);
}

.cat-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.25s;
  background: #fff;
  border: 2px solid #EDE5DA;
  color: #7A6B5D;
}

.cat-item.active .cat-icon {
  background: #D4621A;
  border-color: #D4621A;
  color: #fff;
  box-shadow: 0 4px 12px rgba(212, 98, 26, 0.3);
}

.cat-item span {
  font-size: 11px;
  color: #7A6B5D;
  font-weight: 500;
  white-space: nowrap;
}

.cat-item.active span {
  color: #D4621A;
  font-weight: 600;
}

.menu-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #F3ECE4;
  transition: background 0.15s;
  cursor: pointer;
}

.menu-card:active {
  background: #F9F3EC;
}

.menu-card:last-child {
  border-bottom: none;
}

.menu-img {
  width: 90px;
  height: 90px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: #EDE5DA;
}

.menu-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.menu-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-desc {
  font-size: 12px;
  color: #7A6B5D;
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.menu-price {
  font-size: 14px;
  font-weight: 700;
  color: #D4621A;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.menu-price .original {
  font-size: 11px;
  font-weight: 500;
  color: #B5A899;
  text-decoration: line-through;
}

.menu-price .promo {
  color: #C0392B;
}

.badge-tag {
  display: inline-flex;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 3px;
  width: fit-content;
  align-items: center;
  gap: 2px;
}

.badge-best { background: #FFF3E8; color: #D4621A; }
.badge-new { background: #ECFEFF; color: #0891B2; }
.badge-recommend { background: #F5F3FF; color: #7C3AED; }
.badge-promo { background: #FEF2F2; color: #C0392B; }

.btn-add {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: #D4621A;
  color: #fff;
  font-size: 18px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.btn-add:active {
  transform: scale(0.88);
  box-shadow: 0 2px 8px rgba(212, 98, 26, 0.4);
}

.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  background: #D4621A;
  border-radius: 10px;
  overflow: hidden;
  height: 32px;
}

.qty-btn {
  width: 28px;
  height: 32px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.qty-btn:active {
  background: rgba(0, 0, 0, 0.15);
}

.qty-val {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.search-box {
  width: 100%;
}

.chip-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  border: 1.5px solid #EDE5DA;
  background: #fff;
  color: #7A6B5D;
}

.chip.active {
  background: #D4621A;
  border-color: #D4621A;
  color: #fff;
}

.chip:active {
  transform: scale(0.95);
}

.toast-container {
  position: fixed;
  top: 70px;
  left: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #2C1810;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: ti 0.3s ease, to 0.3s ease 1.8s forwards;
  box-shadow: 0 4px 16px rgba(44, 24, 16, 0.3);
  pointer-events: auto;
}

.toast.success { background: #2D8B4E; }
.toast.error { background: #C0392B; }

@keyframes ti {
  from { opacity: 0; transform: translateY(-16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes to {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-16px); }
}

.info-card {
  background: #fff;
  border-radius: 16px;
  margin: 0 16px 12px;
  padding: 16px;
  border: 1px solid #EDE5DA;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #F3ECE4;
  font-size: 13px;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row i {
  color: #D4621A;
  width: 18px;
  text-align: center;
  margin-top: 2px;
}

.review-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #EDE5DA;
  margin-bottom: 10px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  padding: 16px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title a {
  font-size: 13px;
  color: #D4621A;
  font-weight: 600;
  text-decoration: none;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  text-align: center;
}

.empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #FFF3E8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #D4621A;
  margin-bottom: 16px;
}

.stat-box {
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  background: #FFF3E8;
}

.stat-num {
  font-size: 20px;
  font-weight: 800;
  color: #D4621A;
  font-family: 'Playfair Display', serif;
}

.stat-label {
  font-size: 10px;
  color: #7A6B5D;
  margin-top: 2px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #EDE5DA;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: #2C1810;
}

.social-link:active {
  transform: scale(0.98);
  background: #FFF3E8;
}

.social-link.hidden {
  display: none;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.float-anim {
  animation: float 3s ease-in-out infinite;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid #EDE5DA;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: #7A6B5D;
  cursor: pointer;
  transition: color 0.2s;
  padding: 6px 12px;
  position: relative;
}

.nav-item i {
  font-size: 20px;
  transition: transform 0.2s;
}

.nav-item.active {
  color: #D4621A;
}

.nav-item.active i {
  transform: scale(1.1);
}

.nav-badge {
  position: absolute;
  top: 0;
  right: 4px;
  background: #C0392B;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  animation: bp 0.3s ease;
}

@keyframes bp {
  0% { transform: scale(0); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.cart-bar {
  position: fixed;
  bottom: var(--nav-h);
  left: 12px;
  right: 12px;
  z-index: 45;
  height: var(--cart-h);
  background: #2C1810;
  border-radius: 16px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.3s, opacity 0.3s;
  box-shadow: 0 4px 20px rgba(44, 24, 16, 0.3);
}

.cart-bar.hidden {
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}

.cart-bar:active {
  transform: scale(0.98);
}

.cart-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.cart-sheet-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.cart-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 61;
  background: #fff;
  border-radius: 20px 20px 0 0;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.cart-sheet.show {
  transform: translateY(0);
}

.cart-sheet-handle {
  width: 36px;
  height: 4px;
  background: #EDE5DA;
  border-radius: 2px;
  margin: 10px auto 0;
}

.product-detail {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #FAF6F1;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
}

.product-detail.show {
  transform: translateX(0);
}

.pd-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), transparent);
  pointer-events: none;
}

.pd-header > * {
  pointer-events: auto;
}

.pd-header button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.pd-header button:active {
  background: rgba(255, 255, 255, 0.35);
}

.pd-counter {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.pd-carousel-wrap {
  position: relative;
  width: 100%;
  height: 55vh;
  min-height: 280px;
  overflow: hidden;
  flex-shrink: 0;
}

.pd-carousel {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}

.pd-slide {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  background: #F3ECE4;
}

.pd-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #F3ECE4;
}

.pd-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}

.pd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: all 0.25s;
  cursor: pointer;
}

.pd-dot.active {
  background: #fff;
  width: 22px;
  border-radius: 4px;
}

.pd-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 120px;
  -webkit-overflow-scrolling: touch;
}

.pd-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pd-name {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}

.pd-price-box {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.pd-price-main {
  font-size: 24px;
  font-weight: 800;
  color: #D4621A;
}

.pd-price-original {
  font-size: 15px;
  color: #B5A899;
  text-decoration: line-through;
}

.pd-price-promo-tag {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #C0392B;
  padding: 2px 8px;
  border-radius: 4px;
}

.pd-unit {
  font-size: 12px;
  color: #7A6B5D;
  font-weight: 500;
}

.pd-desc-label {
  font-size: 11px;
  font-weight: 700;
  color: #7A6B5D;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.pd-desc-text {
  font-size: 14px;
  color: #4A3A2E;
  line-height: 1.7;
}

.pd-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid #EDE5DA;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pd-add-btn {
  flex: 1;
  height: 48px;
  border-radius: 14px;
  border: none;
  background: #D4621A;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: 'DM Sans', sans-serif;
}

.pd-add-btn:active {
  transform: scale(0.97);
  box-shadow: 0 4px 16px rgba(212, 98, 26, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

html {
  background-color: #f3f4f6; 
}

body {
  max-width: 448px; 
  margin: 0 auto; 
  background-color: #fafafa; 
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08); 
  position: relative;
  overflow-x: hidden;
}

.app-header, 
.bottom-nav, 
.cart-bar, 
.cart-sheet,
.cart-sheet-overlay,
.product-detail,
.toast-container {
  max-width: 448px !important;
  margin: 0 auto !important;
  left: 0 !important;
  right: 0 !important;
}
