/* ========================================
   BALI Coffee Shop - Menu Website
   Mobile-First | Performance-Optimized
   ======================================== */

/* --- Font Faces --- */
@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('../fonts/Montserrat-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* --- CSS Variables --- */
:root {
  --brown-900: #2C1810;
  --brown-800: #3E2216;
  --brown-700: #4A2E18;
  --brown-600: #6B4226;
  --brown-500: #8B5E3C;
  --brown-400: #A07850;
  --brown-300: #C4956A;
  --brown-200: #D4A97A;
  --brown-100: #E8CEB0;
  --brown-50: #FDF8F3;

  --cream: #FDF8F3;
  --cream-dark: #F5EDE4;
  --white: #FFFFFF;

  --text-primary: #2C1810;
  --text-secondary: #6B5544;
  --text-muted: #9A8675;

  --nav-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--nav-height) + 12px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--cream);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(165deg, var(--brown-600) 0%, var(--brown-500) 40%, var(--brown-400) 100%);
  padding: 40px 24px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 20px 12px at 15% 20%, rgba(255, 255, 255, 0.04) 0%, transparent 100%),
    radial-gradient(ellipse 18px 10px at 75% 15%, rgba(255, 255, 255, 0.03) 0%, transparent 100%),
    radial-gradient(ellipse 22px 14px at 85% 45%, rgba(255, 255, 255, 0.04) 0%, transparent 100%),
    radial-gradient(ellipse 16px 10px at 25% 60%, rgba(255, 255, 255, 0.03) 0%, transparent 100%),
    radial-gradient(ellipse 20px 12px at 60% 75%, rgba(255, 255, 255, 0.04) 0%, transparent 100%),
    radial-gradient(ellipse 18px 11px at 40% 85%, rgba(255, 255, 255, 0.03) 0%, transparent 100%),
    radial-gradient(ellipse 24px 15px at 10% 90%, rgba(255, 255, 255, 0.04) 0%, transparent 100%),
    radial-gradient(ellipse 15px 9px at 90% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  pointer-events: none;
}

.hero-logo {
  width: 180px;
  height: auto;
  margin-bottom: 16px;
  /* filter: brightness(0) invert(1); */
  animation: fadeInUp 0.8s ease-out;
}

.hero-tagline {
  font-size: 1.1rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 1px;
  margin-bottom: 32px;
  animation: fadeInUp 0.8s ease-out 0.15s both;
}

.hero-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero-divider span {
  width: 40px;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
}

.hero-divider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
}

.hero-motto {
  font-size: 1.15rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.45s both;
}

.hero-description {
  max-width: 320px;
  font-size: 0.82rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.7;
  margin-bottom: 48px;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-badge {
  display: inline-block;
  padding: 6px 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 48px;
  animation: fadeInUp 0.8s ease-out 0.75s both;
}

.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeInUp 0.8s ease-out 0.9s both;
}

.scroll-hint span {
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.scroll-arrow {
  width: 16px;
  height: 16px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.4);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.4);
  animation: scrollBounce 2s ease-in-out infinite;
}

/* --- Sticky Navigation --- */
.menu-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid rgba(139, 94, 60, 0.1);
  transition: box-shadow 0.3s ease;
}

.menu-nav.scrolled {
  box-shadow: 0 2px 20px rgba(44, 24, 16, 0.1);
}

.nav-scroll {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-scroll::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--brown-500);
  background: transparent;
  border: 1.5px solid var(--brown-200);
  transition: all 0.25s ease;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

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

.nav-pill.active {
  background: var(--brown-500);
  color: var(--white);
  border-color: var(--brown-500);
  font-weight: 600;
}

/* --- Menu Content --- */
.menu-content {
  max-width: 520px;
  margin: 0 auto;
}

