/* My Kebap Pizza — mobile-first ordering UI */

:root {
  --red: #B81C1C;
  --red-dark: #8B1515;
  --red-light: #E83535;
  --cream: #FFF8F0;
  --cream-dark: #F5E8D8;
  --white: #FFFFFF;
  --black: #1A1A1A;
  --gray-600: #5C5C5C;
  --gray-400: #9A9A9A;
  --gray-200: #E8E0D8;
  --shadow: 0 4px 24px rgba(26, 26, 26, 0.1);
  --shadow-lg: 0 8px 40px rgba(26, 26, 26, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 64px;
  --tabs-h: 52px;
  --cart-width: 400px;
  --bottom-bar-h: 64px;
  --font: 'Poppins', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--black);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

a { color: var(--red); }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: var(--red);
  color: var(--white);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.site-header__logo {
  height: 36px;
  width: auto;
}

.site-header__name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.site-header__name small {
  display: block;
  font-weight: 500;
  font-size: 0.65rem;
  opacity: 0.85;
}

.cart-btn {
  position: relative;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.35);
  color: var(--white);
  border-radius: 50px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.cart-btn:hover { background: rgba(255,255,255,0.25); }

.cart-btn__count {
  background: var(--white);
  color: var(--red);
  border-radius: 50%;
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.cart-btn__count:empty,
.cart-btn__count[data-count="0"] { display: none; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: var(--white);
  padding: 48px 24px 56px;
  text-align: center;
}

.hero__title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.hero__tagline {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: 24px;
}

.hero__cta {
  display: inline-block;
  background: var(--white);
  color: var(--red);
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 50px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow);
}

.hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.hero__location {
  margin-top: 16px;
  font-size: 0.875rem;
  opacity: 0.8;
}

/* ---- Category tabs ---- */
.category-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 250;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar { display: none; }

.category-nav__inner {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  min-width: min-content;
}

.category-tab {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 8px 14px;
  border-radius: 50px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.category-tab:hover { background: var(--cream-dark); color: var(--black); }

.category-tab.active {
  background: var(--red);
  color: var(--white);
  font-weight: 600;
}

/* ---- Menu ---- */
.menu-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 12px 100px;
}

.menu-section {
  scroll-margin-top: calc(var(--header-h) + var(--tabs-h) + 12px);
  margin-bottom: 32px;
}

.menu-section__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--red);
}

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

@media (min-width: 768px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .menu-wrap { padding: 28px 24px 40px; }
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
}

.product-card__name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
  line-height: 1.3;
}

.product-card__desc {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-bottom: 10px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__prices {
  margin-bottom: 10px;
}

.price-line {
  font-size: 0.8125rem;
  font-weight: 600;
}

.price-line--single {
  font-size: 1rem;
  color: var(--red);
}

.price-line__label {
  font-weight: 500;
  color: var(--gray-600);
  font-size: 0.7rem;
}

.product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.btn-add {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-add:hover { background: var(--red-dark); }

/* ---- Overlay / modal ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.overlay.open { opacity: 1; visibility: visible; }

/* Addon modal */
.addon-modal {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.addon-modal.open { transform: translateY(0); }

@media (min-width: 768px) {
  .addon-modal {
    left: auto;
    right: 24px;
    bottom: 24px;
    width: 420px;
    border-radius: var(--radius);
    max-height: 80vh;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
  }
  .addon-modal.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
}

.addon-modal__header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.addon-modal__title { font-weight: 700; font-size: 1.1rem; }
.addon-modal__price { color: var(--red); font-weight: 600; margin-top: 4px; }

.addon-modal__body {
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1;
}

.addon-group { margin-bottom: 16px; }

.addon-group__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.addon-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
}

.addon-option input { margin-top: 3px; accent-color: var(--red); }

.addon-modal__footer {
  padding: 16px 20px 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.btn-secondary {
  flex: 1;
  background: var(--cream);
  color: var(--black);
  border: 2px solid var(--gray-200);
  border-radius: 50px;
  padding: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  flex: 2;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover { background: var(--red-dark); }

.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Cart drawer ---- */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: var(--cart-width);
  height: 100%;
  background: var(--white);
  z-index: 450;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}

.cart-drawer.open { transform: translateX(0); }

@media (max-width: 767px) {
  .cart-drawer {
    top: auto;
    bottom: 0;
    height: 92vh;
    max-width: none;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }
  .cart-drawer.open { transform: translateY(0); }
}

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.cart-drawer__title { font-weight: 700; font-size: 1.125rem; }

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-600);
  line-height: 1;
  padding: 4px;
}

.cart-drawer__items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

.cart-empty {
  text-align: center;
  color: var(--gray-600);
  padding: 40px 20px;
}

.cart-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
}

