/* 
   Sandy Coffee Shop - Main Styles 
   Theme: Desert, Sand, Gold, Warmth, Luxury
*/

/* Loading Screen */
/* Loading Screen */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Warm gradient background instead of plain white */
  background: linear-gradient(135deg, #fffcf5 0%, #f4e4c1 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  /* Smooth exit with multiple properties */
  transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out, filter 0.8s ease-in-out, transform 0.8s cubic-bezier(0.7, 0, 0.3, 1);
  /* Initial state */
  filter: blur(0);
  transform: translateY(0);
}
#loading-screen.hidden {
  opacity: 0; /* Optional: Keep slightly visible while moving or fade out */
  visibility: hidden;
  /* Exit animation: Slide Up like a curtain */
  transform: translateY(-100%);
  filter: blur(0); /* Remove blur for clean slide, or keep mild blur */
}
.loading-content {
  text-align: center;
}
.loading-logo {
  width: 150px;
  height: auto;
  display: block;
  margin: 0 auto 20px;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
  /* Pulse animation */
  animation: logoPulse 2s ease-in-out infinite;
}
#loading-screen .loading-spinner {
  width: 50px; /* Slightly larger */
  height: 50px;
  border: 4px solid rgba(197, 160, 89, 0.3);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* Modal open - prevent body scroll */
body.modal-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  top: var(--scroll-position);
}
@font-face {
  font-family: "KOGhorab";
  src: url("../assets/fonts/KOOkies-Bold.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "KOOkies";
  src: url("../assets/fonts/KOOkies-Bold.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "KOOkies-SemiBold";
  src: url("../assets/fonts/KOOkies-Bold.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "Fredoka";
  src: url("../assets/fonts/Fredoka-Bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
}
:root {
  /* Colors */
  --color-sand-light: #f9f3e5; /* Very light beige background */
  --color-sand-medium: #e6d5b8; /* Card background / Form elements */
  --color-gold: #c5a059; /* Accents */
  --color-gold-hover: #b08d48;
  --color-brown-dark: #4b3621; /* Text color */
  --color-brown-light: #8c735a; /* Secondary text */
  --color-white: #ffffff;
  /* Fonts - Fredoka for English, KOGhorab for Arabic */
  --font-heading: "Fredoka", "KOGhorab", sans-serif;
  --font-subtitle: "KOOkies", cursive;
  --font-story: "KOOkies-SemiBold", cursive;
  --font-body: "Outfit", sans-serif;
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 8rem;
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  /* Animation Easing */
  --ease-spring: cubic-bezier(0.4, 0, 0.2, 1);
  --radius-lg: 32px;
}
/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  background-color: var(--color-brown-dark); /* Match footer to hide gaps */
  overflow-x: hidden;
  width: 100%;
  height: 100%;
}
body {
  font-family: var(--font-body);
  color: var(--color-brown-dark);
  line-height: 1.6;
  overflow-x: hidden;
  background: var(--color-brown-dark); /* Match footer color to prevent gaps */
  min-height: 100%;
  position: relative; /* For absolute positioned children like falling-sand */
}
/* Strict mobile overflow fix */
@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden !important;
    min-width: 100vw !important; /* Ensure it fills viewport */
    position: relative;
  }
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 400; /* Fredoka One is usually 400 */
}
a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}
ul {
  list-style: none;
}
img {
  max-width: 100%;
  display: block;
}
/* Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}
/* Main Content Wrapper - Background for sections after hero */
.main-content-wrapper {
  position: relative;
  background: #f9f3e5; /* Sand color background */
  /* Backgrounds removed per request */
}

/* =====================================
   Text Reveal Animation (Sand Effect)
   ===================================== */
.text-reveal {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(20px);
  transition: opacity 1s ease, filter 1s ease, transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, filter, transform;
}

