/* =====================================================================
   3 Monkey Dessert's & Sandwiches — Digital Menu
   Display-only (no cart). Mobile-first, performance-focused stylesheet.
   Animations use transform/opacity only to stay on the compositor.
   ===================================================================== */

/* ----------------------------- Design Tokens ----------------------------- */
:root {
  /* Color palette */
  --c-primary: #E11D2A;          /* Red   */
  --c-primary-dark: #B3121E;
  --c-primary-soft: #FCE8E9;
  --c-white: #FFFFFF;            /* Secondary */
  --c-cream: #FBF6EE;            /* Background */
  --c-cream-2: #F4ECDF;
  --c-ink: #221A17;             /* Primary text */
  --c-ink-soft: #6F635C;        /* Secondary text */
  --c-line: rgba(34, 26, 23, 0.08);

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Shadows (soft, layered) */
  --sh-sm: 0 1px 2px rgba(34, 26, 23, 0.06), 0 2px 6px rgba(34, 26, 23, 0.05);
  --sh-md: 0 6px 16px rgba(34, 26, 23, 0.08), 0 2px 6px rgba(34, 26, 23, 0.05);
  --sh-lg: 0 18px 40px rgba(34, 26, 23, 0.16);
  --sh-primary: 0 8px 22px rgba(225, 29, 42, 0.32);

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;

  /* Transitions */
  --t-fast: 140ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 240ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 420ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --maxw: 720px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ----------------------------- Reset ----------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--c-ink);
  background: var(--c-cream);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: calc(var(--safe-bottom) + var(--s-10));
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }

/* The hidden attribute must always win over component display rules
   (e.g. .row { display: grid }) so search filtering truly hides items. */
[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--c-primary);
  color: #fff;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: top var(--t-base);
}
.skip-link:focus { top: var(--s-3); }

/* ----------------------------- Hero ----------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: calc(env(safe-area-inset-top, 0px) + var(--s-10)) var(--s-5) var(--s-8);
  text-align: center;
  color: #fff;
  background: var(--c-primary);
}
/* Subtle glow behind the logo (kept clean, no bottom band) */
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 90%;
  background: radial-gradient(60% 100% at 50% 30%, rgba(255,255,255,0.16), transparent 70%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  animation: hero-rise var(--t-spring) both;
}

.hero__logo {
  width: 120px;
  height: 120px;
  margin: 0 auto var(--s-4);
  padding: var(--s-2);
  object-fit: contain;
  background: var(--c-white);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
}

.hero__title {
  font-size: clamp(1.6rem, 6vw, 2.3rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero__title span { font-weight: 600; opacity: 0.95; }

.hero__slogan {
  margin-top: var(--s-3);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.92;
}

.hero__social {
  margin-top: var(--s-5);
  display: flex;
  justify-content: center;
  gap: var(--s-3);
}
.hero__social-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--r-pill);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-decoration: none;
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
@media (hover: hover) {
  .hero__social-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  }
}
.hero__social-btn:active { transform: scale(0.92); }
.hero__social-btn svg { width: 22px; height: 22px; }

/* ----------------------------- Search ----------------------------- */
.search {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) var(--s-3);
}

.search__field {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  padding: var(--s-3) var(--s-4);
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.search__field:focus-within {
  box-shadow: var(--sh-md), 0 0 0 3px var(--c-primary-soft);
}

.search__icon { width: 22px; height: 22px; color: var(--c-ink-soft); flex: none; }

.search__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--c-ink);
}
.search__input:focus { outline: none; }
.search__input::placeholder { color: var(--c-ink-soft); }
/* Hide the browser's native clear/decoration controls so only our custom × shows. */
.search__input::-webkit-search-cancel-button,
.search__input::-webkit-search-decoration,
.search__input::-webkit-search-results-button,
.search__input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search__clear {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  background: var(--c-cream-2);
  color: var(--c-ink-soft);
  border-radius: var(--r-pill);
}
.search__clear svg { width: 16px; height: 16px; }

/* ----------------------------- Featured (Öne Çıkan) ----------------------------- */
.featured {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-4) 0 var(--s-2);
}
.featured__title {
  font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--c-primary);
  margin-bottom: var(--s-4);
}

.featured__track {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-2) var(--s-4) var(--s-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.featured__track::-webkit-scrollbar { display: none; }

.feat-card {
  flex: 0 0 78%;
  max-width: 320px;
  scroll-snap-align: start;
  background: var(--c-white);
  border-radius: var(--r-xl);
  padding: var(--s-4);
  box-shadow: var(--sh-md);
  animation: card-in var(--t-base) both;
}
@media (min-width: 600px) {
  .feat-card { flex-basis: 46%; }
}

.feat-card__head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}
.feat-card__emoji { font-size: 1.25rem; line-height: 1; }
.feat-card__name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.feat-card__media {
  position: relative;
  display: block;
  width: 100%;
  padding: var(--s-4);
  border: none;
  background: var(--c-white);
  border-radius: var(--r-lg);
  aspect-ratio: 16 / 11;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--c-line);
}
.feat-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--t-base);
}
@media (hover: hover) {
  .feat-card__media:hover .feat-card__img { transform: scale(1.05); }
}

