/*
 * Siyah İnci Cafe & Bistro - Premium QR Menu Stylesheet
 * Elegant Serif + Modern Sans Serif Typography, Cream & Chocolate Warm Palette
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* --- Design System Variables --- */
:root {
  --bg-color: #F8F5EF;            /* Warm cream background */
  --card-bg: #FFFFFF;             /* White product cards */
  --primary-color: #5A3E2B;       /* Dark brown primary */
  --primary-rgb: 90, 62, 43;      /* RGB for brown alpha transparency */
  --secondary-color: #EADFC9;     /* Light beige secondary */
  --accent-gold: #C5A880;         /* Soft warm luxury gold */
  --accent-gold-rgb: 197, 168, 128;
  --text-main: #2E1F15;           /* Rich coffee-bean black/brown for titles */
  --text-muted: #67574B;          /* Darker earthy gray/brown for better contrast & legibility */
  --border-color: #E6DFD3;        /* Soft divider lines */
  --border-radius-card: 20px;     /* Smooth rounded corners (18-22px) */
  --border-radius-badge: 10px;
  
  --transition-speed: 250ms;
  --transition-bezier: cubic-bezier(0.16, 1, 0.3, 1); /* iOS-like smooth elastic out */
  
  --shadow-sm: 0 4px 12px rgba(90, 62, 43, 0.04);
  --shadow-md: 0 12px 32px rgba(90, 62, 43, 0.07);
  --shadow-lg: 0 20px 48px rgba(90, 62, 43, 0.12);
  --shadow-sheet: 0 -8px 30px rgba(90, 62, 43, 0.1);
}

/* --- Base & Reset Rules --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* Disable tap highlight on mobile browsers */
}

html, body {
  background-color: #EADFC9; /* Out-of-bounds screen color for desktop layout */
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-main);
  scroll-behavior: smooth;
}

/* App wrapper container: Centered and responsive, simulating mobile viewport on desktop */
.app-container {
  width: 100%;
  max-width: 480px; /* Boundaries for desktop previewing, matches mobile at 100% */
  margin: 0 auto;
  background-color: var(--bg-color);
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(90, 62, 43, 0.15);
  opacity: 0;
  transition: opacity 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.app-container.menu-loaded {
  opacity: 1;
}

/* --- Header & Brand Intro --- */
.brand-header {
  padding: 24px 24px 10px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all var(--transition-speed) var(--transition-bezier);
}

.brand-logo-container {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  transition: all var(--transition-speed) var(--transition-bezier);
}

.brand-logo-container:active {
  transform: scale(0.95);
}

.brand-logo-img {
  height: 100%;
  width: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.brand-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 2px;
  transition: all var(--transition-speed) var(--transition-bezier);
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all var(--transition-speed) var(--transition-bezier);
}

/* --- Sticky Header Wrapper & Stack Container --- */
.sticky-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-color);
  border-bottom: 1px solid rgba(230, 223, 211, 0.4);
  transition: all var(--transition-speed) var(--transition-bezier);
}

/* Scrolled/Compact Header Transition States */
.sticky-header-wrapper.scrolled {
  box-shadow: var(--shadow-sm);
  border-bottom-color: rgba(230, 223, 211, 0.7);
}

.sticky-header-wrapper.scrolled .brand-header {
  padding: 10px 16px 6px 16px;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
}

.sticky-header-wrapper.scrolled .brand-logo-container {
  height: 38px;
  margin-bottom: 0;
}

.sticky-header-wrapper.scrolled .brand-title {
  font-size: 19px;
  margin-bottom: 0;
}

.sticky-header-wrapper.scrolled .brand-subtitle {
  display: none;
}

.sticky-stack {
  padding: 0 16px 12px 16px;
  transition: padding var(--transition-speed);
}

.sticky-header-wrapper.scrolled .sticky-stack {
  padding-bottom: 8px;
}

/* --- Search Component --- */
.search-container {
  position: relative;
  width: 100%;
  margin-bottom: 10px;
}

.search-input {
  width: 100%;
  padding: 12px 20px 12px 48px;
  border-radius: 99px;
  border: 1.5px solid var(--border-color);
  background-color: var(--card-bg);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  box-shadow: inset 0 2px 4px rgba(90, 62, 43, 0.02);
  transition: all var(--transition-speed) var(--transition-bezier);
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(90, 62, 43, 0.08);
}

