/* =========================================================
   Mr. Pizza — Customer Menu Styles
   Mobile-first, dark premium design
   ========================================================= */

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

:root {
  --brand:        #D32F2F;
  --brand-light:  #FF5252;
  --gold:         #FFB300;
  --bg:           #111111;
  --surface:      #1C1C1C;
  --surface2:     #262626;
  --border:       #2E2E2E;
  --text:         #F5F5F5;
  --text-muted:   #9E9E9E;
  --radius:       18px;
  --radius-sm:    10px;
  --shadow:       0 8px 32px rgba(0,0,0,.5);
  --transition:   .22s cubic-bezier(.4,0,.2,1);
  --header-h:     64px;
  --nav-h:        64px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; width: 100%; object-fit: cover; }

/* ── Header ──────────────────────────────────────────────── */
#header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(17,17,17,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
}
.logo-tagline {
  font-size: 13px; font-weight: 700;
  color: var(--text); white-space: nowrap;
}
.logo-sub {
  font-size: 10px; color: var(--text-muted);
  white-space: nowrap; margin-top: 1px;
}
.logo-location {
  display: block; font-size: 10px; color: var(--brand-light);
  white-space: nowrap; margin-top: 2px;
  text-decoration: none;
}
.logo-location:hover { text-decoration: underline; }
.logo-img {
  height: 52px; width: auto;
  object-fit: contain;
  transition: transform .2s ease, filter .2s ease;
}
#logo-btn:hover .logo-img,
#logo-btn:focus .logo-img {
  transform: scale(1.12) rotate(-3deg);
  filter: drop-shadow(0 0 8px rgba(211,47,47,.7));
}
#logo-btn:active .logo-img { transform: scale(1.05); }

.lang-btn {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 12px;
  cursor: pointer; color: var(--text); font-size: 13px; font-weight: 600;
  transition: background var(--transition);
}
.lang-btn:hover { background: var(--brand); border-color: var(--brand); }

/* ── Promo banner ────────────────────────────────────────── */
#promo-banner {
  padding: 10px 16px;
  font-size: 13px; font-weight: 600; text-align: center;
  display: none;
}
#promo-banner.visible { display: block; }

/* ── Category nav ────────────────────────────────────────── */
#cat-nav {
  position: sticky; top: var(--header-h); z-index: 90;
  background: rgba(17,17,17,.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
#cat-nav-inner {
  display: flex; gap: 8px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 16px;
  scrollbar-width: none;
}
#cat-nav-inner::-webkit-scrollbar { display: none; }

.cat-pill {
  flex-shrink: 0; scroll-snap-align: start;
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 24px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.cat-pill .cat-emoji { font-size: 16px; }
.cat-pill:hover { border-color: var(--brand); color: var(--text); }
.cat-pill.active {
  background: var(--brand); border-color: var(--brand);
  color: #fff;
}

/* ── Featured hero strip ─────────────────────────────────── */
#hero-strip {
  padding: 16px 0 8px;
}
#hero-strip h2 {
  padding: 0 16px 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text-muted);
}
#hero-scroll {
  display: flex; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding: 0 16px 4px;
  scrollbar-width: none;
}
#hero-scroll::-webkit-scrollbar { display: none; }

.hero-card {
  flex-shrink: 0; scroll-snap-align: start;
  width: calc(100vw - 56px); max-width: 380px;
  border-radius: var(--radius); overflow: hidden;
  position: relative; cursor: pointer;
  aspect-ratio: 4/3;
  background: var(--surface);
}
.hero-card img {
  width: 100%; height: 100%;
  transition: transform .4s ease;
}
.hero-card:hover img { transform: scale(1.04); }
.hero-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 55%);
}
.hero-card-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 16px;
}
.hero-card-info h3 {
  font-size: 20px; font-weight: 800; line-height: 1.1;
}
.hero-card-info p {
  font-size: 12px; color: rgba(255,255,255,.7);
  margin-top: 3px; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-card-price {
  margin-top: 6px;
  font-size: 18px; font-weight: 800; color: var(--gold);
}

/* ── Section headers ─────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; gap: 8px;
  padding: 20px 16px 10px;
}
.section-header .sec-emoji { font-size: 20px; }
.section-header h2 { font-size: 19px; font-weight: 800; }

/* ── Subsection header ───────────────────────────────────── */
.subsection-header {
  padding: 14px 16px 8px;
}
.subsection-header h3 {
  font-size: 15px; font-weight: 700;
  color: var(--text-muted); letter-spacing: .4px;
  text-transform: uppercase;
  border-left: 3px solid var(--brand); padding-left: 10px;
}

/* ── Product grid ────────────────────────────────────────── */
#menu-grid {
  padding: 0 16px 100px;
}

.cat-section { margin-bottom: 8px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 1.5px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:active { transform: scale(.97); }
.product-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), var(--shadow);
}

.product-card-img {
  aspect-ratio: 1;
  position: relative; overflow: hidden;
  background: var(--surface2);
}
.product-card-img img {
  width: 100%; height: 100%;
  transition: transform .4s ease;
}
.product-card:hover .product-card-img img { transform: scale(1.06); }

.product-card-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 52px;
  color: var(--border);
}

