/* ============================================================================
   Town Tap - Web Ordering Styles
   Design: black bg, gold (#FFD700) accents, white text, dark cards (#1a1a1a)
   Mobile-first responsive
   ============================================================================ */

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #000;
  color: #fff;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: #FFD700; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================================
   NAV
   ============================================================================ */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0a0a0a;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.nav-logo:hover { text-decoration: none; }

.nav-logo img {
  border-radius: 8px;
}

/* ============================================================================
   APP DOWNLOAD BANNER
   ============================================================================ */

.app-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(135deg, #1a1a00 0%, #332b00 100%);
  border-bottom: 1px solid #FFD700;
}

.app-banner.hidden { display: none; }

.app-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #ccc;
}

.app-banner-btn {
  background: #FFD700;
  color: #000;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.app-banner-btn:hover { text-decoration: none; opacity: 0.9; }

.app-banner-close {
  background: none;
  border: none;
  color: #888;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* ============================================================================
   VIEWS
   ============================================================================ */

.view { display: none; }
.view.active { display: block; }

/* ============================================================================
   LOADING
   ============================================================================ */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  color: #888;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #333;
  border-top-color: #FFD700;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================================
   ERROR
   ============================================================================ */

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  padding: 24px;
  text-align: center;
}

.error-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #331111;
  color: #F44336;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}

.error-container h2 { color: #F44336; }
.error-container p { color: #888; max-width: 400px; }

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:hover:not(:disabled) { opacity: 0.9; }

.btn-primary {
  background: #FFD700;
  color: #000;
}

.btn-large {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  border-radius: 12px;
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-spinner.hidden { display: none; }

.back-btn {
  background: none;
  border: none;
  color: #FFD700;
  font-size: 15px;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 8px;
}

/* ============================================================================
   RESTAURANT HERO
   ============================================================================ */

.restaurant-hero {
  max-width: 800px;
  margin: 0 auto;
}

/* Photo Gallery */
.photo-gallery {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.photo-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cuisine-emoji {
  font-size: 72px;
}

/* Horizontal scroll photos */
.photo-scroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  height: 100%;
}

.photo-scroll::-webkit-scrollbar { display: none; }

.photo-scroll img {
  min-width: 100%;
  height: 100%;
  object-fit: cover;
  scroll-snap-align: start;
}

/* Info Card */
.restaurant-info-card {
  padding: 20px 16px 8px;
}

.restaurant-info-card h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}

/* Meta row: rating, reviews, price, cuisine */
.info-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  font-size: 14px;
}

.info-rating {
  color: #FFD700;
  font-weight: 600;
}

.info-reviews {
  color: #888;
}

.info-price-level {
  color: #FFD700;
  font-weight: 600;
}

.info-cuisine {
  color: #ccc;
}

.info-meta-row .dot-separator {
  color: #555;
  font-size: 10px;
}

/* Status */
.restaurant-status {
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.status-open { color: #4CAF50; }
.status-closed { color: #F44336; }

/* Said once, under the status line, with a number to ring instead. */
.ordering-closed-note {
  margin: -4px 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #e0e0e0;
}
.ordering-closed-note a { color: #FFD700; }

.cart-bar-btn:disabled {
  background: #3a3a3a;
  color: #bdbdbd;
  cursor: not-allowed;
}

/* Offer Badge */
.offer-badge {
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid #FFD700;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

.offer-badge.hidden { display: none; }

.offer-text {
  font-size: 15px;
  font-weight: 600;
  color: #FFD700;
}

.offer-expiry {
  font-size: 12px;
  color: #aaa;
  margin-top: 2px;
}

/* Description */
.restaurant-description {
  font-size: 14px;
  color: #aaa;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Tags */
.restaurant-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.restaurant-tag {
  font-size: 12px;
  color: #FFD700;
  background: rgba(255, 215, 0, 0.08);
  padding: 4px 10px;
  border-radius: 12px;
}

/* Section titles */
.info-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #FFD700;
  margin-bottom: 8px;
}

/* Ambiance */
.ambiance-section {
  margin-bottom: 16px;
}

.ambiance-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ambiance-chip {
  background: #2a2a2a;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  color: #fff;
}

/* Features */
.features-section {
  margin-bottom: 16px;
}

.features-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.feature-item {
  font-size: 13px;
  color: #ccc;
  padding: 2px 0;
}

.feature-check {
  color: #4CAF50;
  margin-right: 4px;
}

/* Hours */
.hours-section {
  margin-bottom: 16px;
}

.hours-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hours-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
}

.hours-day {
  color: #888;
  text-transform: capitalize;
  min-width: 90px;
}

.hours-time {
  color: #ccc;
  text-align: right;
}

.hours-row.today {
  color: #FFD700;
  font-weight: 600;
}

.hours-row.today .hours-day,
.hours-row.today .hours-time {
  color: #FFD700;
}

/* Contact Actions */
.contact-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.contact-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s;
}

.contact-btn:hover {
  border-color: #FFD700;
  text-decoration: none;
}

.contact-btn.hidden { display: none; }

.contact-icon {
  font-size: 16px;
}

/* Address */
.restaurant-address {
  color: #888;
  font-size: 13px;
  margin-bottom: 8px;
}

/* ============================================================================
   CATEGORY TABS
   ============================================================================ */

.category-tabs-wrapper {
  position: sticky;
  top: 57px; /* below nav */
  z-index: 50;
  background: #000;
  border-bottom: 1px solid #222;
}

.category-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.category-tab {
  padding: 8px 16px;
  border-radius: 20px;
  background: #1a1a1a;
  color: #aaa;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid #333;
  transition: all 0.2s;
}

.category-tab.active {
  background: #FFD700;
  color: #000;
  border-color: #FFD700;
}

/* ============================================================================
   MENU ITEMS
   ============================================================================ */

.menu-items {
  padding: 16px;
  padding-bottom: 100px; /* space for cart bar */
}

.menu-category-section {
  margin-bottom: 32px;
}

.menu-category-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #222;
}

.menu-grid {
  display: grid;
  gap: 12px;
}

.menu-item-card {
  background: #1a1a1a;
  border: 1px solid #282828;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.menu-item-card:hover { border-color: #FFD700; }

.menu-item-card.unavailable {
  opacity: 0.5;
  cursor: not-allowed;
}

.menu-item-info { flex: 1; }

.menu-item-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.menu-item-desc {
  font-size: 13px;
  color: #888;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-item-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-item-price {
  font-size: 15px;
  font-weight: 600;
  color: #FFD700;
}

.dietary-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #1a2a1a;
  color: #4CAF50;
  white-space: nowrap;
}

.menu-item-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.out-of-stock-badge {
  font-size: 11px;
  color: #F44336;
  font-weight: 500;
}

/* ============================================================================
   CART BAR
   ============================================================================ */

.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.95);
  border-top: 1px solid #333;
  z-index: 90;
}

.cart-bar.hidden { display: none; }

.cart-bar-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #FFD700;
  color: #000;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.cart-count {
  background: #000;
  color: #FFD700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.cart-total { font-weight: 700; }

/* ============================================================================
   ITEM DETAIL MODAL
   ============================================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  background: #111;
  border-radius: 20px 20px 0 0;
  padding: 24px 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: #333;
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.modal-item-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  padding-right: 40px;
}

.modal-item-desc {
  font-size: 14px;
  color: #888;
  margin-bottom: 16px;
}

.modal-item-price {
  font-size: 18px;
  font-weight: 600;
  color: #FFD700;
  margin-bottom: 20px;
}

/* Modifier Groups */
.modifier-group {
  margin-bottom: 20px;
}

.modifier-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.modifier-group-name {
  font-size: 16px;
  font-weight: 600;
}

.modifier-required {
  font-size: 11px;
  color: #FFD700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,215,0,0.1);
}

.modifier-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #1a1a1a;
  border: 1px solid #282828;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.modifier-option.selected {
  border-color: #FFD700;
  background: #1a1a00;
}

.modifier-option-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modifier-radio, .modifier-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #555;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modifier-checkbox { border-radius: 4px; }

.modifier-option.selected .modifier-radio,
.modifier-option.selected .modifier-checkbox {
  border-color: #FFD700;
  background: #FFD700;
}

.modifier-option.selected .modifier-radio::after,
.modifier-option.selected .modifier-checkbox::after {
  content: '';
  width: 8px;
  height: 8px;
  background: #000;
  border-radius: 50%;
}

.modifier-option.selected .modifier-checkbox::after {
  border-radius: 2px;
  width: 10px;
  height: 10px;
  background: none;
  border-bottom: 2px solid #000;
  border-right: 2px solid #000;
  transform: rotate(45deg);
  width: 5px;
  height: 9px;
  margin-bottom: 2px;
}

.modifier-price {
  font-size: 14px;
  color: #aaa;
}

/* Special Instructions */
.special-instructions {
  margin-top: 16px;
}

.special-instructions label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #aaa;
}

