/* ============================================
   TucCiPiaci Vending Landing — Mobile-first
   ============================================ */

:root {
  --green: #7F9C40;
  --green-dark: #6A8534;
  --green-soft: #BFCDA0;
  --green-bg: #EEF1E1;

  --orange: #F2A23A;
  --orange-dark: #D88820;
  --orange-soft: #F9D19D;

  --ink: #1B1B14;
  --ink-soft: #4B4B40;
  --paper: #FBF8F1;
  --paper-warm: #F4EFE2;
  --white: #ffffff;

  --radius: 16px;
  --radius-lg: 28px;

  --shadow-sm: 0 2px 8px rgba(27, 27, 20, .06);
  --shadow: 0 12px 32px -12px rgba(27, 27, 20, .18);
  --shadow-lg: 0 30px 60px -20px rgba(27, 27, 20, .25);

  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
html, body { overflow-x: hidden; }

/* ============================================
   FULL-SCREEN SECTIONS
   ============================================ */
.screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

/* ============================================
   NAVBAR — tall, logos prominent
   ============================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(251, 248, 241, .92);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(27, 27, 20, .06);
}
.navbar__logo img {
  height: 56px;
  width: auto;
  object-fit: contain;
}
.navbar__center {
  display: flex;
  align-items: center;
}
.navbar__logo--right img {
  height: 44px;
  opacity: .85;
}

/* Language switch — two flags side by side */
.lang-switch {
  display: flex;
  border: 2px solid var(--green-soft);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
}
.lang-flag {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: all .2s var(--ease);
}
.lang-flag span:first-child { font-size: 18px; line-height: 1; }
.lang-flag__code { letter-spacing: .06em; font-size: 12px; }
.lang-flag--active {
  background: var(--green);
  color: var(--white);
}
.lang-flag--active .lang-flag__code { color: var(--white); }
.lang-flag:not(.lang-flag--active):hover {
  background: var(--green-bg);
}

/* ============================================
   HERO — "Dove Sei?" with text shadow
   ============================================ */
.hero-screen {
  padding-top: 100px;
  gap: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(242,162,58,.08), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(127,156,64,.10), transparent 50%),
    var(--paper);
}

.hero-question {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: clamp(56px, 14vw, 110px);
  color: var(--ink);
  margin: 0 0 40px;
  letter-spacing: -.03em;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 4px 12px rgba(27, 27, 20, .12),
    0 12px 40px rgba(127, 156, 64, .15);
}

/* Location buttons — stacked vertically, wide */
.locations-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 480px;
}

.loc-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  text-decoration: none;
  color: inherit;
  border: 2px solid transparent;
}
.loc-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.loc-btn--lum {
  background: linear-gradient(135deg, var(--green-bg), var(--white));
  border-color: var(--green-soft);
}
.loc-btn--gdc {
  background: linear-gradient(135deg, #fff5e6, var(--white));
  border-color: var(--orange-soft);
}
.loc-btn--future {
  background: var(--paper-warm);
  opacity: .6;
  cursor: default;
  padding: 16px 24px;
}
.loc-btn--future:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.loc-btn__name {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
}
.loc-btn__name--small {
  font-size: 15px;
  font-weight: 500;
  font-style: italic;
}
.loc-btn__city {
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.loc-btn__label-soon {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

/* ============================================
   VENDING MACHINE — animated digital twin
   ============================================ */
.hero-vending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}

.vending-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: #16160f;
  color: rgba(255,255,255,.7);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
}
.vending-badge__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(127,156,64,.9);
  animation: pulse-dot 2s ease-in-out infinite;
}
.vending-badge__id { color: var(--orange); }
.vending-badge__label { color: rgba(255,255,255,.85); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(127,156,64,.8); }
  50% { opacity: .3; box-shadow: 0 0 2px rgba(127,156,64,.3); }
}

