/* ════════════════════════════════════════════════
   DIMO'S PIZZA – INTERACTIVE MENU
   style.css
   ════════════════════════════════════════════════ */

/* ─── CSS CUSTOM PROPERTIES ─────────────────────── */
:root {
  /* Colors */
  --color-bg:           #0d0d0d;
  --color-surface:      #141414;
  --color-surface-2:    #1e1e1e;
  --color-red:          #e8192c;
  --color-red-dark:     #c0141f;
  --color-white:        #ffffff;
  --color-text:         #f0ede8;
  --color-muted:        #888888;
  --color-vegan:        #5abf6e;
  --color-divider:      #2a2a2a;

  /* Typography */
  --font-display: 'Barlow Condensed', 'Impact', 'Arial Narrow', sans-serif;
  --font-body:    'Barlow', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --sp-xs:  4px;
  --sp-sm:  8px;
  --sp-md:  16px;
  --sp-lg:  24px;
  --sp-xl:  40px;
  --sp-2xl: 64px;

  /* Animation */
  --ease:              cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur-expand:        350ms;
  --dur-collapse:      260ms;
  --footer-height:     44px;
}

/* ─── RESET ──────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  font-size: 16px;
}

body {
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden; /* no body scroll when in grid view */
}

button {
  font-family: inherit;
  cursor: pointer;
}

a {
  color: var(--color-red);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul {
  list-style: none;
}

em {
  font-style: normal;
  color: var(--color-muted);
  font-size: 0.8em;
}

/* ─── MENU GRID (COLLAPSED STATE) ────────────────── */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100vw;
  height: calc(100vh - var(--footer-height));
  /* Gap-as-border technique: gap becomes the divider color */
  gap: 1px;
  background: var(--color-divider);
}

/* ─── MENU SECTION (each quadrant) ─────────────── */
.menu-section {
  position: relative;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: background var(--dur-collapse) var(--ease);
}

.menu-section:hover {
  background: var(--color-surface);
}

/* ─── SECTION TRIGGER BUTTON ────────────────────── */
.section-trigger {
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm);
  padding: var(--sp-xl);
  color: var(--color-text);
  transition: transform 200ms var(--ease);
}

.section-trigger:hover {
  transform: scale(1.02);
}

.section-trigger:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: -4px;
}

/* ─── RED PILL BADGE ─────────────────────────────── */
.section-badge {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.8rem, 4.5vw, 4.5rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-white);
  background: var(--color-red);
  padding: 0.15em 0.65em;
  border-radius: 9999px;
  line-height: 1.15;
  display: inline-block;
  white-space: nowrap;
  transition: background var(--dur-collapse) var(--ease),
              box-shadow 200ms var(--ease);
}

.section-trigger:hover .section-badge {
  background: var(--color-red-dark);
  box-shadow: 0 4px 24px rgba(232, 25, 44, 0.35);
}

/* ─── "TAP TO EXPLORE" HINT ─────────────────────── */
.section-hint {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 200ms var(--ease),
              transform 200ms var(--ease);
}

.menu-section:hover .section-hint {
  opacity: 1;
  transform: translateY(0);
}

/* ─── SECTION PANEL (FULLSCREEN OVERLAY) ──────── */
.section-panel {
  position: fixed;
  inset: 0;
  bottom: var(--footer-height); /* stop above footer */
  z-index: 100;
  background: var(--color-bg);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;

  /* Hidden state */
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
  transition:
    opacity var(--dur-expand) var(--ease),
    transform var(--dur-expand) var(--ease);
}

/* Expanded state — triggered by parent aria-expanded */
.menu-section[aria-expanded="true"] .section-panel {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* GPU hint during animation only */
.section-panel.is-animating {
  will-change: opacity, transform;
}

/* ─── PANEL INNER WRAPPER ───────────────────────── */
.panel-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--sp-xl) var(--sp-xl) var(--sp-2xl);
  position: relative;
}

/* ─── CLOSE BUTTON ───────────────────────────────── */
.close-btn {
  position: sticky;
  top: var(--sp-md);
  float: right;
  clear: right;
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  color: var(--color-text);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  margin-left: var(--sp-md);
  margin-bottom: var(--sp-md);
  transition: background 150ms, border-color 150ms;
  flex-shrink: 0;
}

.close-btn:hover {
  background: var(--color-red);
  border-color: var(--color-red);
}

.close-btn:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 2px;
}

/* ─── PANEL HEADER (badge at top of expanded panel) */
.panel-header {
  padding-bottom: var(--sp-xl);
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--sp-xl);
  overflow: hidden; /* clears the floated close button */
}

.panel-badge {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-white);
  background: var(--color-red);
  padding: 0.1em 0.6em;
  border-radius: 9999px;
  display: inline-block;
}

/* ─── TWO-COLUMN LAYOUT INSIDE PIZZA PANEL ─────── */
.panel-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--sp-2xl);
  align-items: start;
}