.unavailable-badge {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
}
.unavailable-badge span {
  background: rgba(0,0,0,.8); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; font-weight: 700;
  color: var(--text-muted);
}

.featured-dot {
  position: absolute; top: 8px; left: 8px;
  background: var(--brand);
  border-radius: 6px; padding: 2px 7px;
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: #fff;
}

.product-card-body {
  padding: 10px 10px 12px;
}
.product-card-body h3 {
  font-size: 14px; font-weight: 700; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-card-body p {
  font-size: 11px; color: var(--text-muted);
  margin-top: 3px; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.4;
}
.product-card-price {
  margin-top: 8px;
  font-size: 16px; font-weight: 800; color: var(--gold);
}

/* ── Product Modal ───────────────────────────────────────── */
#modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.85);
  display: none; align-items: flex-end;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity var(--transition);
}
#modal-overlay.open { display: flex; }

#modal {
  width: 100%; max-height: 92dvh;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
#modal-overlay.open #modal { transform: translateY(0); }

/* Gallery */
#modal-gallery {
  position: relative; flex-shrink: 0;
  aspect-ratio: 4/3; background: var(--surface2);
  overflow: hidden;
}
#modal-gallery-track {
  display: flex; height: 100%;
  transition: transform .3s ease;
}
#modal-gallery-track img {
  flex-shrink: 0; width: 100%; height: 100%;
  object-fit: cover;
}

.gallery-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.6);
  border: none; border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff; font-size: 18px;
  transition: background var(--transition);
}
.gallery-btn:hover { background: var(--brand); }
#gallery-prev { left: 10px; }
#gallery-next { right: 10px; }

.gallery-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px;
}
.gallery-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.4);
  transition: background var(--transition), width var(--transition);
}
.gallery-dot.active { background: #fff; width: 18px; border-radius: 3px; }

#modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,.7); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff; font-size: 18px;
  z-index: 10;
}

/* Full-screen zoom */
#fullscreen-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: #000;
  display: none; align-items: center; justify-content: center;
}
#fullscreen-overlay.open { display: flex; }
#fullscreen-img {
  width: 100%; max-height: 100dvh; object-fit: contain;
}
#fullscreen-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,.15); border: none;
  width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; color: #fff; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}

/* Modal body */
#modal-body {
  padding: 20px 20px 32px;
  overflow-y: auto; flex: 1;
}

#modal-tags {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.modal-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; padding: 3px 9px;
  border-radius: 20px; background: var(--brand);
  color: #fff;
}

#modal-name {
  font-size: 26px; font-weight: 800; line-height: 1.1;
}
#modal-desc {
  margin-top: 8px; font-size: 14px; color: var(--text-muted); line-height: 1.6;
}
#modal-price {
  margin-top: 14px;
  font-size: 30px; font-weight: 900; color: var(--gold);
}
#modal-price::before { content: ''; }
#modal-price:has(.variation-chip) {
  display: flex; flex-wrap: wrap; gap: 8px; font-size: unset;
}
#modal-delivery-btn {
  display: block; width: 100%; margin-top: 18px;
  padding: 14px; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff;
  border: none; font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: background var(--transition), transform .1s;
}
#modal-delivery-btn:hover { background: var(--brand-light); }
#modal-delivery-btn:active { transform: scale(.97); }
.variation-chip {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface2); border-radius: 10px;
  padding: 8px 14px; min-width: 80px;
}
.variation-label { font-size: 12px; color: var(--text2); font-weight: 600; }
.variation-price { font-size: 20px; font-weight: 900; color: var(--gold); }

/* ── Toast ───────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 30px; padding: 10px 20px;
  font-size: 13px; font-weight: 600; color: var(--text);
  z-index: 400; transition: transform .3s ease; white-space: nowrap;
  box-shadow: var(--shadow);
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── Utilities ───────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Tablet / desktop adjustments ───────────────────────── */
@media (min-width: 600px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-card { width: 340px; }
  #modal { max-width: 480px; margin: auto; border-radius: var(--radius); }
  #modal-overlay { align-items: center; }
}
@media (min-width: 960px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Social modal ────────────────────────────────────────── */
#social-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
}
#social-overlay.open { display: flex; }

#social-modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 28px 24px 24px; width: min(340px, 90vw);
  text-align: center; position: relative;
  box-shadow: var(--shadow);
}

#social-close {
  position: absolute; top: 12px; right: 12px;
  background: var(--surface2); border: none; color: var(--text);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: 14px; display: flex; align-items: center; justify-content: center;
}

#social-links { display: flex; flex-direction: column; gap: 10px; }

.social-link {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius-sm);
  text-decoration: none; color: #fff; font-weight: 600; font-size: 1rem;
  transition: opacity var(--transition);
}
.social-link:active { opacity: .8; }
.social-link.instagram { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-link.facebook  { background: #1877F2; }
.social-link.whatsapp  { background: #25D366; }
.social-link.ubereats  { background: #000000; }
.social-link.didi      { background: #FF6B00; }
.social-link.rappi     { background: #FF441F; }
.social-icon {
  width: 24px; height: 24px; object-fit: contain;
  border-radius: 4px; flex-shrink: 0;
  filter: brightness(0) invert(1);
}