.text-reveal.visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* Staggered delay for child elements */
.text-reveal-container .text-item {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(15px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.text-reveal-container.visible .text-item {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

/* Helper delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

/* Utilities */
.text-center {
  text-align: center;
}
.mt-4 {
  margin-top: var(--spacing-md);
}
/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 50px;
  font-weight: 500;
  font-family: var(--font-body); /* Keep buttons clean */
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.9rem;
  cursor: pointer;
}
.btn-primary {
  background-color: var(--color-gold);
  color: var(--color-white);
  border: 1px solid var(--color-gold);
}
.btn-primary:hover {
  background-color: var(--color-gold-hover);
  border-color: var(--color-gold-hover);
}
.btn-secondary {
  background-color: transparent;
  color: var(--color-brown-dark);
  border: 1px solid var(--color-brown-dark);
}
.btn-secondary:hover {
  background-color: var(--color-brown-dark);
  color: var(--color-white);
}
/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: var(--spacing-sm) 0;
  transition: background 0.3s ease, padding 0.3s ease;
}
.navbar.scrolled {
  background: rgba(249, 243, 229, 0.9);
  backdrop-filter: blur(10px);
  padding: var(--spacing-xs) 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--color-brown-dark);
}
.nav-links {
  display: flex;
  gap: var(--spacing-md);
}
.nav-links a {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-brown-dark);
}
.nav-links a:hover {
  color: var(--color-gold);
}
.hamburger {
  display: none;
  cursor: pointer;
}
/* Hero Section */
.hero-section {
  position: relative;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
/* Background Image Overlay - HIDDEN */
.bg-overlay {
  display: none;
}
/* When visible class is added via JS */
.bg-overlay.visible {
  transform: translateY(0);
  opacity: 1;
}
/* Video Background */
/* Video Background */
.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 0; /* Was -1, moved to 0 to sit above body background */
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* Was 0, moved to 1 */
}
.about-section {
  padding-top: 0;
  padding-bottom: var(--spacing-xl);
  position: relative;
  z-index: 2;
}
.about-text {
  direction: rtl;
  text-align: right;
  padding: var(--spacing-md);
  max-width: 800px;
  margin: 0 auto;
}
.about-text h2 {
  margin-bottom: var(--spacing-sm);
  color: var(--color-brown-dark);
}
.about-text p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--color-brown-light);
  margin-bottom: var(--spacing-sm);
}
/* Ensure content is above video */
.hero-content {
  position: relative;
  z-index: 2;
  color: var(--color-white);
}
.hero-title {
  font-size: 5rem;
  font-family: var(--font-heading);
  line-height: 1.1;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  color: var(--color-white);
}
.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  opacity: 0.9;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
/* Wave Dividers */
.wave-divider {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 3;
  max-width: 100vw; /* Ensure it never exceeds viewport */
}
.wave-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 80px;
}
.wave-hero {
  margin-top: -1px;
}
.wave-hero svg path {
  fill: var(--color-sand-light);
}
.wave-popular {
  margin-top: -40px;
  transform: rotate(180deg);
}
.wave-popular svg path {
  fill: var(--color-sand-medium);
}
/* Falling Sand Effect - Disabled (to avoid layout/stretch issues) */
.falling-sand-container {
  display: none !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  z-index: 1;
  pointer-events: none;
  /* NO overflow:hidden - critical for canvas to extend to footer */
}
/* tsParticles Sand Effect - must not block clicks */
#sand-particles,
#sand-particles canvas,
#tsparticles,
#tsparticles canvas {
  pointer-events: none !important;
}
#falling-sand-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.accent-text {
  color: var(--color-gold);
  font-style: italic;
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(75, 54, 33, 0.3),
    rgba(75, 54, 33, 0.1)
  );
}
.hero-content {
  position: relative;
  z-index: 2;
  color: var(--color-white);
}
.hero-title {
  font-size: 4rem;
  line-height: 1.1;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.accent-text {
  color: var(--color-gold);
  font-style: italic;
}
.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-md);
  font-weight: 300;
  opacity: 0.9;
}
/* Sections General */
.section {
  padding: var(--spacing-xl) 0;
  position: relative;
  z-index: 2; /* Above sand canvas */
}
.section-title {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  color: var(--color-brown-dark);
}
/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  align-items: center;
}
.about-text p {
  font-family: var(--font-story);
  font-size: 1.3rem;
  line-height: 1.8;
  color: var(--color-brown-light);
  margin-bottom: var(--spacing-sm);
}
.sand-shape {
  width: 100%;
  height: 400px;
  background-color: var(--color-sand-medium);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  box-shadow: inset 10px 10px 30px rgba(255, 255, 255, 0.4),
    10px 10px 30px rgba(0, 0, 0, 0.05);
  animation: morph 8s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sand-shape-logo {
  width: 60%;
  max-width: 250px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.1));
}
@keyframes morph {
  0% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
}
/* Menu Section */
.menu-section {
  padding: var(--spacing-xl) 0;
  /* No background - sand visible */
}
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}
.menu-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(5px);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 20px rgba(75, 54, 33, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.menu-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(75, 54, 33, 0.1);
}
.card-icon {
  font-size: 2rem;
  margin-bottom: var(--spacing-xs);
}
.menu-card h3 {
  font-size: 1.5rem;
  margin-bottom: var(--spacing-xs);
  color: var(--color-brown-dark);
}
.card-desc {
  font-size: 0.95rem;
  color: var(--color-brown-light);
  margin-bottom: var(--spacing-sm);
}
.price {
  display: inline-block;
  font-weight: 600;
  color: var(--color-gold);
  font-size: 1.1rem;
}
/* Categories Grid Layout */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}
@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* Force 2 columns */
    gap: 10px !important;
  }
  .category-image {
    height: 220px !important; /* Shorter image on mobile */
  }
}
/* Category Cards */
.category-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent; /* Remove iOS tap highlight */
  touch-action: manipulation; /* Disable double-tap zoom on iOS */
}
/* Hover only for devices that support it (not touch) */
@media (hover: hover) and (pointer: fine) {
  .category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(197, 160, 89, 0.2);
  }
  .category-card:hover .category-image img {
    transform: scale(1.1);
  }
}
.category-image {
  width: 100%;
  height: 300px;
  overflow: hidden;
  position: relative;
}
.category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
/* Removed .category-card:hover .category-image img - moved to @media (hover: hover) above */
.category-name {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  text-align: center;
  font-size: 1.5rem;
  font-family: var(--font-heading);
  z-index: 2;
}
/* Footer */
.footer {
  background-color: var(--color-brown-dark);
  color: var(--color-sand-medium);
  padding: var(--spacing-lg) 0 var(--spacing-md);
  position: relative;
  z-index: 2;
  overflow: visible;
  flex-shrink: 0; /* Don't shrink footer */
  margin-top: auto; /* Push to bottom */
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  position: relative;
  z-index: 10;
  text-align: left;
  direction: ltr;
}
.footer-col h3 {
  font-size: 2rem;
  color: var(--color-white);
  margin-bottom: var(--spacing-sm);
}
.footer-col h4 {
  color: var(--color-gold);
  margin-bottom: var(--spacing-sm);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.footer-col p {
  margin-bottom: 0.5rem;
  opacity: 0.8;
}
.footer-col a {
  color: var(--color-sand-light);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}
.footer-col a:hover {
  color: var(--color-gold);
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-3px);
}
.footer-col a:active {
  transform: scale(0.98);
}
.footer-bottom {
  text-align: center;
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  opacity: 0.6;
  position: relative;
  z-index: 10;
  direction: ltr;
}
/* Popular Products Section */
.popular-section {
  padding: var(--spacing-lg) 0;
  /* No background - sand visible */
}
.popular-section .section-title {
  text-align: center;
  margin-bottom: var(--spacing-md);
}
.products-scroll-container {
  width: 100%;
  overflow: visible; /* Allow scaled cards to overflow */
  padding: 30px 0; /* Space for scale animation */
  margin: -30px 0; /* Compensate for padding */
}
.products-scroll {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  padding-top: 40px; /* Extra space at top for scaled cards */
  padding-bottom: 40px; /* Extra space at bottom */
  overflow-x: auto;
  overflow-y: visible; /* Allow scaled cards to overflow vertically */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  /* iOS Safari compatibility */
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
  scroll-behavior: auto !important; /* Critical for JS infinite scroll to work without bouncing */
  /* Prevent iOS momentum issues */
  overscroll-behavior-x: contain;
}
.products-scroll::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.product-card {
  flex: 0 0 280px;
  min-width: 280px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(75, 54, 33, 0.1);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.4s ease;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* Active/Click Animation - Pops forward */
.product-card.active,
.product-card.tapped {
  transform: scale(1.08) translateY(-20px);
  box-shadow: 
    0 30px 60px rgba(75, 54, 33, 0.25),
    0 0 40px rgba(197, 160, 89, 0.4);
  z-index: 100;
}

/* Smooth press-down effect before pop */
.product-card:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}
/* Shimmer overlay */
.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
  z-index: 10;
  pointer-events: none;
}
/* Hover only for mouse devices */
@media (hover: hover) and (pointer: fine) {
  .product-card:hover::before {
    left: 100%;
  }
}
/* Product Reveal Overlay */
.product-reveal {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
  border-top: 1px solid var(--color-sand-medium);
  text-align: center;
}
.product-card.active .product-reveal {
  transform: translateY(0);
}
.product-reveal h4 {
  color: var(--color-brown-dark);
  font-family: var(--font-heading);
  margin-bottom: 8px;
  font-size: 1.2rem;
}
.product-reveal .reveal-price {
  color: var(--color-gold);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
  display: block;
}
.product-reveal .reveal-desc {
  color: var(--color-brown-light);
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 8px;
}
.product-reveal .reveal-ingredients {
  /* Deprecated, see tags below */
  display: none;
}
.reveal-ingredients-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
  padding-top: 20px; /* Increased spacing from line */
  border-top: 1px dashed var(--color-sand-medium);
}
.tag-pill {
  background: #fffcf5;
  color: var(--color-gold);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--color-gold);
  box-shadow: 0 2px 4px rgba(197, 160, 89, 0.1);
  white-space: nowrap;
}
/* Hover only for mouse devices */
@media (hover: hover) and (pointer: fine) {
  .product-card:hover {
    transform: translateY(-15px) scale(1.03) rotateX(2deg);
    box-shadow: 0 25px 50px rgba(75, 54, 33, 0.2),
      0 0 30px rgba(197, 160, 89, 0.3); /* Golden glow */
  }
  .product-card:hover .product-image img {
    transform: scale(1.1);
  }
}
.product-image {
  width: 100%;
  height: 320px;
  overflow: hidden;
  position: relative;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-spring);
  will-change: transform;
}
.product-name {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--color-brown-dark);
  text-align: center;
  background: linear-gradient(
    to top,
    var(--color-white),
    rgba(255, 255, 255, 0.9)
  );
  min-height: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
