* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #f6f6f6;
    color: #222;

    /* Reserve space so the fixed CTA never covers footer/content */
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

header {
    background: white;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #eee;
}

#hamburger {
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
}

nav {
    position: absolute;
    top: 60px;
    left: 0;
    background: white;
    width: 100%;
    border-bottom: 1px solid #ddd;
}

nav.hidden {
    display: none;
}

nav ul {
    list-style: none;
}

nav li {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

nav a {
    text-decoration: none;
    color: #222;
}

/* HERO: fixed height + full image width (no side bars) + blurred background */
#hero {
  width: 100%;
  height: 420px;          /* DESKTOP height (можеш да смениш на 360/480) */
  max-width: 900px;       /* да не е на цяла ширина на комп */
  margin: 12px auto 0;    /* център */
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: #eaeaea;
}

/* blurred background (fills whole hero) */
#hero .hero-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: blur(18px);
  transform: scale(1.12); /* да не се виждат ръбове от blur */
  opacity: 0.95;
}

#hero .hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.12); /* леко потъмняване за контраст */
}

/* foreground media: full WIDTH visible, height auto => “въздух” горе/долу */
#hero .hero-fg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;     /* център по вертикала */
  justify-content: center; /* център по хоризонтала */
}

#hero .hero-fg img,
#hero .hero-fg video {
  width: 100%;
  height: auto;            /* ключовото: височината става променлива */
  max-height: 100%;        /* да не излиза извън контейнера */
  display: block;
}

.category-section {
    margin-top: 20px;

    /* когато скролваме към категория, оставяме място за sticky header-а */
    scroll-margin-top: 65px;
}

.category-title {
    padding: 10px;
    font-size: 22px;
    background: white;
    border-bottom: 1px solid #eee;
}

.item {
    background: white;
    margin-bottom: 10px;
}

.item img {
    width: 100%;
    display: block;
}

.item-info {
    padding: 10px;
}

.title {
    font-size: 18px;
    font-weight: bold;
}

.prices {
    margin-top: 5px;
}

.ingredients {
    margin-top: 5px;
    font-size: 14px;
    color: #555;
}

#cta{
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;

    display: flex;
    justify-content: center;
    gap: 10px;

    padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));

    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,0.08);
}

#cta a {
    flex: 1;
    max-width: 440px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    background: #000;
    color: #fff;

    padding: 14px 12px;
    text-decoration: none;
    border-radius: 10px;

    font-weight: 800;
    font-size: 16px;
    line-height: 1;
}

footer {
    width: min(900px, calc(100% - 20px));

    /* увеличаваме долния margin, за да не може CTA никога да го закрие */
    margin: 20px auto calc(20px + 88px + env(safe-area-inset-bottom, 0px)) auto;

    background: white;
    padding: 15px;

    border: 1px solid #eee;
    border-radius: 12px;
}

.footer-inner {
  display: grid;
  gap: 10px;
}

.footer-addr {
  font-weight: 800;
  font-size: 15px;
}

.footer-note {
  color: #555;
  font-size: 14px;
}

.footer-map-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 12px 12px;
  border-radius: 10px;
  text-decoration: none;

  background: #000;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}

.footer-map {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eee;
}

/* Embedded map preview */
.footer-map-embed {
  width: 100%;
  height: 240px; /* phone-friendly */
  border: 0;
  display: block;
}

@media (min-width: 900px) {
  .footer-map-embed {
    height: 300px;
  }
}

.item-img {
  width: 100%;
  display: block;
  background: #eaeaea;
}

/* PRODUCT GALLERY (2+ images) */
.gallery {
  position: relative;
  width: 100%;
  /* height is set by JS based on the tallest image ratio for this item */
  overflow: hidden;
}

/* scroll viewport (swipe on mobile) */
.gallery-viewport {
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;

  /* hide scrollbars */
  scrollbar-width: none;          /* Firefox */
}
.gallery-viewport::-webkit-scrollbar { display: none; } /* WebKit */

.gallery-track {
  height: 100%;
  display: flex;
}

/* each slide fills the viewport width */
.gallery-slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;

  display: flex;
  align-items: center;   /* vertical center (letterbox) */
  justify-content: center;
}

.gallery-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;

  /* IMPORTANT: no crop, no stretch */
  object-fit: contain;
}

/* Dots + counter */
.gallery-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.gallery-dots {
  display: inline-flex;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
}
.gallery-dot.is-active {
  background: rgba(255,255,255,0.95);
}

.gallery-count {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Desktop arrows */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255,255,255,0.85);
  box-shadow: 0 10px 22px rgba(0,0,0,0.18);
  display: none;          /* shown on desktop */
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

.gallery-arrow.prev { left: 10px; }
.gallery-arrow.next { right: 10px; }

@media (min-width: 900px) {
  .gallery-viewport {
    overflow-x: hidden;   /* no visible horizontal scrolling on desktop */
  }
  .gallery-arrow {
    display: inline-flex;
    pointer-events: auto;
  }
  .gallery-ui {
    bottom: 10px;
  }
}

.price { margin-right: 10px; }
.subtitle { margin-top: 4px; color: #666; }
.meta { margin-top: 4px; color: #444; }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;

    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.brand-logo {
    max-height: 44px;
    width: auto;
    display: none; /* показва се само ако има logo */
}

.brand-title {
    font-size: 18px;
    font-weight: 800; /* ще го override-нем от JSON ако е зададено */
    letter-spacing: 0.2px;
    display: none; /* показва се само ако има brandTitle */
}

/* HERO cross-fade transitions (2 layers, no white flash) */
#hero {
  position: relative; /* safety: layers rely on this */
}

/* two overlay layers that cross-fade */
#hero .hero-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
}

#hero .hero-layer.is-active {
  opacity: 1;
}

/* keep existing hero-bg / hero-fg rules working inside layers */
#hero .hero-layer .hero-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  filter: blur(18px);
  transform: scale(1.12);
  opacity: 0.95;
}

#hero .hero-layer .hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.12);
}

#hero .hero-layer .hero-fg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#hero .hero-layer .hero-fg img,
#hero .hero-layer .hero-fg video {
  width: 100%;
  height: auto;
  max-height: 100%;
  display: block;
}

@media (min-width: 900px) {
  header,
  #content,
  footer {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }

  #cta {
    left: auto;
    right: 18px;
    bottom: 18px;

    width: 260px;
    padding: 10px;

    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);

    background: rgba(255, 255, 255, 0.92);
    border-top: none;
  }

  #cta a {
    max-width: none;
    width: 100%;
    border-radius: 12px;
  }
}

body {
  -webkit-user-select: none; /* Safari / iOS */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* IE/Edge legacy */
  user-select: none;

  /* iOS Safari: also reduce long-press text callout */
  -webkit-touch-callout: none;
}

img { -webkit-user-drag: none; }