.special-instructions textarea {
  width: 100%;
  padding: 10px 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 60px;
}

/* Quantity */
.quantity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #222;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #555;
  background: #1a1a1a;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn:hover { border-color: #FFD700; }

.qty-value {
  font-size: 18px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.modal-add-btn {
  width: 100%;
  margin-top: 16px;
}

/* ============================================================================
   CHECKOUT
   ============================================================================ */

.checkout-container {
  padding: 16px;
  max-width: 500px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.checkout-container h2 {
  font-size: 22px;
  margin-bottom: 16px;
}

.checkout-items {
  margin-bottom: 24px;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #1a1a1a;
}

.checkout-item-info {
  flex: 1;
}

.checkout-item-name {
  font-size: 15px;
  font-weight: 500;
}

.checkout-item-mods {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.checkout-item-qty {
  font-size: 13px;
  color: #888;
  margin-top: 2px;
}

.checkout-item-price {
  font-size: 15px;
  font-weight: 500;
  color: #FFD700;
  white-space: nowrap;
  margin-left: 12px;
}

.checkout-item-remove {
  background: none;
  border: none;
  color: #F44336;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
  margin-top: 4px;
}

/* Tip Section */
.tip-section {
  margin-bottom: 24px;
}

.tip-section h3 {
  font-size: 16px;
  margin-bottom: 10px;
}

.tip-buttons {
  display: flex;
  gap: 8px;
}

.tip-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #1a1a1a;
  color: #aaa;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.tip-btn.active {
  border-color: #FFD700;
  background: rgba(255,215,0,0.1);
  color: #FFD700;
}

/* Price Breakdown */
.price-breakdown {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 15px;
  color: #ccc;
}

.price-total {
  border-top: 1px solid #333;
  margin-top: 8px;
  padding-top: 12px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.zero-fees {
  text-align: center;
  font-size: 12px;
  color: #4CAF50;
  margin-top: 10px;
}

/* Guest Form */
.guest-form {
  margin-bottom: 24px;
}

.guest-form h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  color: #888;
  margin-bottom: 4px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: #FFD700;
}

.form-group input::placeholder { color: #555; }

/* Payment */
.payment-section {
  margin-bottom: 24px;
}

.payment-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

#payment-element {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 16px;
}

.payment-error {
  color: #F44336;
  font-size: 14px;
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(244,67,54,0.1);
  border-radius: 6px;
}

.payment-error.hidden { display: none; }

/* ============================================================================
   CONFIRMATION
   ============================================================================ */

.confirmation-container {
  padding: 40px 24px;
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.confirmation-check {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #1a3a1a;
  color: #4CAF50;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
}

.confirmation-container h2 {
  font-size: 26px;
  margin-bottom: 4px;
}

.order-number-label {
  font-size: 14px;
  color: #888;
  margin-top: 16px;
}

.order-number {
  font-size: 32px;
  font-weight: 700;
  color: #FFD700;
  letter-spacing: 2px;
  margin-bottom: 24px;
}

.confirm-details {
  background: #1a1a1a;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 32px;
  text-align: left;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 15px;
}

.confirm-row span:first-child { color: #888; }

/* App CTA */
.app-cta {
  background: linear-gradient(135deg, #1a1a00 0%, #332b00 100%);
  border: 1px solid #FFD700;
  border-radius: 16px;
  padding: 24px;
}

.app-cta h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.app-cta p {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 16px;
}

/* ============================================================================
   HIDDEN UTILITY
   ============================================================================ */

.hidden { display: none !important; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (min-width: 600px) {
  .menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content {
    border-radius: 20px;
    margin: auto;
    max-height: 90vh;
  }

  .modal {
    align-items: center;
    padding: 20px;
  }
}

@media (min-width: 600px) {
  .photo-gallery {
    height: 280px;
  }
}

@media (min-width: 900px) {
  .menu-items {
    max-width: 800px;
    margin: 0 auto;
  }
}