/* --- Menu Page Images --- */
.menu-page {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Section Body (coded items) --- */
.section-body {
  padding: 0 16px 16px;
  background: var(--white);
}

.size-header {
  display: flex;
  align-items: center;
  padding: 14px 0 6px;
}

.size-header-label {
  flex: 1;
}

.size-cols {
  display: flex;
  min-width: 120px;
}

.size-cols span {
  width: 60px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--brown-400);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Menu Item Row --- */
.menu-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(139, 94, 60, 0.08);
}

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

.item-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.3;
}

.item-mark {
  display: inline-block;
  width: 20px;
  height: auto;
  vertical-align: middle;
  margin-left: 4px;
  /* filter: invert(36%) sepia(30%) saturate(700%) hue-rotate(350deg) brightness(70%); */
}

.item-prices {
  display: flex;
  min-width: 120px;
  flex-shrink: 0;
}

.item-price {
  width: 60px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brown-600);
}

/* Single price — spans the full price area, right-aligned */
.item-prices--single {
  justify-content: flex-end;
}

.item-prices--single .item-price {
  width: auto;
  text-align: right;
  padding-right: 8px;
}

/* No price */
.item-price--empty {
  color: transparent;
}

/* --- Sub-section divider --- */
.section-divider {
  margin: 20px 0 14px;
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brown-200), transparent);
}

.section-divider h3 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brown-500);
  text-transform: uppercase;
  letter-spacing: 3px;
  white-space: nowrap;
}

/* Section divider on dark bg */
.section-body.has-bg .section-divider::before,
.section-body.has-bg .section-divider::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

/* --- Section title (category header inside section-body) --- */
.section-title {
  padding: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-title::before,
.section-title::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--brown-300), transparent);
}

.section-title h2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brown-600);
  text-transform: uppercase;
  letter-spacing: 4px;
  white-space: nowrap;
}

/* Section title on dark bg */
.section-body.has-bg .section-title::before,
.section-body.has-bg .section-title::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.section-body.has-bg .section-title h2 {
  color: var(--brown-100);
}

/* Add-on items (smaller styling) */
.addon-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(139, 94, 60, 0.06);
}

.addon-item:last-child {
  border-bottom: none;
}

.addon-name {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.addon-price {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brown-500);
  padding-right: 8px;
}

/* --- Wide price columns (for Coffee Beans) --- */
.item-prices--wide {
  min-width: 160px;
}

.item-prices--wide .item-price {
  width: 80px;
  font-size: 0.78rem;
}

.size-header--wide {
  display: flex;
  align-items: center;
  padding: 10px 0 4px;
}

.size-header--wide span:first-child {
  flex: 1;
}

.size-cols--wide {
  display: flex;
  min-width: 160px;
}

.size-cols--wide span {
  width: 80px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--brown-400);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Section Body with Background Image --- */
.section-body.has-bg {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.section-body.has-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(44, 24, 16, 0.88) 0%, rgba(62, 34, 22, 0.92) 100%);
  z-index: 0;
  opacity: 0.8;
}

.imgDivider {
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.imgDivider img {
  width: 50px;
}

.section-body.has-bg>* {
  position: relative;
  z-index: 1;
}

.section-body.has-bg .item-name {
  color: rgba(255, 255, 255, 0.92);
}

.section-body.has-bg .item-price {
  color: var(--brown-200);
}

.section-body.has-bg .menu-item {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.section-body.has-bg .section-divider {
  border-top-color: rgba(255, 255, 255, 0.15);
}

.section-body.has-bg .section-divider h3 {
  color: var(--brown-200);
}

.section-body.has-bg .size-cols span,
.section-body.has-bg .size-cols--wide span {
  color: var(--brown-200);
}

.section-body.has-bg .addon-name {
  color: rgba(255, 255, 255, 0.75);
}

.section-body.has-bg .addon-price {
  color: var(--brown-200);
}

.section-body.has-bg .item-mark {
  /* filter: invert(85%) sepia(20%) saturate(300%) hue-rotate(350deg) brightness(110%); */
}

.section-body.has-bg .size-header-label {
  color: rgba(255, 255, 255, 0.6);
}

/* Per-section background images */
#hot-coffee .section-body.has-bg {
  background-image: url('../images/bg/hot-coffee.webp');
}

#iced-coffee .section-body.has-bg {
  background-image: url('../images/bg/iced-coffee.webp');
}

