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

:root {
  --primary:        #C0392B;
  --primary-dark:   #922B21;
  --primary-hover:  #E74C3C;
  --primary-glow:   rgba(192, 57, 43, 0.35);

  --bg:             #FBF8F4;
  --bg-card:        #FFFFFF;
  --bg-filter:      #F5F0EB;

  --text:           #1C1917;
  --text-muted:     #78716C;
  --text-light:     #A8A29E;

  --border:         #E8E0D5;
  --border-focus:   #C0392B;

  --star:           #F59E0B;
  --open:           #059669;
  --closed:         #DC2626;

  --font-display:   'Playfair Display', Georgia, serif;
  --font-body:      'Nunito', system-ui, sans-serif;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);

  --transition: 0.18s ease;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ─── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ─── Header ───────────────────────────────────────────────── */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 24px 0 20px;
  text-align: center;
}

.site-header__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.site-logo span {
  margin-left: 4px;
}

.site-tagline {
  font-size: 0.95rem;
  opacity: 0.88;
  font-weight: 600;
}

/* ─── Ad Slots ─────────────────────────────────────────────── */
.ad-slot {
  display: flex;
  justify-content: center;
  padding: 12px 16px;
}

.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F0EDE8;
  border: 1px dashed #C8BFB6;
  border-radius: var(--radius-sm);
  color: #696260;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;

  /* Mobile: 320×50 */
  width: 320px;
  height: 50px;
}

.ad-slot--mid .ad-placeholder {
  width: 300px;
  height: 250px;
}

@media (min-width: 768px) {
  .ad-slot--header .ad-placeholder,
  .ad-slot--footer .ad-placeholder {
    width: 728px;
    height: 90px;
  }
}

/* ─── Picker Section ────────────────────────────────────────── */
.picker-section {
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ─── Form Block ────────────────────────────────────────────── */
.form-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-label .icon {
  width: 16px; height: 16px;
  color: var(--primary);
}

/* ─── Location Row ──────────────────────────────────────────── */
.location-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.text-input {
  flex: 1;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color var(--transition), box-shadow var(--transition);
  min-width: 0;
}

.text-input::placeholder {
  color: var(--text-light);
}

.text-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

.location-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 1.2em;
}

.location-status.is-success { color: var(--open); }
.location-status.is-error   { color: var(--closed); }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 18px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn svg {
  width: 17px; height: 17px;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn--outline:hover {
  background: rgba(192, 57, 43, 0.06);
  transform: translateY(-1px);
}

.btn--outline:active {
  transform: translateY(0);
}

.btn--ghost {
  background: var(--bg-filter);
  color: var(--text-muted);
  border-color: transparent;
  font-size: 0.88rem;
}

.btn--ghost:hover {
  background: var(--border);
  color: var(--text);
}

.btn--icon {
  padding: 13px 16px;
}

.btn-label {
  display: none;
}

@media (min-width: 480px) {
  .btn-label { display: inline; }
  .btn--icon { padding: 13px 18px; }
}

/* ─── The Big Pick Button ────────────────────────────────────── */
.pick-btn {
  width: 100%;
  padding: 20px 32px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background var(--transition), transform 0.12s ease, box-shadow var(--transition);
  box-shadow: 0 6px 28px var(--primary-glow);
  -webkit-tap-highlight-color: transparent;
}

.pick-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 10px 36px var(--primary-glow);
}

.pick-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 3px 12px var(--primary-glow);
}

.pick-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ─── Filters ───────────────────────────────────────────────── */
.filters-wrapper {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
}

.filters-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  -webkit-tap-highlight-color: transparent;
}

.filters-toggle .icon {
  width: 16px; height: 16px;
  color: var(--primary);
}

.filters-toggle .chevron {
  width: 18px; height: 18px;
  margin-left: auto;
  transition: transform var(--transition);
  color: var(--text-muted);
}

.filters-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.filters-panel {
  padding: 0 18px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filters-panel[hidden] {
  display: none;
}

/* On desktop, always show filters */
@media (min-width: 768px) {
  .filters-toggle { display: none; }
  .filters-panel  { display: flex !important; padding-top: 18px; }
  .filters-wrapper { border-color: var(--border); }
}

.filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 479px) {
  .filters-grid { grid-template-columns: 1fr; }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group--inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.unit-toggle {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-left: auto;
  flex-shrink: 0;
}

.unit-btn {
  background: none;
  border: none;
  padding: 2px 8px;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-transform: none;
  letter-spacing: 0.03em;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

.unit-btn + .unit-btn {
  border-left: 1.5px solid var(--border);
}

.unit-btn--active {
  background: var(--primary);
  color: #fff;
}

.unit-btn:not(.unit-btn--active):hover {
  background: var(--bg-filter);
  color: var(--text);
}

/* Select */
.select-wrap {
  position: relative;
}

.select-input {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-family: var(--font-body);
  font-size: 0.93rem;
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.select-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

.select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Range / Distance Slider */
.range-input {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--border);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
  accent-color: var(--primary);
}

.range-input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: transform var(--transition);
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.range-input::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  cursor: pointer;
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #696260;
  margin-top: 4px;
  padding: 0 2px;
}

/* Price Pill Radios */
.price-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.price-option {
  cursor: pointer;
}

.price-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.price-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  border: 2px solid var(--border);
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  transition: all var(--transition);
  cursor: pointer;
  user-select: none;
}

