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

:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --accent: #c45c26;
  --accent-hover: #a34a1c;
  --border: #e4ddd4;
  --shadow: 0 4px 24px rgba(26, 26, 26, 0.08);
  --radius: 14px;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.container {
  width: min(1100px, 100% - 2rem);
  margin-inline: auto;
}

.hidden {
  display: none !important;
}

/* Header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.brand-icon {
  font-size: 2rem;
  line-height: 1;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 0.15rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.15rem;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

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

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

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.btn-icon:hover {
  color: var(--text);
}

/* List section */

.list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.list-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.result-count {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.search-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.search-label {
  font-size: 0.875rem;
  font-weight: 500;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem 2.75rem 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.15);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 0.65rem;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.search-clear:hover {
  background: var(--border);
  color: var(--text);
}

.search-spinner {
  position: absolute;
  right: 0.8rem;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: search-spin 0.7s linear infinite;
}

.search-box.is-searching input {
  border-color: var(--accent);
}

.search-status {
  margin: -0.5rem 0 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.business-grid.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

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

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Business cards */

.business-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.business-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.card-image {
  aspect-ratio: 16 / 10;
  background: var(--bg);
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.35rem;
}

.business-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(26, 26, 26, 0.1);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.business-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  flex: 1;
}

.category-badge {
  flex-shrink: 0;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.category-food {
  background: #e8f5e9;
  color: #2e7d32;
}

.category-service {
  background: #e3f2fd;
  color: #1565c0;
}

.category-other {
  background: #f3e8fd;
  color: #6a1b9a;
}

.business-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
}

.business-meta a,
.business-meta span {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
}

.business-meta a:hover {
  color: var(--accent);
}

.business-meta .icon {
  flex-shrink: 0;
  width: 1.1rem;
  text-align: center;
}

.business-description {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text);
  flex: 1;
}

.card-footer {
  padding: 0 1.35rem 1.35rem;
  margin-top: auto;
}

.btn-card-visit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-card-visit:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.brand-link {
  text-decoration: none;
  color: inherit;
}

.back-btn {
  margin-bottom: 1.5rem;
}

.business-detail-page {
  padding-top: 0.5rem;
}

.business-detail {
  margin-bottom: 2rem;
}

.business-error {
  text-align: center;
  padding: 2rem;
  background: #fde8e8;
  color: #9b1c1c;
  border-radius: var(--radius);
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.detail-image {
  width: 100%;
  max-height: 420px;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  overflow: hidden;
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.detail-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.detail-meta a {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
}

.detail-meta a:hover {
  color: var(--accent);
}

.detail-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.detail-section p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-line;
}

.detail-website-btn {
  align-self: flex-start;
  text-decoration: none;
}

.detail-loading {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.business-sections-area {
  width: 100%;
  margin-top: 1.5rem;
  padding-bottom: 1rem;
}

.business-sections {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.business-section-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.business-section-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.business-section-summary {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-line;
}

.business-section-slot {
  width: 100%;
}

.business-section-card h4,
.business-section-card h5 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
}

.business-section-card p {
  margin: 0 0 0.75rem;
}

.business-section-card p:last-child,
.business-section-card ul:last-child {
  margin-bottom: 0;
}

.business-section-card ul {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

.business-section-card img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.section-loading,
.section-error,
.section-empty {
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}

.section-error {
  color: #9b1c1c;
}

.business-section-card .section-form-fields {
  padding: 0;
}

.section-accordion-details {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.section-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.section-accordion-summary::-webkit-details-marker {
  display: none;
}

.section-accordion-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}

.section-accordion-icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-muted);
  transition: transform 0.2s ease, background 0.15s ease;
}

.section-accordion-icon::before {
  content: "+";
}

.section-accordion-details[open] .section-accordion-icon::before {
  content: "−";
}

.section-accordion-summary:hover .section-accordion-icon {
  background: var(--bg);
  color: var(--text);
}

.section-accordion-content {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.digital-menu {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.menu-category h4 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.menu-item {
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--border);
}

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

.menu-item-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.menu-item-name {
  font-weight: 600;
  font-size: 0.975rem;
}

.menu-item-price {
  flex-shrink: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--accent);
}

.menu-item-description {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.section-form-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 540px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Image carousel */

.image-carousel {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 50%;
  min-width: 240px;
  max-width: 550px;
  margin-inline: auto;
  align-self: center;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.carousel-viewport {
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg);
}

.carousel-track {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
}

.carousel-btn {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.carousel-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  margin-top: 0.25rem;
}

.carousel-dot {
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

/* Empty state */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* Pagination */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.page-btn {
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--text-muted);
  padding: 0 0.25rem;
  user-select: none;
}

/* Dialog / Form */

.form-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  width: min(520px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  box-shadow: 0 20px 60px rgba(26, 26, 26, 0.2);
}

.form-dialog::backdrop {
  background: rgba(26, 26, 26, 0.45);
}

.business-form {
  display: flex;
  flex-direction: column;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.dialog-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.form-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
}

.form-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.form-fields input,
.form-fields select,
.form-fields textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-fields input:focus,
.form-fields select:focus,
.form-fields textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.15);
}

.form-fields textarea {
  resize: vertical;
  min-height: 100px;
}

.form-fields input[type="file"] {
  padding: 0.5rem 0;
  border: none;
  background: transparent;
}

.field-hint {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-muted);
}

.image-preview {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 0.25rem;
}

.form-error {
  margin: 0 1.5rem;
  padding: 0.65rem 0.85rem;
  background: #fde8e8;
  color: #9b1c1c;
  border-radius: 8px;
  font-size: 0.875rem;
}

.form-success {
  margin: 0 1.5rem;
  padding: 0.65rem 0.85rem;
  background: #e8f5e9;
  color: #1b5e20;
  border-radius: 8px;
  font-size: 0.875rem;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* Loading skeleton */

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 280px;
}

.skeleton-image {
  aspect-ratio: 16 / 10;
  background: linear-gradient(90deg, var(--border) 25%, #f0ebe4 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.skeleton-body {
  padding: 1.35rem;
}

.skeleton-line {
  height: 1rem;
  background: linear-gradient(90deg, var(--border) 25%, #f0ebe4 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-line.medium {
  width: 80%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Site footer */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 1rem;
}

.site-footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
}

.footer-copy {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-contact-heading {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.footer-contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-contact-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.footer-contact-list a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-contact-list a:hover {
  color: var(--accent);
}

.footer-icon {
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

/* Responsive */

@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .header-inner .btn-primary {
    width: 100%;
  }

  .business-grid {
    grid-template-columns: 1fr;
  }

  .list-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer-inner {
    flex-direction: column;
    gap: 1.5rem;
  }

  .detail-content {
    padding: 1.25rem;
  }

  .detail-image {
    max-height: 280px;
  }
}