.vending {
  width: 240px;
  background: linear-gradient(180deg, #2c2c22 0%, #16160f 100%);
  border-radius: 20px;
  padding: 14px 12px 18px;
  box-shadow:
    var(--shadow-lg),
    inset 0 2px 0 rgba(255,255,255,.06),
    inset 0 -2px 0 rgba(0,0,0,.5);
  position: relative;
  animation: vending-float 4s ease-in-out infinite;
}
@keyframes vending-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.vending::before,
.vending::after {
  content: '';
  position: absolute;
  top: 14px; bottom: 80px;
  width: 3px;
  border-radius: 3px;
}
.vending::before {
  left: 3px;
  background: var(--green);
  animation: strip-glow-green 3s ease-in-out infinite;
}
.vending::after {
  right: 3px;
  background: var(--orange);
  animation: strip-glow-orange 3s ease-in-out infinite 1.5s;
}
@keyframes strip-glow-green {
  0%, 100% { opacity: .5; box-shadow: 0 0 4px rgba(127,156,64,.3); }
  50% { opacity: 1; box-shadow: 0 0 10px rgba(127,156,64,.8); }
}
@keyframes strip-glow-orange {
  0%, 100% { opacity: .5; box-shadow: 0 0 4px rgba(242,162,58,.3); }
  50% { opacity: 1; box-shadow: 0 0 10px rgba(242,162,58,.8); }
}

.vending__top {
  background: var(--paper);
  border-radius: 8px;
  padding: 6px 10px;
  text-align: center;
  margin-bottom: 8px;
}
.vending__logo {
  height: 28px;
  width: auto;
  margin: 0 auto;
}

.vending__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  padding: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.4)), #0a0a07;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.05);
  margin-bottom: 6px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.6);
}

.vending-slot {
  aspect-ratio: 1;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.01));
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all .4s var(--ease);
}
.vending-slot::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(255,255,255,.12), transparent);
  pointer-events: none;
}
.vending-slot__pos {
  position: absolute;
  top: 1px; left: 2px;
  font-size: 6px;
  color: rgba(255,255,255,.45);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  z-index: 2;
}
.vending-slot__stock {
  position: absolute;
  bottom: 1px; right: 2px;
  font-size: 6px;
  color: var(--green);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 700;
  z-index: 2;
}
.vending-slot__cat {
  font-size: 9px;
  color: rgba(255,255,255,.6);
  font-weight: 600;
  z-index: 1;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Filled slot: subtle scan animation */
.vending-slot--has {
  animation: slot-scan 6s ease-in-out infinite;
  animation-delay: var(--scan-delay, 0s);
}
.vending-slot--has .vending-slot__cat { color: var(--orange-soft); }
@keyframes slot-scan {
  0%, 85%, 100% { border-color: rgba(255,255,255,.06); }
  90% { border-color: rgba(127,156,64,.4); }
}

.vending-slot--empty {
  background: rgba(0,0,0,.4);
  border-style: dashed;
}
.vending-slot--empty .vending-slot__stock { color: #d05050; }

/* Counter under grid */
.vending__counter {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}
.vending__counter-num {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--orange);
}
.vending__counter-label {
  font-size: 10px;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.vending__bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.vending__display {
  flex: 1;
  background: #000;
  color: var(--green);
  font-size: 9px;
  padding: 6px 10px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.8);
}
.vending__display-dot {
  width: 5px; height: 5px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(127,156,64,.8);
  animation: pulse-dot 2s ease-in-out infinite;
}
.vending__slot-out {
  width: 56px; height: 22px;
  background: linear-gradient(180deg, rgba(0,0,0,.7), rgba(0,0,0,.4));
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.06);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.6);
}

/* ============================================
   PRODUCTS SECTION
   ============================================ */
.products-screen {
  padding: 100px 16px 40px;
  justify-content: flex-start;
  scroll-margin-top: 60px;
  gap: 0;
}
.products-screen--alt {
  background: var(--paper-warm);
}

.products-header {
  text-align: center;
  margin-bottom: 24px;
}
.products-title {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: clamp(28px, 6vw, 42px);
  color: var(--ink);
  margin: 0 0 4px;
}
.products-subtitle {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 10px;
}
.products-count {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--green-bg);
  color: var(--green-dark);
}