/* Auto-shrink only for long product names */
.product-name.long-text {
  font-size: 1rem;
}
/* =====================================
   Categories Section
   ===================================== */
.categories-section {
  padding-top: var(--spacing-xl);
  padding-bottom: var(--spacing-md); /* Reduced space */
  position: relative;
  overflow: hidden;
}
.section-subtitle {
  font-family: var(--font-subtitle);
  font-size: 1.3rem;
  color: var(--color-brown-light);
  margin-bottom: var(--spacing-lg);
}
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
  align-items: start;
  position: relative;
  z-index: 5;
}
.category-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(75, 54, 33, 0.1);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.4s ease;
  cursor: pointer;
  position: relative;
  z-index: 5;
  -webkit-tap-highlight-color: transparent; /* Remove iOS tap highlight */
  touch-action: manipulation; /* Disable double-tap zoom on iOS */
}
/* Shimmer overlay */
.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.7s ease;
  z-index: 10;
  pointer-events: none;
}
/* Hover effects only for devices with mouse/trackpad (not touch) */
@media (hover: hover) and (pointer: fine) {
  .category-card:hover::before {
    left: 100%;
  }
  .category-card:hover {
    transform: translateY(-15px) scale(1.04) rotateX(3deg);
    box-shadow: 0 30px 60px rgba(75, 54, 33, 0.2),
      0 0 40px rgba(197, 160, 89, 0.4); /* Golden glow */
  }
  .category-card:hover .category-image img {
    transform: scale(1.1);
  }
}