.search-input::placeholder {
  color: #B2A79E;
  font-weight: 400;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: #B2A79E;
  pointer-events: none;
  transition: fill var(--transition-speed);
}

.search-input:focus + .search-icon {
  fill: var(--primary-color);
}

.search-clear-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-speed);
}

.search-clear-btn.visible {
  opacity: 1;
  visibility: visible;
}

.search-clear-svg {
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
}

/* --- Hierarchical Categories Box --- */
.categories-container {
  background: var(--card-bg);
  border: 1px solid rgba(90, 62, 43, 0.12);
  border-radius: 20px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  box-shadow: var(--shadow-sm);
}

.main-categories-slider,
.sub-categories-slider {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Hide scrollbar Firefox */
  width: 100%;
}

.main-categories-slider::-webkit-scrollbar,
.sub-categories-slider::-webkit-scrollbar {
  display: none; /* Hide scrollbar Safari/Chrome */
}

/* Category Pill Styling */
.category-pill {
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 99px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(90, 62, 43, 0.2);
  background-color: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-speed) var(--transition-bezier);
}

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

.category-pill.active {
  background-color: var(--primary-color);
  color: var(--card-bg);
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(90, 62, 43, 0.15);
}

/* Sub-category Pill Styling - slightly smaller for hierarchical depth */
.sub-categories-slider .category-pill {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(90, 62, 43, 0.12);
}

/* --- Menu Content Area --- */
.menu-content {
  padding: 20px 16px 80px 16px;
  flex-grow: 1;
}

/* Search results section header */
.search-results-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 20px;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 8px;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.no-results-svg {
  width: 64px;
  height: 64px;
  fill: var(--secondary-color);
  margin-bottom: 16px;
}

.no-results p {
  font-size: 15px;
  font-weight: 500;
}

/* Category sections grouping */
.menu-section {
  scroll-margin-top: 175px; /* Offset for sticky stack (search + main pill + sub pill) */
  margin-bottom: 36px;
  animation: fadeIn 350ms var(--transition-bezier);
}

.section-header {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid rgba(230, 223, 211, 0.5);
  padding-bottom: 6px;
}

/* --- Product Cards --- */
.product-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-card);
  padding: 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-speed) var(--transition-bezier),
              box-shadow var(--transition-speed) var(--transition-bezier);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(230, 223, 211, 0.35);
  will-change: transform, box-shadow;
}

.product-card:active {
  transform: scale(0.975);
  box-shadow: 0 4px 12px rgba(90, 62, 43, 0.02);
}

.product-image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 66.67%; /* 3:2 Aspect Ratio - perfect balance */
  border-radius: calc(var(--border-radius-card) - 4px);
  overflow: hidden;
  margin-bottom: 12px;
  background-color: #ECE7DF; /* Shimmer placeholder color */
}

.product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 300ms ease, transform 600ms var(--transition-bezier);
}

.product-image.loaded {
  opacity: 1;
}

.product-card:hover .product-image.loaded {
  transform: scale(1.03);
}

/* Dynamic floating badges over the card image */
.product-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.badge-tag {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.badge-tag.yeni {
  background-color: rgba(197, 168, 128, 0.92); /* Luxury Gold */
}

.badge-tag.populer {
  background-color: rgba(90, 62, 43, 0.88); /* Cafe Espresso Brown */
}

.badge-tag.acili {
  background-color: rgba(196, 69, 54, 0.9); /* Chili Red */
}

/* Card details styling */
.product-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-name-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.product-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  margin: 0;
}

.product-price-badge {
  background-color: var(--primary-color);
  color: var(--card-bg);
  padding: 6px 12px;
  border-radius: var(--border-radius-badge);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(90, 62, 43, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.product-description {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Extra touch for allergens */
.product-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(230, 223, 211, 0.4);
}

.product-allergen-icons {
  display: flex;
  gap: 6px;
}

.allergen-mini-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-gold);
}

.detail-link-text {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Bottom Sheet Modal (iOS Style) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(46, 31, 21, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-speed) var(--transition-bezier),
              visibility var(--transition-speed) var(--transition-bezier);
  will-change: opacity;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 480px; /* Anchored to the mobile container width */
  background-color: var(--card-bg);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-sheet);
  z-index: 1001;
  transition: transform var(--transition-speed) var(--transition-bezier);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  will-change: transform;
}

.bottom-sheet.active {
  transform: translate(-50%, 0);
}

