/* ═══════════════════════════════════════════
   Prima Gastro | Custom Styles
   Supplement to Tailwind CSS via Play CDN
   ═══════════════════════════════════════════ */

/* ── Smooth scrolling ─────────────────────── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

/* ── Selection color ──────────────────────── */
::selection {
  background: #D4A843;
  color: #1B4332;
}

/* ── Scrollbar styling ────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #FAFAF5;
}
::-webkit-scrollbar-thumb {
  background: #1B4332;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #2D6A4F;
}

/* ── Navbar states ────────────────────────── */
#navbar {
  background: transparent;
  transition: background 0.5s ease, box-shadow 0.5s ease, backdrop-filter 0.5s ease;
}

#navbar.scrolled {
  background: rgba(250, 250, 245, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 20px rgba(0, 0, 0, 0.03);
}

/* When nav is over hero (transparent), make links and logo white */
#navbar:not(.scrolled) .nav-link,
#navbar:not(.scrolled) .font-serif {
  color: rgba(255, 255, 255, 0.85);
}
#navbar:not(.scrolled) .nav-link:hover {
  color: #D4A843;
}
#navbar:not(.scrolled) .hamburger-line {
  background: white;
}

/* ── Language toggle ──────────────────────── */
#lang-toggle .lang-option[data-lang="de"] {
  color: white;
}
#lang-toggle .lang-option[data-lang="en"] {
  color: #2D2D2D;
}

#navbar:not(.scrolled) #lang-toggle {
  background: rgba(255, 255, 255, 0.15);
}
#navbar:not(.scrolled) #lang-toggle .lang-option[data-lang="en"] {
  color: rgba(255, 255, 255, 0.6);
}

/* When EN is active */
body[data-active-lang="en"] #lang-slider {
  transform: translateX(calc(100% + 8px));
}
body[data-active-lang="en"] #lang-toggle .lang-option[data-lang="de"] {
  color: #2D2D2D;
}
body[data-active-lang="en"] #lang-toggle .lang-option[data-lang="en"] {
  color: white;
}
body[data-active-lang="en"] #navbar:not(.scrolled) #lang-toggle .lang-option[data-lang="de"] {
  color: rgba(255, 255, 255, 0.6);
}
body[data-active-lang="en"] #navbar:not(.scrolled) #lang-toggle .lang-option[data-lang="en"] {
  color: white;
}

/* ── Hamburger animation ──────────────────── */
#mobile-toggle.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#mobile-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#mobile-toggle.active .hamburger-line:nth-child(3) {
  width: 1.5rem;
  transform: translateY(-8px) rotate(-45deg);
}

/* ── Mobile menu open state ───────────────── */
#mobile-menu.open {
  max-height: 400px;
  opacity: 1;
}

#navbar.scrolled + #mobile-menu,
#navbar.scrolled #mobile-menu {
  background: rgba(250, 250, 245, 0.95);
  backdrop-filter: blur(20px);
}

/* ── Hero floating animations ─────────────── */
@keyframes heroFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-15px, 20px) scale(1.05); }
}
@keyframes heroFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10px, -15px); }
}
@keyframes heroFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.4; }
  50% { transform: translate(-8px, 12px) scale(1.5); opacity: 0.7; }
}

.hero-float-1 { animation: heroFloat1 8s ease-in-out infinite; }
.hero-float-2 { animation: heroFloat2 6s ease-in-out infinite; }
.hero-float-3 { animation: heroFloat3 5s ease-in-out infinite; }

/* ── Scroll reveal animations ─────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Product card hover shine effect ──────── */
.group:hover .object-cover {
  filter: brightness(1.05);
}

/* ── Focus styles for accessibility ───────── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #D4A843;
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Grain texture overlay (subtle) ───────── */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}

/* ── Legal pages (impressum, datenschutz) ─── */
.legal-page {
  max-width: 48rem;
  margin: 0 auto;
  padding: 8rem 1.5rem 4rem;
}

.legal-page h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2.5rem;
  color: #1B4332;
  margin-bottom: 2rem;
}

.legal-page h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.5rem;
  color: #1B4332;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.legal-page h3 {
  font-weight: 600;
  font-size: 1.1rem;
  color: #2D2D2D;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-page p,
.legal-page li {
  color: #6B6B6B;
  line-height: 1.8;
  margin-bottom: 0.75rem;
}

.legal-page ul {
  list-style: disc;
  padding-left: 1.5rem;
}

.legal-page a {
  color: #1B4332;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-page a:hover {
  color: #D4A843;
}

/* ── Print styles ─────────────────────────── */
@media print {
  #navbar, .hero-float-1, .hero-float-2, .hero-float-3, body::before {
    display: none !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}