/* Category card entrance animation (CSS only - no JS needed) */
@keyframes categoryFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.category-card {
  animation: categoryFadeIn 0.8s var(--ease-spring) forwards;
  will-change: transform, opacity;
  transition: transform 0.3s var(--ease-spring);
}
.category-card:active {
  transform: scale(0.98);
}
.category-card:nth-child(1) {
  animation-delay: 0.05s;
}
.category-card:nth-child(2) {
  animation-delay: 0.1s;
}
.category-card:nth-child(3) {
  animation-delay: 0.15s;
}
.category-card:nth-child(4) {
  animation-delay: 0.2s;
}
.category-card:nth-child(5) {
  animation-delay: 0.25s;
}
.category-card:nth-child(6) {
  animation-delay: 0.3s;
}

.category-image {
  width: 100%;
  height: 450px;
  overflow: hidden;
  position: relative;
}
.category-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-spring);
  will-change: transform;
}
/* Hover effect moved to @media (hover: hover) above */
.category-name {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--color-brown-dark);
  text-align: center;
  background: var(--color-white);
  min-height: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}
/* Auto-shrink only for long titles */
.category-name.long-text {
  font-size: 0.95rem;
}
/* =====================================
   Scroll Animations
   ===================================== */
/* Base state - hidden */
/* Base state - hidden */
.scroll-animate {
  opacity: 0;
  transition: opacity 0.8s var(--ease-spring), transform 0.8s var(--ease-spring);
  will-change: transform, opacity;
  /* Ensure clickable even when invisible (iOS fix) */
  pointer-events: auto !important;
}
/* Fade in from bottom */
.scroll-animate.fade-up {
  transform: translateY(40px);
}
/* Fade in from left */
.scroll-animate.fade-left {
  transform: translateX(-40px);
}
/* Fade in from right */
.scroll-animate.fade-right {
  transform: translateX(40px);
}
/* Scale up */
.scroll-animate.scale-up {
  transform: scale(0.9);
}
/* Visible state */
.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}
/* =====================================
   Scroll Indicator
   ===================================== */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
  cursor: pointer;
}
.scroll-text {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 0, 0, 0.3);
}
.scroll-arrow {
  width: 28px;
  height: 28px;
  border-right: 3px solid white;
  border-bottom: 3px solid white;
  transform: rotate(45deg);
  animation: bounce 2s infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: rotate(45deg) translateY(0);
  }
  40% {
    transform: rotate(45deg) translateY(10px);
  }
  60% {
    transform: rotate(45deg) translateY(5px);
  }
}
/* Stagger delays for multiple elements */
.scroll-animate.delay-1 {
  transition-delay: 0.1s;
}
.scroll-animate.delay-2 {
  transition-delay: 0.2s;
}
.scroll-animate.delay-3 {
  transition-delay: 0.3s;
}
.scroll-animate.delay-4 {
  transition-delay: 0.4s;
}
.scroll-animate.delay-5 {
  transition-delay: 0.5s;
}
/* Portrait mode - all devices */
@media (orientation: portrait) {
  .hero-section {
    height: auto;
    min-height: 0;
  }
  .hero-video {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    min-width: auto;
    min-height: auto;
    width: 100%;
    height: auto;
    object-fit: contain;
  }
  .hero-overlay {
    display: none;
  }
  .hero-content {
    position: relative;
    padding: var(--spacing-lg) var(--spacing-md);
  }
}
/* Hide scroll indicator in portrait mode */
@media (orientation: portrait) {
  .scroll-indicator {
    display: none;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .scroll-indicator {
    bottom: 20px;
    gap: 4px;
  }
  .scroll-text {
    font-size: 0.65rem;
    letter-spacing: 2px;
  }
  .scroll-arrow {
    width: 16px;
    height: 16px;
    border-width: 2px;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none; /* Add JS toggle later */
  }
  .hamburger {
    display: block;
  }
}
/* =====================================
   Click-to-Zoom Cards
   ===================================== */
/* Overlay */
.zoom-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  z-index: 999;
  pointer-events: none;
  transition: background 0.3s ease;
}
.zoom-overlay.active {
  background: rgba(0, 0, 0, 0.7);
  pointer-events: all;
}
/* Zoomed Container */
.zoomed-card-container {
  position: fixed;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  z-index: 1000;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
}
.zoomed-card-container.active {
  opacity: 1;
  pointer-events: all;
}
.zoomed-card-container.zoomed {
  top: 5vh !important;
  left: 5vw !important;
  width: 90vw !important;
  height: 90vh !important;
  border-radius: var(--radius-lg);
}
/* Close Button */
.zoom-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s ease, transform 0.3s ease;
}
.zoom-close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}
/* Zoomed Content */
.zoomed-card-content {
  height: 100%;
  overflow-y: auto;
  padding: 0;
  direction: rtl;
  transition: opacity 0.3s ease;
}
/* Header */
.zoom-header {
  position: relative;
  height: 250px;
  overflow: hidden;
}
.zoom-header-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.zoom-header h2 {
  position: absolute;
  bottom: 20px;
  right: 30px;
  color: white;
  font-size: 2.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  font-family: var(--font-heading);
}
/* Products Grid */
.zoom-products-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(260px, 1fr)
  ); /* Slightly wider for the card style */
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
}
/* Override Product Card styles when inside Zoom Grid */
.zoom-products-grid .product-card {
  flex: none; /* Reset flexbox flex-grow/shrink from carousel */
  min-width: 0; /* Reset min-width from carousel */
  width: 100%; /* Fill grid cell */
  transform: none !important; /* Remove initial skew/transform if any */
}
/* Hover effect needs to be re-applied or adjusted if needed, but the base class handles it well. 
   We might just want to ensure z-index is correct. */