#matcha .section-body.has-bg {
  background-image: url('../images/bg/matcha-boba.webp');
}

#boba .section-body.has-bg {
  background-image: url('../images/bg/matcha-boba.webp');
}

#milkshakes .section-body.has-bg {
  background-image: url('../images/bg/milkshakes.webp');
}

#smoothies .section-body.has-bg {
  background-image: url('../images/bg/smoothies.webp');
}

#juices .section-body.has-bg {
  background-image: url('../images/bg/fresh-juices.webp');
}

#mojitos .section-body.has-bg {
  background-image: url('../images/bg/soda-mojito.webp');
}

#drinks .section-body.has-bg {
  background-image: url('../images/bg/cold-drinks-specialty-coffee.webp');
}

#warm-drinks .section-body.has-bg {
  background-image: url('../images/bg/warm-drinks.webp');
}

#fruit-coffee .section-body.has-bg {
  background-image: url('../images/bg/fruit-coffee.webp');
}

#desserts .section-body.has-bg {
  background-image: url('../images/bg/desserts.webp');
}

#frappe .section-body.has-bg {
  background-image: url('../images/bg/frappe.webp');
}

/* --- Footer --- */
.footer {
  background: linear-gradient(165deg, var(--brown-700), var(--brown-600));
  padding: 40px 24px calc(24px + var(--safe-bottom));
  text-align: center;
  margin-top: 12px;
}

.footer-logo {
  width: 100px;
  height: auto;
  margin: 0 auto 12px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-tagline {
  font-size: 0.8rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.footer-divider {
  width: 40px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto 20px;
}

.footer-motto {
  font-size: 0.75rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* --- Back to Top Button --- */
.back-to-top {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brown-500);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(44, 24, 16, 0.25);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 90;
  -webkit-tap-highlight-color: transparent;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:active {
  transform: scale(0.9);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollBounce {

  0%,
  100% {
    transform: rotate(45deg) translate(0, 0);
    opacity: 0.4;
  }

  50% {
    transform: rotate(45deg) translate(3px, 3px);
    opacity: 0.8;
  }
}

/* --- Menu section --- */
.menu-section {}

/* --- Responsive --- */

/* Larger phones */
@media (min-width: 390px) {
  .hero-logo {
    width: 200px;
  }
}

/* Tablets */
@media (min-width: 768px) {
  .hero {
    min-height: 70vh;
  }

  .hero-logo {
    width: 240px;
  }

  .hero-motto {
    font-size: 1.3rem;
    letter-spacing: 5px;
  }

  .menu-content {
    max-width: 580px;
  }

  .nav-scroll {
    justify-content: center;
    padding: 12px 24px;
  }

  .nav-pill {
    font-size: 0.85rem;
    padding: 10px 20px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .hero {
    min-height: 60vh;
  }

  .menu-content {
    max-width: 620px;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode hint (subtle) */
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #1a1210;
    --cream-dark: #231a15;
    --white: #2a1f1a;
    --text-primary: #e8d5c4;
    --text-secondary: #b89a82;
    --text-muted: #8a7260;
    --brown-50: #1a1210;
  }

  .hero {
    background: linear-gradient(165deg, var(--brown-800) 0%, var(--brown-700) 40%, var(--brown-600) 100%);
  }

  .menu-nav {
    background: var(--cream);
    border-bottom-color: rgba(139, 94, 60, 0.2);
  }

  .nav-pill {
    border-color: var(--brown-400);
    color: var(--brown-200);
  }

  .nav-pill.active {
    background: var(--brown-500);
    color: var(--white);
    border-color: var(--brown-500);
  }

  .menu-item {
    border-bottom-color: rgba(139, 94, 60, 0.12);
  }

  .price {
    color: var(--brown-200);
  }
}