.cart-item__top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.cart-item__name { font-weight: 600; font-size: 0.9rem; }

.cart-item__addons {
  font-size: 0.75rem;
  color: var(--gray-600);
  margin-top: 4px;
}

.cart-item__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cream);
  border-radius: 50px;
  padding: 4px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--white);
  border-radius: 50%;
  font-weight: 700;
  cursor: pointer;
  color: var(--red);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.cart-item__price { font-weight: 700; color: var(--red); }

.cart-item__remove {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 4px;
}

.cart-drawer__form {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.form-group { margin-bottom: 12px; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--gray-600);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--red);
}

.order-type-toggle {
  display: flex;
  background: var(--cream);
  border-radius: 50px;
  padding: 4px;
  margin-bottom: 12px;
}

.order-type-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--gray-600);
  transition: background 0.15s, color 0.15s;
}

.order-type-btn.active {
  background: var(--red);
  color: var(--white);
}

.delivery-field { display: none; }
.delivery-field.visible { display: block; }

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.cart-subtotal span:last-child { color: var(--red); }

.btn-place-order {
  width: 100%;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 14px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.btn-place-order:hover { background: var(--red-dark); }
.btn-place-order:disabled { opacity: 0.5; cursor: not-allowed; }

.form-error {
  color: var(--red);
  font-size: 0.8125rem;
  margin-bottom: 8px;
  display: none;
}

.form-error.visible { display: block; }

/* Mobile sticky bottom bar */
.mobile-cart-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 280;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 10px 16px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--bottom-bar-h);
}

@media (max-width: 767px) {
  .mobile-cart-bar.visible { display: flex; }
  body.has-cart-bar .menu-wrap { padding-bottom: calc(var(--bottom-bar-h) + 24px); }
}

.mobile-cart-bar__info { font-size: 0.875rem; }
.mobile-cart-bar__info strong { color: var(--red); }

.mobile-cart-bar__btn {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 12px 24px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ---- Confirmation ---- */
.confirmation {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--cream);
  overflow-y: auto;
  padding: 24px;
}

.confirmation.open { display: block; }

.confirmation__inner {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  padding-top: 40px;
}

.confirmation__icon {
  width: 72px;
  height: 72px;
  background: var(--red);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px;
}

.confirmation h2 { font-size: 1.5rem; margin-bottom: 8px; }
.confirmation__order-id { color: var(--red); font-weight: 700; margin-bottom: 16px; }
.confirmation__wait { background: var(--white); padding: 16px; border-radius: var(--radius); margin-bottom: 24px; box-shadow: var(--shadow); }

.confirmation__summary {
  text-align: left;
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.confirmation__summary h3 { font-size: 0.875rem; color: var(--gray-600); margin-bottom: 12px; }

.confirmation__item {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.875rem;
}

.btn-new-order {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
}

/* ---- No-JS fallback (PHP-rendered menu) ---- */
html.js #menu-fallback { display: none; }
html:not(.js) #menu-loading { display: none; }

.menu-fallback .noscript-notice {
  margin-bottom: 20px;
}

.noscript-notice {
  background: #FFF3CD;
  border: 1px solid #FFE69C;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.875rem;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--red-dark);
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 24px 16px;
  font-size: 0.8125rem;
}

.site-footer a { color: var(--white); }

/* Loading */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-600);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