/* Filter bar */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 10px 22px;
  border: 2px solid var(--green-soft);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.filter-btn:hover {
  border-color: var(--green);
  background: var(--green-bg);
}
.filter-btn--active {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

/* Carousel */
.carousel-wrap {
  position: relative;
  width: 100%;
  max-width: 500px;
  flex: 1;
  display: flex;
  align-items: center;
}
.carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 44px 16px;
  scrollbar-width: none;
  width: 100%;
}
.carousel::-webkit-scrollbar { display: none; }

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid var(--green-soft);
  background: var(--white);
  color: var(--green-dark);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s var(--ease);
  box-shadow: var(--shadow-sm);
  line-height: 1;
}
.carousel-arrow:hover {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.carousel-arrow--left { left: 0; }
.carousel-arrow--right { right: 0; }

/* ============================================
   PRODUCT CARD — large, almost full screen
   ============================================ */
.product-card {
  flex: 0 0 calc(100vw - 120px);
  max-width: 400px;
  scroll-snap-align: center;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .3s var(--ease);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-3px);
}

.product-card__image {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--paper-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card__image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  opacity: .4;
}
.product-card__image-placeholder svg {
  width: 48px; height: 48px;
}
.product-card__image-placeholder span {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.product-card__cat-badge {
  position: absolute;
  top: 12px; right: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.product-card__cat-badge--primi {
  background: var(--orange-soft);
  color: var(--orange-dark);
}
.product-card__cat-badge--secondi {
  background: #e8d4f0;
  color: #6b3a7d;
}
.product-card__cat-badge--altro {
  background: var(--green-soft);
  color: var(--green-dark);
}

.product-card__body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card__name {
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}

.product-card__vending-pos {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  background: #16160f;
  color: var(--orange);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .06em;
  align-self: flex-start;
}
.product-card__vending-pos::before {
  content: "N.";
  color: rgba(255,255,255,.5);
  font-weight: 600;
}

.product-card__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.product-card__qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  background: var(--green-bg);
  color: var(--green-dark);
}

.product-card__ingredients {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.5;
}

.product-card__nutrition {
  padding-top: 4px;
  font-size: 13px;
  color: var(--ink-soft);
  opacity: .5;
  font-style: italic;
}

/* Maps link */
.maps-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s var(--ease);
  box-shadow: 0 6px 16px -6px rgba(127,156,64,.5);
}
.maps-link:hover {
  transform: translateY(-2px);
  background: var(--green-dark);
  box-shadow: 0 8px 20px -6px rgba(127,156,64,.6);
}
.maps-link svg {
  flex-shrink: 0;
}

/* Empty carousel state */
.carousel-empty {
  width: 100%;
  padding: 48px 24px;
  text-align: center;
}
.carousel-empty p {
  font-family: "Fraunces", serif;
  font-size: 20px;
  color: var(--ink-soft);
  opacity: .5;
  font-style: italic;
  margin: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 24px;
}
.site-footer__inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.site-footer__logo {
  height: 28px;
  width: auto;
  filter: brightness(0) invert(1) opacity(.7);
}
.site-footer__copy { font-size: 13px; opacity: .6; }
.site-footer__links { display: flex; gap: 16px; }
.site-footer__links a {
  color: var(--paper);
  font-size: 13px;
  opacity: .7;
  transition: opacity .2s, color .2s;
}
.site-footer__links a:hover { opacity: 1; color: var(--orange); }

/* ============================================
   REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 768px) {
  .navbar { padding: 18px 36px; }
  .navbar__logo img { height: 64px; }
  .navbar__logo--right img { height: 50px; }

  .hero-question { font-size: 90px; }
  .locations-stack { max-width: 520px; }
  .loc-btn { padding: 28px 32px; }
  .loc-btn__name { font-size: 26px; }
  .vending { width: 280px; }
  .carousel-wrap { max-width: 700px; }
  .product-card { flex: 0 0 360px; }
  .product-card__name { font-size: 24px; }
}

@media (min-width: 1024px) {
  .carousel-wrap { max-width: 900px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .vending { animation: none; }
}