.feat-card__desc {
  margin-top: var(--s-3);
  color: var(--c-ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

/* ----------------------------- Category List (Menü Kategorileri) ----------------------------- */
.cats {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-5) var(--s-4) var(--s-2);
}
.cats__title {
  font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--c-primary);
  margin-bottom: var(--s-5);
}

.cats__list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.cat-link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-4) var(--s-5);
  border: 2px solid var(--c-primary);
  background: var(--c-white);
  color: var(--c-primary);
  border-radius: var(--r-md);
  font-size: 1rem;
  font-weight: 800;
  text-align: left;
  transition: color var(--t-fast), background var(--t-fast),
              box-shadow var(--t-fast), transform var(--t-fast);
}
.cat-link:active { transform: scale(0.99); }
.cat-link.is-active {
  background: var(--c-primary);
  color: #fff;
  box-shadow: var(--sh-primary);
}
.cat-link__emoji { font-size: 1.2rem; line-height: 1; }

/* ----------------------------- Menu / Sections ----------------------------- */
.menu {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-3) var(--s-4) 0;
}

.section {
  padding-top: var(--s-5);
  margin-bottom: var(--s-6);
  scroll-margin-top: var(--s-4);
}

.section__title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.section__title::before {
  content: "";
  width: 6px; height: 22px;
  border-radius: var(--r-pill);
  background: var(--c-primary);
}

.section__list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* ----------------------------- Product Row (compact) ----------------------------- */
.row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: var(--s-4);
  align-items: center;
  background: var(--c-white);
  border-radius: var(--r-lg);
  padding: var(--s-3);
  box-shadow: var(--sh-sm);
  transition: transform var(--t-base), box-shadow var(--t-base);
  animation: card-in var(--t-base) both;
}
@media (hover: hover) {
  .row:hover { transform: translateY(-2px); box-shadow: var(--sh-md); }
}

.row__media {
  width: 72px;
  height: 72px;
  padding: 6px;
  border: none;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-white);
  box-shadow: inset 0 0 0 1px var(--c-line);
}
.row__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--t-base);
}
@media (hover: hover) {
  .row__media:hover .row__img { transform: scale(1.06); }
}

.row__body { min-width: 0; }
.row__name {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--c-primary);
  letter-spacing: -0.01em;
}
.row__desc {
  margin-top: 2px;
  color: var(--c-ink-soft);
  font-size: 0.86rem;
  line-height: 1.4;
}

.row__price {
  align-self: center;
  font-size: 1rem;
  font-weight: 800;
  color: var(--c-primary);
  white-space: nowrap;
}

/* ----------------------------- Icon button (lightbox close) ----------------------------- */
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: none;
  background: var(--c-cream-2);
  border-radius: var(--r-pill);
  color: var(--c-ink);
  transition: transform var(--t-fast), background var(--t-fast);
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 20px; height: 20px; }

/* ----------------------------- Empty State ----------------------------- */
.empty-state {
  text-align: center;
  padding: var(--s-10) var(--s-5);
  animation: fade-in var(--t-base) both;
}
.empty-state__icon {
  width: 88px; height: 88px;
  margin: 0 auto var(--s-5);
  display: grid; place-items: center;
  color: var(--c-primary);
  background: var(--c-primary-soft);
  border-radius: var(--r-xl);
}
.empty-state__icon svg { width: 44px; height: 44px; }
.empty-state__title { font-size: 1.3rem; font-weight: 800; margin-bottom: var(--s-2); }
.empty-state__text { color: var(--c-ink-soft); max-width: 320px; margin: 0 auto; }

/* ----------------------------- Lightbox ----------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 150; visibility: hidden; }
.lightbox.is-open { visibility: visible; }
.lightbox__backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity var(--t-base);
}
.lightbox.is-open .lightbox__backdrop { opacity: 1; }

.lightbox__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity var(--t-base), transform var(--t-spring);
}
.lightbox.is-open .lightbox__content { opacity: 1; transform: scale(1); }

.lightbox__close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + var(--s-4));
  right: var(--s-4);
  background: rgba(255,255,255,0.18);
  color: #fff;
  backdrop-filter: blur(6px);
}

.lightbox__stage {
  width: 100%;
  max-width: var(--maxw);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none; /* we manage pinch-zoom manually */
}
.lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--r-md);
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox__caption { color: rgba(255,255,255,0.9); margin-top: var(--s-4); font-weight: 600; }

/* ----------------------------- Footer (discreet admin link) ----------------------------- */
.site-foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-8) var(--s-4) var(--s-10);
  text-align: center;
}
.site-foot__admin {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-ink-soft);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity var(--t-fast), color var(--t-fast);
}
.site-foot__admin:hover { opacity: 1; color: var(--c-primary); }

/* ----------------------------- Keyframes ----------------------------- */
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ----------------------------- Responsive ----------------------------- */
@media (min-width: 900px) {
  :root { --maxw: 960px; }
}

/* ----------------------------- Reduced Motion ----------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