/* Drag indicator bar */
.bottom-sheet-drag-area {
  width: 100%;
  padding: 12px 0 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.bottom-sheet-drag-handle {
  width: 40px;
  height: 5px;
  background-color: #E6DFD3;
  border-radius: 99px;
}

/* Close round button top-right */
.bottom-sheet-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(248, 245, 239, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  z-index: 10;
  transition: transform var(--transition-speed);
}

.bottom-sheet-close:active {
  transform: scale(0.9);
}

.bottom-sheet-close-svg {
  width: 12px;
  height: 12px;
  fill: var(--text-main);
}

/* Modal Body Content */
.bottom-sheet-body {
  overflow-y: auto;
  padding: 0 24px 36px 24px;
  -webkit-overflow-scrolling: touch;
}

.bottom-sheet-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  background-color: #ECE7DF;
  box-shadow: var(--shadow-sm);
}

.bottom-sheet-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bottom-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.bottom-sheet-title-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bottom-sheet-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 21px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  line-height: 1.2;
}

.bottom-sheet-badges {
  display: flex;
  gap: 6px;
}

.bottom-sheet-price {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 21px;
  font-weight: 800;
  color: var(--primary-color);
  white-space: nowrap;
}

.bottom-sheet-description {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 24px;
}

/* Ingredient list & allergen list */
.bottom-sheet-meta-section {
  margin-bottom: 20px;
}

.meta-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(230, 223, 211, 0.5);
}

.ingredients-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ingredient-pill {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background-color: #F3EDE2;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(230, 223, 211, 0.4);
}

.allergens-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.allergen-tag {
  font-size: 12px;
  font-weight: 600;
  color: #B9533B;
  background-color: #FDF1EE;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px dashed rgba(185, 83, 59, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.allergen-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #B9533B;
}

/* Close action footer button */
.bottom-sheet-action-btn {
  width: 100%;
  padding: 15px;
  background-color: var(--primary-color);
  color: var(--card-bg);
  border: none;
  border-radius: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition-speed), transform var(--transition-speed);
  margin-top: 10px;
  box-shadow: 0 4px 12px rgba(90, 62, 43, 0.15);
}

.bottom-sheet-action-btn:active {
  background-color: #422D1F;
  transform: scale(0.98);
}

/* --- Utility Animations --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Skeleton Shimmer Loading --- */
.shimmer {
  background: linear-gradient(
    90deg,
    #ECE7DF 25%,
    #F3EDE2 50%,
    #ECE7DF 75%
  );
  background-size: 200% 100%;
  animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* --- Premium Splash Screen Styles --- */
.splash-screen {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 100%;
  background-color: var(--bg-color); /* #F8F5EF */
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1), visibility 600ms;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  padding: 0 40px;
}

/* Glow behind logo */
.splash-glow-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  pointer-events: none;
  z-index: 1;
}

.splash-glow {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 181, 106, 0.12) 0%, rgba(216, 181, 106, 0) 70%);
  opacity: 0;
  animation: glowFadeIn 1s ease-out forwards 0.3s,
             glowPulse 3s ease-in-out infinite 1.3s;
}

@keyframes glowFadeIn {
  to { opacity: 1; }
}

@keyframes glowPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.15);
    opacity: 1.2;
  }
}

/* Coffee Steam Effect */
.splash-steam-container {
  position: absolute;
  top: -65px; /* Adjust based on logo alignment */
  width: 100px;
  height: 80px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  animation: steamFadeIn 1.5s ease-out forwards 0.5s;
}

@keyframes steamFadeIn {
  to { opacity: 0.25; }
}

.steam-svg {
  width: 100%;
  height: 100%;
  stroke: #FFFFFF;
  stroke-width: 3;
  stroke-linecap: round;
  fill: none;
  filter: blur(2px);
}

.steam-line {
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: steamRise 6s linear infinite;
}

.steam-1 {
  animation-delay: 0s;
}
.steam-2 {
  animation-delay: 2s;
}
.steam-3 {
  animation-delay: 4s;
}

@keyframes steamRise {
  0% {
    stroke-dashoffset: 120;
    opacity: 0;
    transform: translateY(15px) translateX(0);
  }
  30% {
    opacity: 0.7;
  }
  60% {
    opacity: 0.3;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
    transform: translateY(-45px) translateX(12px);
  }
}

/* Logo Styling */
.splash-logo-container {
  position: relative;
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
  z-index: 3;
  opacity: 0;
  transform: scale(0.95);
  animation: logoIntro 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.2s,
             splashFloat 4s ease-in-out infinite 1.4s;
}

