:root {
  --brand: #ff9900;
  --text: #ffffff;
  --shadow: rgba(0,0,0,0.3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Fredoka One', cursive;
  overflow-x: hidden;
  background: #ff9900;
  color: var(--text);
  transition: background 0.8s ease;
}

header {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  gap: 8px;
}

.lang-btn {
  background: rgba(255,255,255,0.95);
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  color: var(--brand);
  font-family: 'Fredoka One', cursive;
  font-size: 14px;
  letter-spacing: 0.5px;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
.lang-btn:hover { transform: translateY(-1px); }
.lang-btn:active { transform: translateY(0px) scale(0.98); }
.lang-btn:focus-visible { outline: 3px solid rgba(255,255,255,0.8); outline-offset: 2px; }
.lang-btn.is-active { background: #ffffff; opacity: 1; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }

#loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, #ffcc00, #ff9900);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loader-text { text-align: center; margin-top: 30px; font-size: 24px; }

.oil-track {
  position: relative;
  width: 85%;
  max-width: 600px;
  height: 90px;
  background: rgba(255,255,255,0.2);
  border-radius: 45px;
  overflow: visible;
}

#oil-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: #FFD700;
  border-radius: 45px;
  box-shadow: 0 0 20px #fff;
}

.surfer {
  position: absolute;
  width: 130px;
  left: 0;
  bottom: -15px;
  transform: translateX(-50%);
  z-index: 10;
}

.scene {
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 100px 10%;
}

.content-box { flex: 1.2; padding: 20px; }
.content-box h2 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin: 0;
  text-shadow: 3px 3px 0px rgba(0,0,0,0.1);
}
.content-box p {
  font-size: clamp(1rem, 3vw, 1.4rem);
  margin-top: 20px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-weight: 700;
  line-height: 1.4;
  opacity: 0.92;
}

.image-box { flex: 0.8; display: flex; justify-content: center; }
.image-box img {
  width: 100%;
  max-width: 420px;
  filter: drop-shadow(0 20px 40px var(--shadow));
}

.pm-feature-rail {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 900;
}

.feature-btn {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: transform .25s ease, filter .25s ease;
}
.feature-btn img {
  width: min(34vw, 190px);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
.feature-btn:hover { transform: translateX(5px) scale(1.03); filter: brightness(1.05); }

#lab-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 25px);
  background: rgba(26, 26, 26, 0.95);
  color: #fff;
  padding: 12px 18px;
  border-radius: 999px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  letter-spacing: .2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 1200;
}
#lab-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.no-gsap .image-box img {
  opacity: 0;
  transform: scale(0.3);
  transition: transform 700ms cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 500ms ease;
  will-change: transform, opacity;
}
.no-gsap .image-box img.is-inview { opacity: 1; transform: scale(1); }

.social-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  gap: 30px;
}

.social-card img {
  width: clamp(260px, 78vw, 520px);
  max-width: none;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.social-card:hover img { transform: scale(1.15) rotate(5deg); }

.center-contacts { text-align: center; flex: 1.5; }
.footer-title { font-size:3rem; margin-bottom:40px; }
.contact-links { margin-top: 30px; display: flex; flex-direction: column; gap: 15px; }
.fb-link, .mail-link {
  color: #fff;
  text-decoration: none;
  font-size: 1.5rem;
  padding: 10px 25px;
  border: 3px solid var(--brand);
  border-radius: 50px;
  transition: all 0.3s ease;
}
.fb-link:hover, .mail-link:hover { background: var(--brand); transform: translateY(-5px); }

.footer-scene { display: flex; flex-direction: column; }
.pm-copyright {
  opacity: .6;
  font-size: 13px;
  text-align: center;
  margin-top: auto;
  padding-bottom: 20px;
}

#pm-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 9999;
  font-size: 0;
  background-color: transparent;
  background-image: url("../assets/pastamasta_chat.webp");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  box-shadow: 0 8px 26px rgba(0,0,0,.35);
}

#pm-box {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 104px;
  width: 320px;
  height: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.15);
  z-index: 9999;
  padding: 12px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #222;
}
#pm-title, #pm-log b { color: #ff9900; }
#pm-title { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 8px; }
#pm-log {
  height: 320px;
  overflow-y: auto;
  font-size: 14px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 8px;
}
#pm-log > div { background: #f6f6f6; padding: 6px 8px; border-radius: 10px; margin-bottom: 6px; }
#pm-input {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #ddd;
  color: #222;
  background: #fff;
}
#pm-input:focus { outline: 2px solid rgba(255,153,0,0.45); border-color: rgba(255,153,0,0.65); }

.recipes-page,
.recipe-detail-page {
  background: linear-gradient(160deg, #1f2833, #36454f 55%, #202830);
  min-height: 100vh;
  color: #fff;
}

.page-shell { max-width: 1100px; margin: 0 auto; padding: 110px 24px 40px; }
.page-intro h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0 0 10px; }
.page-intro p { font-family: system-ui, sans-serif; opacity: .9; margin: 0 0 28px; }

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.recipe-card {
  background: rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 12px;
  text-decoration: none;
  color: #fff;
  transition: transform .2s ease, background .2s ease;
}
.recipe-card:hover { transform: translateY(-4px); background: rgba(255,255,255,.14); }
.recipe-card img { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; }
.recipe-card h3 { margin: 12px 0 6px; }
.recipe-card p { margin: 0; opacity: .85; font-family: system-ui, sans-serif; }

.recipe-hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 26px;
  align-items: start;
}
.recipe-hero img { width: 100%; border-radius: 18px; box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.recipe-story,
.recipe-ingredients,
.recipe-steps {
  margin-top: 24px;
  background: rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 18px;
}
.recipe-story p,
.recipe-ingredients li,
.recipe-steps li {
  font-family: system-ui, sans-serif;
  line-height: 1.65;
}
.recipe-story-top {
  margin-top: 18px;
  max-height: 68vh;
  overflow: auto;
}
.recipe-story-top p {
  white-space: pre-line;
}
.recipe-story p + p { margin-top: 14px; }
.recipe-notes ul { margin: 0; padding-left: 20px; }
.nav-links { display: flex; gap: 12px; margin-top: 18px; }
.nav-links a {
  color: #fff;
  text-decoration: none;
  border: 2px solid rgba(255,255,255,.45);
  border-radius: 999px;
  padding: 8px 14px;
}

@media (max-width: 768px) {
  /* ✅ Връщаме оригиналния mobile layout (това ти оправя “разтягането”) */
  .scene { flex-direction: column; text-align: center; padding: 90px 7%; }
  .image-box img { max-width: 250px; margin-top: 30px; }
  .social-grid { flex-direction: column; }
  .social-card img { width: min(78vw, 340px); }

  /* ✅ Двата големи бутона – долу център като “преди” */
  .pm-feature-rail {
    left: 50%;
    top: auto;
    bottom: 8px;
    transform: translateX(-50%);
    flex-direction: row;
  }
  .feature-btn img { width: min(44vw, 190px); }

  /* ✅ Само chat бутона – горе вляво (само на мобилно) */
  #pm-btn {
    top: 12px;
    left: 12px;

    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));

    right: auto;
    bottom: auto;
    width: 62px;
    height: 62px;
  }

  /* ✅ Chat прозорецът под бутона */
  #pm-box {
    top: 84px;
    left: 10px;
    right: 10px;

    top: calc(max(12px, env(safe-area-inset-top)) + 72px);
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));

    bottom: auto;
    width: auto;
    height: min(62vh, 420px);
  }
}
@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
  .social-card img, .fb-link, .mail-link, .lang-btn, .feature-btn { transition: none; }
}