.zoom-products-grid .product-card:hover {
  transform: translateY(-10px) !important;
  z-index: 5;
}
/* Product Item - Card Style (vertical like categories) */
/* Zoom Product Item Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.zoom-product-item {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  /* Match product-card transition exactly for consistent feel */
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.4s ease;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid transparent; /* Reserve space for active border */
  
  /* Initial state: Visible by default, but animation handles the entry */
  opacity: 1;
  /* Ensure stable stacking context */
  position: relative;
  z-index: 1;
}

/* Entry Animation Class - removed by JS after completion */
.zoom-product-item.animate-in {
  /* Use 'backwards' so the 'from' state (opacity: 0) is applied during the animation-delay period */
  animation: fadeInUp 0.6s var(--ease-spring) backwards;
  /* Removed pointer-events: none to allow immediate interaction */
}

/* Only apply hover effects on devices that support hovering (Desktop) */
@media (hover: hover) {
  .zoom-product-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    z-index: 10;
  }
}

/* Active/Click Animation for Zoom Product Items */
.zoom-product-item.active {
  /* Removed !important as it's no longer needed with fill-mode fix */
  transform: scale(1.05) translateY(-10px);
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.2),
    0 0 30px rgba(197, 160, 89, 0.3);
  z-index: 100;
  border: 1px solid var(--color-gold);
}