.splash-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

@keyframes logoIntro {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

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

/* Text Elements */
.splash-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(8px);
  animation: splashTextIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.6s;
  z-index: 3;
}

.splash-subtitle {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(8px);
  animation: splashTextIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.8s;
  z-index: 3;
}

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

/* Loading Bar */
.splash-loading-bar-container {
  width: 130px;
  height: 3px;
  background-color: var(--secondary-color);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: splashTextIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 1s;
  z-index: 3;
}

.splash-loading-bar {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 2px;
  animation: fillLoadingBar 1.8s cubic-bezier(0.4, 0, 0.2, 1) forwards 1s;
}

.splash-loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 25px;
  height: 100%;
  background: linear-gradient(to right, rgba(90, 62, 43, 0), rgba(216, 181, 106, 0.8));
}

@keyframes fillLoadingBar {
  to {
    left: 0;
  }
}

/* --- Homepage Category Grid & Back Button --- */
.brand-header {
  position: relative;
}

.header-back-btn {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  display: none; /* Flex when active */
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border-color);
  transition: all var(--transition-speed) var(--transition-bezier);
  z-index: 10;
}

.header-back-btn svg {
  width: 22px;
  height: 22px;
  fill: var(--primary-color);
  transition: transform var(--transition-speed);
}

.header-back-btn:active {
  transform: translateY(-50%) scale(0.92);
  background-color: var(--secondary-color);
}

.header-back-btn:active svg {
  transform: translateX(-2px);
}

/* Compact layout adjustment for back button */
.sticky-header-wrapper.scrolled .header-back-btn {
  left: 12px;
  width: 36px;
  height: 36px;
}

.sticky-header-wrapper.scrolled .header-back-btn svg {
  width: 18px;
  height: 18px;
}

/* Grid Layout */
.homepage-category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 20px 16px;
  background-color: var(--bg-color);
  flex-grow: 1;
}

@media (min-width: 600px) {
  .homepage-category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 28px 24px;
  }
}

.category-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1.25;
  border-radius: 20px;
  background-color: var(--card-bg);
  box-shadow: 0 6px 20px rgba(90, 62, 43, 0.05); /* Soft premium shadow */
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(90, 62, 43, 0.1);
}

.category-card:active {
  transform: scale(0.97);
  box-shadow: 0 4px 14px rgba(90, 62, 43, 0.08);
}

.category-card-img-wrapper {
  position: relative;
  width: 100%;
  height: 76%;
  overflow: hidden;
}

.category-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-card:hover .category-card-img {
  transform: scale(1.05);
}

.category-card-info {
  width: 100%;
  height: 24%;
  background-color: var(--card-bg);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  border-top: 1px solid rgba(90, 62, 43, 0.04);
}

.category-card-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  overflow: hidden;
  flex-grow: 1;
  padding-right: 4px;
}

.category-card-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary-color);
  margin: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.category-card-subtitle {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.category-card-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(197, 168, 128, 0.12); /* Very light beige background */
  box-shadow: 0 2px 6px rgba(90, 62, 43, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.category-card-btn svg {
  width: 14px;
  height: 14px;
  stroke: var(--primary-color);
}

.category-card:hover .category-card-btn {
  background-color: var(--primary-color);
  color: var(--card-bg);
}

.category-card:hover .category-card-btn svg {
  stroke: var(--card-bg);
}

/* --- Tertiary Categories Slider --- */
.tertiary-categories-slider {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  margin-top: 6px;
  border-top: 1px dashed rgba(90, 62, 43, 0.12);
  padding-top: 8px;
  transition: all var(--transition-speed) var(--transition-bezier);
}

.tertiary-categories-slider::-webkit-scrollbar {
  display: none;
}

.tertiary-categories-slider .category-pill {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(90, 62, 43, 0.12);
}

/* --- Dynamic Loading Overlay --- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(248, 245, 239, 0.97); /* Matches premium body color with high opacity */
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInOverlay 0.15s ease-out forwards;
}

.loading-overlay.fade-out {
  animation: fadeOutOverlay 0.15s ease-in forwards;
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOutOverlay {
  from { opacity: 1; }
  to { opacity: 0; }
}

.loading-spinner-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(197, 168, 128, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spinSpinner 0.6s linear infinite;
}

@keyframes spinSpinner {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-color);
  letter-spacing: -0.2px;
}