.price-option input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.price-option:hover span {
  border-color: var(--primary);
  color: var(--primary);
}

.price-option input:checked + span:hover {
  color: #fff;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}

.toggle-track {
  display: flex;
  align-items: center;
  width: 48px;
  height: 28px;
  background: var(--border);
  border-radius: 99px;
  padding: 3px;
  transition: background var(--transition);
}

.toggle-thumb {
  width: 22px; height: 22px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform var(--transition);
}

.toggle-switch input:checked ~ .toggle-track {
  background: var(--primary);
}

.toggle-switch input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

.toggle-switch input:focus-visible ~ .toggle-track {
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.25);
}

/* ─── Loading State ─────────────────────────────────────────── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 36px 0;
  color: var(--text-muted);
  font-weight: 600;
}

.loading[hidden] { display: none; }

.loading-ring {
  width: 52px; height: 52px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Error Message ─────────────────────────────────────────── */
.error-message {
  padding: 16px 20px;
  background: #FEF2F2;
  border: 1.5px solid #FCA5A5;
  border-radius: var(--radius-md);
  color: #B91C1C;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}

.error-message[hidden] { display: none; }

/* ─── Result Card ───────────────────────────────────────────── */
.result-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1.5px solid var(--border);

  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.result-card[hidden] { display: none; }

.result-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.result-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px 0;
}

.result-card__label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
}

.open-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
}

.open-badge.is-open {
  background: #D1FAE5;
  color: var(--open);
}

.open-badge.is-closed {
  background: #FEE2E2;
  color: var(--closed);
}

.result-name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  padding: 10px 22px 0;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 22px 0;
  flex-wrap: wrap;
}

.result-type {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.result-price {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.02em;
}

.result-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px 0;
}

.stars {
  font-size: 1rem;
  letter-spacing: 1px;
  color: var(--star);
}

.rating-number {
  font-weight: 800;
  font-size: 0.95rem;
}

.rating-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.result-address {
  font-style: normal;
  padding: 12px 22px 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.result-address::before {
  content: '📍';
  flex-shrink: 0;
  font-style: normal;
  margin-top: 1px;
}

.result-phone {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 22px 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  text-decoration: none;
}

.result-phone::before {
  content: '📞';
  flex-shrink: 0;
}

.result-phone:hover {
  color: var(--accent);
}

.result-actions {
  display: flex;
  gap: 10px;
  padding: 20px 22px 0;
  flex-wrap: wrap;
}

.result-actions .btn {
  flex: 1;
  min-width: 140px;
}

.result-reroll {
  display: flex;
  gap: 10px;
  padding: 12px 22px 22px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}

.result-reroll .btn {
  flex: 1;
}

/* ─── SEO Section ───────────────────────────────────────────── */
.seo-section {
  padding: 32px 0 40px;
  border-top: 1px solid var(--border);
}

.seo-section h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.seo-section p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 60ch;
}

.seo-section p + p {
  margin-top: 10px;
}

/* ─── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--text);
  color: var(--text-light);
  padding: 24px 0;
  text-align: center;
}

.footer-text {
  font-size: 0.82rem;
  margin-top: 12px;
  opacity: 0.7;
}

/* ─── Share Feedback Toast ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1C1917;
  color: #fff;
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  white-space: nowrap;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ─── Cuisine Pills ─────────────────────────────────────────── */
.cuisine-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cuisine-pill {
  padding: 5px 13px;
  border: 1.5px solid var(--border);
  border-radius: 99px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
}

.cuisine-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cuisine-pill--active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ─── Cities Section ────────────────────────────────────────── */
.cities-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.cities-section h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.cities-grid {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cities-grid li a {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-filter);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.cities-grid li a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ─── Responsive tweaks ─────────────────────────────────────── */
@media (max-width: 400px) {
  .result-actions {
    flex-direction: column;
  }
  .result-actions .btn {
    width: 100%;
  }
}
