/* ============================================================
   RivaEst — style.css
   Stili centralizzati per tutto il sito
   ============================================================ */

/* --- Google Fonts già caricate via HTML --- */

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', sans-serif;
  background-color: #fff8f6;
  color: #2b1611;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-family: 'Epilogue', sans-serif;
}

img { display: block; max-width: 100%; }

a { text-decoration: none; color: inherit; }

/* ============================================================
   PAGE TRANSITIONS — Router SPA
   ============================================================ */

main {
  transition: opacity 0.26s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.page-exit {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.page-enter {
  opacity: 0;
  transform: translateY(-8px);
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.glass-nav {
  background: rgba(255, 248, 246, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(212, 195, 191, 0.2);
}

/* Link sottoline animata */
.nav-link {
  position: relative;
  padding-bottom: 3px;
  color: #504442;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1.5px;
  background-color: #964900;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 1px;
}

.nav-link:hover { color: #964900; }
.nav-link:hover::after { width: 100%; }

.nav-link.nav-active {
  color: #964900;
}
.nav-link.nav-active::after {
  width: 100%;
}

/* Mobile menu */
#mobile-menu {
  border-top: 1px solid rgba(212, 195, 191, 0.2);
  background: rgba(255, 248, 246, 0.97);
  backdrop-filter: blur(20px);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #361f1a;
  color: #ffffff;
  padding: 0.8rem 2rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
}
.btn-primary:hover {
  background-color: #4e342e;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(54, 31, 26, 0.2);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #964900, #fc820c);
  color: #ffffff;
  padding: 0.8rem 2rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  cursor: pointer;
}
.btn-secondary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(150, 73, 0, 0.25);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #2b1611;
  padding: 0.8rem 2rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1.5px solid rgba(212, 195, 191, 0.5);
  transition: all 0.2s ease;
  cursor: pointer;
}
.btn-outline:hover {
  border-color: #361f1a;
  background-color: #fff0ed;
}

/* ============================================================
   SHADOWS & CARDS
   ============================================================ */

.editorial-shadow {
  box-shadow: 0 24px 48px -12px rgba(43, 22, 17, 0.08);
}

.card-shadow {
  box-shadow: 0 4px 24px rgba(43, 22, 17, 0.06);
}

/* ============================================================
   MENU — CATEGORY CARDS (menu.html)
   ============================================================ */

.menu-cat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.75rem;
  border-radius: 1rem;
  background: #fff0ed;
  border: 1px solid rgba(212, 195, 191, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  color: #2b1611;
}

.menu-cat-card:hover {
  background: linear-gradient(135deg, #964900 0%, #fc820c 100%);
  color: #ffffff;
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(150, 73, 0, 0.22);
  border-color: transparent;
}

.menu-cat-card .cat-icon {
  color: #964900;
  transition: color 0.3s ease;
}
.menu-cat-card:hover .cat-icon { color: #ffffff; }

.menu-cat-card .cat-arrow {
  color: #827471;
  transition: color 0.3s ease, transform 0.3s ease;
}
.menu-cat-card:hover .cat-arrow {
  color: #ffffff;
  transform: translateX(4px);
}

.menu-cat-card .cat-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: #964900;
  color: #ffffff;
  transition: background 0.3s ease;
}
.menu-cat-card:hover .cat-badge {
  background: rgba(255,255,255,0.25);
}

/* ============================================================
   MENU — ITEM ROWS (pages tipo colazione, gelateria, etc.)
   ============================================================ */

.menu-section {
  margin-bottom: 4rem;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.section-heading::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: rgba(212, 195, 191, 0.35);
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 0.5rem;
  margin: 0 -0.5rem;
  border-bottom: 1px solid rgba(212, 195, 191, 0.2);
  gap: 2rem;
  border-radius: 0.5rem;
  transition: background 0.2s ease;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: rgba(252, 130, 12, 0.05); }

.menu-item-info { flex: 1; min-width: 0; }

.menu-item-name {
  font-family: 'Epilogue', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #361f1a;
  line-height: 1.4;
}

.menu-item-desc {
  font-size: 0.8rem;
  color: #504442;
  margin-top: 0.3rem;
  font-style: italic;
  line-height: 1.5;
}

.menu-item-price {
  font-family: 'Epilogue', sans-serif;
  font-weight: 700;
  color: #964900;
  white-space: nowrap;
  font-size: 1rem;
  padding-top: 0.15rem;
}

.menu-item-tags {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}
.tag-green  { background: #e8f5e9; color: #2e7d32; }
.tag-blue   { background: #e3f2fd; color: #1565c0; }
.tag-orange { background: #fff3e0; color: #e65100; }
.tag-red    { background: #fce4ec; color: #c62828; }

/* ============================================================
   PAGE HERO (intestazione sezioni interne)
   ============================================================ */

.page-hero {
  padding-top: 9rem;
  padding-bottom: 4rem;
  text-align: center;
}

.page-hero .hero-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #964900;
  display: block;
  margin-bottom: 1rem;
}

.page-hero h1 {
  font-family: 'Epilogue', sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  color: #361f1a;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.page-hero .hero-sub {
  margin-top: 1.25rem;
  color: #504442;
  font-size: 1rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* ============================================================
   MENU CATEGORY BAR (sticky sotto la nav)
   ============================================================ */

.menu-bar {
  position: sticky;
  top: 5rem; /* h-20 della nav */
  z-index: 40;
  background: rgba(255, 248, 246, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(212, 195, 191, 0.25);
}

.menu-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.6rem 1.5rem;
  max-width: 80rem;
  margin: 0 auto;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .menu-bar {
    position: sticky;
    top: 5rem;
  }
  /* Sfumature laterali per indicare scroll */
  .menu-bar::before,
  .menu-bar::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 32px;
    z-index: 2;
    pointer-events: none;
  }
  .menu-bar::before {
    left: 0;
    background: linear-gradient(to right, rgba(255, 248, 246, 0.95), transparent);
  }
  .menu-bar::after {
    right: 0;
    background: linear-gradient(to left, rgba(255, 248, 246, 0.95), transparent);
  }
  .menu-bar-inner {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .menu-bar-inner::-webkit-scrollbar { display: none; }
}

.menu-bar a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #504442;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.menu-bar a:hover {
  background: #fff0ed;
  color: #964900;
}

.menu-bar a.menu-bar-active {
  background: #361f1a;
  color: #ffffff;
}

.menu-bar a .material-symbols-outlined {
  font-size: 1rem;
}

@media (max-width: 768px) {
  .menu-bar-inner { padding: 0.5rem 2rem; }
  .menu-bar a { padding: 0.35rem 0.65rem; font-size: 0.62rem; }

}

/* ============================================================
   ALLERGENI BANNER
   ============================================================ */

.allergeni-banner {
  background: #ffe9e4;
  border-top: 1px solid rgba(212, 195, 191, 0.3);
  padding: 3rem 1.5rem;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  background-color: #361f1a;
  color: #ffffff;
}

/* ============================================================
   FORM STYLES (contatti)
   ============================================================ */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #504442;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid rgba(212, 195, 191, 0.5);
  border-radius: 0.5rem;
  background: #ffffff;
  color: #2b1611;
  font-family: 'Manrope', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #964900;
  box-shadow: 0 0 0 3px rgba(150, 73, 0, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* ============================================================
   GALLERY — MARQUEE INFINITO
   ============================================================ */

@keyframes galleryLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes galleryRight {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

.gallery-strip {
  overflow: hidden;
}

.gallery-track {
  display: flex;
  gap: 0.375rem;
  width: max-content;
  will-change: transform;
}

.gallery-track--left {
  animation: galleryLeft 38s linear infinite;
}
.gallery-track--right {
  animation: galleryRight 44s linear infinite;
}

/* Pausa su hover (desktop) */
.gallery-strip:hover .gallery-track {
  animation-play-state: paused;
}

/* Rispetta preferenze riduzione movimento */
@media (prefers-reduced-motion: reduce) {
  .gallery-track { animation: none; }
}

.gallery-item {
  flex: none;
  width: 260px;
  height: 240px;
  overflow: hidden;
  border-radius: 0.5rem;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
  display: block;
}

.gallery-strip:hover .gallery-item img {
  transform: scale(1.04);
}

@media (max-width: 640px) {
  .gallery-item { width: 180px; height: 170px; }
}

/* ============================================================
   HERO — ENTRANCE STAGGER (homepage)
   ============================================================ */

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.hero-anim {
  opacity: 0;
  animation: heroIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--hi, 0) * 0.12s + 0.2s);
}


/* ============================================================
   SCROLL REVEAL
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transition-delay: calc(var(--reveal-delay, 0) * 55ms);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   PAGE HERO — ENTRANCE ANIMATION
   ============================================================ */

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-hero .hero-label {
  animation: heroFadeUp 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.05s both;
}
.page-hero h1 {
  animation: heroFadeUp 0.65s cubic-bezier(0.4, 0, 0.2, 1) 0.15s both;
}
.page-hero .hero-sub {
  animation: heroFadeUp 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.28s both;
}
.page-hero .back-link,
.page-hero .hero-actions {
  animation: heroFadeUp 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.38s both;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #fff8f6; }
::-webkit-scrollbar-thumb { background: #d4c3bf; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #964900; }

/* ============================================================
   FOCUS VISIBLE
   ============================================================ */

:focus-visible {
  outline: 2px solid #964900;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   UTILITY
   ============================================================ */

.container-site {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 768px) {
  .page-hero { padding-top: 7rem; }
  .menu-cat-card { padding: 1.25rem 1.25rem; }
  .section-heading { gap: 0.75rem; }
  .allergeni-banner { padding: 2rem 1rem; }
}

@media (max-width: 480px) {
  .gallery-item { width: 150px; height: 140px; }
}