.panel-col {
  display: flex;
  flex-direction: column;
}

/* ─── SUBSECTION ─────────────────────────────────── */
.subsection {
  margin-bottom: var(--sp-xl);
  padding-bottom: var(--sp-xl);
  border-bottom: 1px solid var(--color-divider);
}

.subsection:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.subsection-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(0.85rem, 1.8vw, 1.1rem);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-muted);
  margin-bottom: var(--sp-md);
}

/* ─── ITEM LIST ─────────────────────────────────── */
.item-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.menu-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}

.item-main {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-md);
}

.item-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  color: var(--color-text);
  flex: 1;
  min-width: 0;
}

/* Vegan green dot indicator */
.menu-item[data-vegan="true"] .item-name::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--color-vegan);
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
  position: relative;
  top: -1px;
}

.item-prices {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.8rem, 1.4vw, 0.9rem);
  color: var(--color-muted);
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

.item-desc {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(0.78rem, 1.3vw, 0.875rem);
  color: var(--color-muted);
  line-height: 1.55;
  padding-left: 13px; /* aligns under name, past the vegan dot space */
}

/* ─── SLICES ROW ─────────────────────────────────── */
.slices-row {
  display: flex;
  gap: var(--sp-lg);
  flex-wrap: wrap;
}

.slice-item {
  display: flex;
  align-items: baseline;
  gap: var(--sp-sm);
}

.slice-price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--color-red);
}

/* ─── FLAVOR BOOSTER PILLS ─────────────────────── */
.booster-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

.booster-list li {
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  border-radius: 9999px;
  padding: 0.3em 0.85em;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-muted);
  white-space: nowrap;
}

/* ─── MENU NOTE (drinks free-text) ──────────────── */
.menu-note {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--color-muted);
  line-height: 1.65;
  font-style: italic;
  max-width: 480px;
}

/* ─── PIZZA NOTES (bottom of pizza panel) ──────── */
.pizza-notes {
  margin-top: var(--sp-lg);
}

.pizza-note {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.6;
}

.pizza-note strong {
  color: var(--color-text);
}

.pizza-icons {
  margin-top: var(--sp-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pizza-icons li {
  font-size: 0.78rem;
  color: var(--color-muted);
}

/* ─── SITE FOOTER ─────────────────────────────────── */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-md);
  background: var(--color-bg);
  border-top: 1px solid var(--color-divider);
}

.footer-specials {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.55rem, 1.1vw, 0.8rem);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.75rem;
  color: var(--color-white);
  line-height: 1;
  user-select: none;
  letter-spacing: -0.02em;
}

/* ════════════════════════════════════════════════
   RESPONSIVE — TABLET (≤900px)
   ════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .panel-inner {
    padding: var(--sp-xl) var(--sp-lg) var(--sp-2xl);
  }

  .panel-columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .panel-badge {
    font-size: clamp(2rem, 5vw, 3.5rem);
  }
}

/* ════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤600px)
   ════════════════════════════════════════════════ */
@media (max-width: 600px) {
  html, body {
    height: auto;
    overflow: auto; /* allow scroll in collapsed state on mobile */
  }

  .menu-grid {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: calc(100dvh - var(--footer-height));
    gap: 1px;
    background: var(--color-divider);
    width: 100%;
  }

  .menu-section {
    min-height: calc(25dvh - 1px);
    flex: 1;
  }

  .section-badge {
    font-size: clamp(1.8rem, 9vw, 3.2rem);
  }

  /* Expanded panel on mobile */
  .section-panel {
    bottom: var(--footer-height);
  }

  .panel-inner {
    padding: var(--sp-lg) var(--sp-md) var(--sp-2xl);
  }

  .panel-badge {
    font-size: clamp(1.6rem, 8vw, 2.5rem);
  }

  .close-btn {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .item-prices {
    font-size: 0.78rem;
  }

  .slices-row {
    flex-direction: column;
  }

  .footer-specials {
    font-size: 0.5rem;
    letter-spacing: 0.04em;
  }

  .section-hint {
    display: none; /* hidden on mobile, touch is intuitive */
  }
}

/* ════════════════════════════════════════════════
   RESPONSIVE — VERY SMALL (≤380px)
   ════════════════════════════════════════════════ */
@media (max-width: 380px) {
  .section-badge {
    font-size: 1.5rem;
    padding: 0.2em 0.55em;
  }

  .panel-inner {
    padding: var(--sp-md) var(--sp-sm) var(--sp-xl);
  }
}

/* ════════════════════════════════════════════════
   ACCESSIBILITY — REDUCED MOTION
   ════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .section-panel {
    transition: opacity var(--dur-expand) var(--ease);
    transform: none !important;
  }

  .section-trigger {
    transition: none;
  }

  .section-hint {
    transition: opacity 100ms;
    transform: none;
  }

  .section-badge {
    transition: none;
  }
}