/* Smooth press-down effect */
.zoom-product-item:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}
.zoom-product-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}
.zoom-product-info {
  padding: var(--spacing-md);
  text-align: center;
}
.zoom-product-info h4 {
  font-family: var(--font-heading);
  color: var(--color-brown-dark);
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.zoom-product-info h4.long-text {
  font-size: 1rem;
}
.zoom-product-price {
  color: var(--color-gold);
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 10px;
}
.zoom-product-desc {
  color: var(--color-brown-light);
  font-size: 0.95rem;
  margin-bottom: 10px;
  line-height: 1.5;
}
.zoom-product-ingredients {
  color: var(--color-brown-light);
  font-size: 0.85rem;
  opacity: 0.8;
  padding-top: 10px;
  border-top: 1px solid var(--color-sand-medium);
}
/* =====================================
   Modals
   ===================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center; /* Center Vertically */
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}
.modal.active {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--color-beige-light);
  width: 90%;
  max-width: 500px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gold);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  max-height: 90vh; /* Limit height */
}
/* Large Modal for Category Products */
.modal-content.large-modal {
  max-width: 900px;
}
.modal.active .modal-content {
  transform: translateY(0);
}
.modal-header {
  background: #fffcf5;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 2px solid var(--color-sand-medium);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-header h3 {
  color: var(--color-brown-dark);
  font-size: 1.3rem;
}
.modal-close {
  font-size: 2rem;
  color: var(--color-brown-light);
  cursor: pointer;
  line-height: 1;
  transition: color 0.3s ease;
}
.modal-close:hover {
  color: var(--color-red);
}
.modal-body {
  padding: var(--spacing-lg);
  overflow-y: auto;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--spacing-md);
}
/* Ensure product card in modal looks good */
.modal-body .product-card {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08); /* Lighter shadow */
}
/* Mobile Responsive */
@media (max-width: 768px) {
  .zoomed-card-container.zoomed {
    top: 2.5vh !important;
    left: 5vw !important;
    width: 90vw !important;
    height: 85vh !important;
    border-radius: var(--radius-lg);
    max-height: none;
  }
  .zoom-header {
    height: 180px;
  }
  .zoom-header h2 {
    font-size: 1.8rem;
    left: 20px;
  }
  .zoom-products-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: var(--spacing-sm);
    gap: var(--spacing-sm);
  }
  .zoom-product-item {
    flex-direction: column;
  }
  .zoom-product-item img {
    width: 100%;
    height: 120px;
  }
  .zoom-product-info {
    padding: var(--spacing-sm);
  }
  .zoom-product-info h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }
  .zoom-product-price {
    font-size: 1rem;
    margin-bottom: 5px;
  }
  .zoom-product-desc {
    font-size: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* Modal Mobile */
  .modal-content {
    width: 95%;
    max-height: 85vh;
  }
  .products-grid {
    grid-template-columns: 1fr 1fr; /* 2 columns on mobile */
    gap: var(--spacing-sm);
  }
  .modal-body .product-card {
    min-width: 0; /* Override */
    flex: none;
  }
  .modal-body {
    padding: var(--spacing-sm);
  }
  /* Category Card Mobile */
  .category-image {
    height: 400px;
  }
  /* Popular Product Cards Mobile */
  .products-scroll .product-card {
    flex: 0 0 200px; /* Even smaller card width */
    min-width: 200px;
  }
  .products-scroll .product-image {
    height: 220px; /* Even smaller image height */
  }
}
/* Admin Link - Discreet */
.admin-link {
  display: inline-block;
  opacity: 0.2;
  margin-left: 10px;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  filter: grayscale(100%);
  text-decoration: none;
}
.admin-link:hover {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.2) rotate(10deg);
}
/* Safe Wave Container Implementation - Bottom of Main Content */
.main-content-wrapper {
  position: relative;
  z-index: 1;
  overflow: visible;
}
#coffee-waves-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
}
#coffee-waves-container svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* =====================================
   Skeleton Loading for Images
   ===================================== */
.skeleton-wrapper {
  position: relative;
  overflow: hidden;
  background: var(--color-sand-medium);
}

.skeleton-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: skeleton-shimmer 1.5s infinite;
  z-index: 1;
}

@keyframes skeleton-shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.skeleton-wrapper.loaded::before {
  display: none;
}
.skeleton-wrapper.loaded img {
  opacity: 1;
}
.skeleton-wrapper img {
  opacity: 0;
  transition: opacity 0.5s var(--ease-spring);
}

/* =====================================
   Delight Features (Surprise Me)
   ===================================== */

/* Floating Action Button */
.surprise-fab {
  position: fixed;
  bottom: 25px;
  right: 25px; /* RTL aware: this will be left if dir=rtl but usually fixed positions ignore dir */
  z-index: 1000;
  display: none; /* Hidden until requested */
  /* display: flex; */
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--color-gold), #eec07b);
  border: none;
  border-radius: 50px;
  box-shadow: 0 4px 15px rgba(197, 160, 89, 0.4);
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring);
  will-change: transform;
  animation: fabPulse 3s infinite;
}

html[dir="rtl"] .surprise-fab {
  right: auto;
  left: 25px;
  flex-direction: row-reverse;
}

.surprise-fab:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 6px 20px rgba(197, 160, 89, 0.6);
}

.surprise-fab:active {
  transform: scale(0.95);
}

.fab-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.fab-text {
  font-family: var(--font-heading);
  color: var(--color-brown-dark);
  font-weight: bold;
  font-size: 1rem;
}

@keyframes fabPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Modal */
.surprise-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.surprise-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}

.surprise-card {
  position: relative;
  width: 90%;
  max-width: 400px;
  background: var(--color-sand-light);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transform: scale(0.9);
  transition: transform 0.4s var(--ease-spring);
}

.surprise-modal.active .surprise-card {
  transform: scale(1);
}

.surprise-close {
  position: absolute;
  top: 15px;
  right: 15px; /* RTL aware */
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--color-brown-light);
  cursor: pointer;
  line-height: 1;
  padding: 5px;
}
html[dir="rtl"] .surprise-close {
    right: auto;
    left: 15px;
}

/* Styles for Loader */
.surprise-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 0;
}

.emoji-spinner {
  font-size: 3rem;
  display: inline-block;
  animation: rotateSpinner 1s linear infinite;
}

@keyframes rotateSpinner {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Styles for Result */
.surprise-result {
  display: flex; /* Hidden by default */
  flex-direction: column;
  gap: 20px;
  align-items: center;
  animation: fadeInUp 0.5s var(--ease-spring);
}

.surprise-title {
  font-family: var(--font-heading);
  color: var(--color-brown-dark);
  font-size: 1.5rem;
}

.surprise-actions {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
  padding: 12px 24px;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: var(--color-brown-dark);
  color: white;
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--color-brown-dark);
  color: var(--color-brown-dark);
}

.btn-primary:active, .btn-secondary:active {
  transform: scale(0.95);
}
/* Hide skeleton effect when image is loaded */
.skeleton-wrapper.loaded::before {
  display: none;
}

.skeleton-wrapper img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.skeleton-wrapper.loaded img {
  opacity: 1;
}
