:root {
  --background: #f6f0e5;
  --card: #fbefdd;
  --text: #1c1c1e;
  --secondary-text: #6e6e73;
  --border: #ece6db;
  --brown: #8b5e3c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body { min-height: 100vh; margin: 0; color: var(--text); background: var(--background); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px max(16px, calc((100vw - 720px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(246, 240, 229, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--brown);
}

.language-switcher {
  position: fixed;
  z-index: 40;
  top: 10px;
  right: max(12px, calc((100vw - 720px) / 2 + 12px));
  display: inline-flex;
  height: 38px;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--brown);
  background: rgba(251, 239, 221, .96);
  box-shadow: 0 2px 10px rgba(54, 39, 26, .08);
  cursor: pointer;
}
.language-switcher ion-icon { font-size: 19px; }
.language-switcher span { font-size: 12px; font-weight: 750; letter-spacing: .03em; }
.language-switcher select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}
.language-switcher:focus-within {
  outline: 2px solid var(--brown);
  outline-offset: 2px;
}

main {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 28px 0 52px;
}

.business-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
}

.avatar-button {
  width: 150px;
  height: 150px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 75px;
  background: transparent;
  cursor: zoom-in;
}

.business-avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.business-avatar.fallback {
  display: grid;
  place-items: center;
  color: var(--brown);
  background: #e4d7c4;
  font-size: 44px;
  font-weight: 700;
}

.hero-copy { width: 100%; text-align: center; }
h1 {
  margin: 16px 0 0;
  color: #444;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}

.rating-line {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

.rating-star { color: #f2b84b; font-size: 16px; }
.rating-line strong { margin-left: 5px; font-size: 16px; }
.rating-separator { width: 1px; height: 18px; margin: 0 10px; background: var(--border); }
.rating-comment { color: var(--secondary-text); font-size: 15px; }
.rating-line .muted { margin-left: 5px; color: var(--secondary-text); font-size: 14px; font-weight: 600; }

.app-download-placement {
  display: flex;
  justify-content: center;
  margin-top: 32px;
  padding: 0 16px;
}
.app-download-badge {
  display: inline-flex;
  border-radius: 8px;
  line-height: 0;
}
.app-download-badge:focus-visible {
  outline: 3px solid rgba(139, 94, 60, .3);
  outline-offset: 3px;
}
.app-download-badge:active { transform: translateY(1px); }
.app-download-badge img { display: block; height: auto; }
.app-download-badge img[data-platform="ios"] { width: 166px; }
.app-download-badge img[data-platform="android"] { width: 190px; }

.listing-content { padding-bottom: 44px; }
.listing-section { margin-top: 16px; padding: 0 16px; }
.section-heading { display: flex; align-items: center; margin-bottom: 8px; }
.section-heading ion-icon { margin-right: 8px; color: var(--brown); font-size: 20px; }
.section-heading h2 { margin: 0; color: var(--brown); font-size: 18px; font-weight: 600; }

.description,
.empty-copy {
  margin: 0;
  color: #333;
  font-size: 16px;
  line-height: 22px;
  white-space: pre-line;
}
.empty-copy { color: var(--secondary-text); }

.service-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px 0;
}

.service-title { margin: 0; color: #333; font-size: 15px; font-weight: 400; }
.service-description { margin: 3px 0 0; color: var(--secondary-text); font-size: 13px; line-height: 18px; }
.service-meta { min-width: 82px; text-align: right; }
.service-price { display: block; color: #333; font-size: 15px; font-weight: 600; }
.service-duration { display: block; margin-top: 2px; color: #8a8a8a; font-size: 13px; }
.book-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--brown);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.hours-list { display: grid; }
.hour-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: #333;
  font-size: 16px;
  line-height: 22px;
}
.hour-value { text-align: right; }
.hour-value.closed { color: var(--secondary-text); }

.contacts-list { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.contact-item {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 22px;
  background: #f2e8da;
  text-decoration: none;
}
.contact-item ion-icon,
.contact-item i { font-size: 21px; }

.review-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.review-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  overflow: hidden;
  place-items: center;
  border-radius: 22px;
  color: #6a4c35;
  background: #e4d7c4;
  font-size: 17px;
  font-weight: 700;
}
.review-avatar img { width: 100%; height: 100%; object-fit: cover; }
.review-body { min-width: 0; flex: 1; }
.review-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.review-name { overflow: hidden; margin: 0; color: var(--text); font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.review-rating { display: flex; align-items: center; color: var(--text); font-size: 14px; font-weight: 600; }
.review-rating ion-icon { margin-right: 4px; color: #f2b84b; }
.review-text { margin: 4px 0 0; color: var(--secondary-text); font-size: 15px; line-height: 21px; }

body.booking-mode .topbar { display: none; }
body.booking-mode main { padding-top: 0; }
body.booking-mode .language-switcher { display: none; }
.booking-page { min-height: 100vh; }
.booking-navigation {
  position: sticky;
  z-index: 15;
  top: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  height: 50px;
  background: rgba(246, 240, 229, 0.96);
  backdrop-filter: blur(14px);
}
.booking-navigation h1 {
  margin: 0;
  color: #000;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}
.booking-back {
  display: grid;
  width: 40px;
  height: 50px;
  place-items: center start;
  padding-left: 8px;
  color: #000;
  text-decoration: none;
}
.booking-back ion-icon { font-size: 24px; }
.booking-content { padding: 16px 16px 32px; }
.booking-service-card { margin-bottom: 20px; }
.booking-service-card h2 { margin: 0; color: #222; font-size: 20px; font-weight: 600; }
.booking-service-card p { margin: 4px 0 0; color: #777; font-size: 15px; }

.calendar { padding: 4px 0 0; }
.calendar-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  margin-bottom: 14px;
}
.calendar-header strong { color: var(--text); font-size: 16px; text-align: center; text-transform: capitalize; }
.calendar-header button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}
.calendar-header button:disabled { opacity: .25; cursor: default; }
.calendar-header ion-icon { font-size: 20px; }
.calendar-weekdays,
.calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { margin-bottom: 4px; }
.calendar-weekdays span {
  padding: 5px 0;
  color: var(--secondary-text);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.calendar-day {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
}
.calendar-day.outside { color: transparent; pointer-events: none; }
.calendar-day.past { color: #c7c1b9; cursor: default; }
.calendar-day.today { color: var(--brown); font-weight: 700; }
.calendar-day.selected { color: #fff; background: var(--brown); font-weight: 700; }

.time-section { margin-top: 20px; }
.time-section h2,
.booking-notes label { display: block; margin: 0 0 12px; color: #222; font-size: 17px; font-weight: 600; }
.slots-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 3.5%; }
.slot-button {
  min-width: 0;
  padding: 12px 4px;
  border: 1px solid var(--brown);
  border-radius: 8px;
  color: var(--brown);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}
.slot-button.selected { color: #fff; background: var(--brown); }
.no-slots-message { margin: 20px 0 0; color: #777; font-size: 16px; text-align: center; }
.slots-loading { display: flex; gap: 10px; align-items: center; justify-content: center; color: #777; font-size: 15px; }
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #d8cfc5;
  border-top-color: var(--brown);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.booking-notes { margin-top: 20px; }
.booking-notes textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  resize: vertical;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  outline: none;
  color: #222;
  background: transparent;
  font: inherit;
  font-size: 16px;
}
.booking-notes textarea:focus { border-color: var(--brown); }
.booking-notes textarea::placeholder { color: #999; }
.booking-submit {
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--brown);
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
}
.booking-submit:disabled { opacity: .5; cursor: default; }

.flow-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 28px;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  background: var(--background);
  box-shadow: 0 24px 70px rgba(54, 39, 26, .24);
  text-align: center;
}
.flow-dialog::backdrop { background: rgba(35, 29, 24, .54); backdrop-filter: blur(4px); }
.flow-dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  color: var(--secondary-text);
  background: transparent;
  cursor: pointer;
  font-size: 27px;
}
.flow-dialog-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 27px;
  color: var(--brown);
  background: #f2e8da;
}
.flow-dialog-icon ion-icon { font-size: 27px; }
.flow-dialog-icon.success { color: #fff; background: #56815b; }
.flow-dialog h2 { margin: 0; color: #222; font-size: 21px; font-weight: 650; }
.flow-dialog > p { margin: 10px 0 22px; color: var(--secondary-text); font-size: 15px; line-height: 21px; }
.google-button,
.dialog-primary-button,
.dialog-secondary-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}
.google-button { gap: 10px; border: 1px solid #d1d1d1; color: #222; background: #fff; }
.google-button i { color: #4285f4; font-size: 18px; }
.dialog-primary-button { border: 0; color: #fff; background: var(--brown); }
.dialog-primary-button:disabled { opacity: .55; cursor: default; }
.dialog-secondary-button { border: 1px solid #d1d1d1; color: #333; background: transparent; }
.confirmation-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.app-download-prompt {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  margin: 2px 0 18px;
  padding: 16px;
  border: 1px solid #dfd1bf;
  border-radius: 14px;
  background: #fffaf3;
  text-align: left;
}
.app-download-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--brown);
  font-size: 24px;
  font-weight: 750;
}
.app-download-copy h3 { margin: 1px 0 4px; color: var(--text); font-size: 16px; line-height: 21px; }
.app-download-copy p { margin: 0; color: var(--secondary-text); font-size: 13px; line-height: 18px; }
.app-download-badge { grid-column: 1 / -1; justify-self: center; line-height: 0; }
.app-download-badge img { display: block; width: auto; height: 48px; max-width: 100%; object-fit: contain; }
#success-dialog { max-height: calc(100vh - 32px); overflow-y: auto; }
.success-close { min-height: 44px; }

.flow-dialog form { margin-top: 20px; text-align: left; }
.flow-dialog form label { display: block; margin: 14px 0 6px; color: #333; font-size: 14px; font-weight: 600; }
.flow-dialog form input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  outline: 0;
  color: #222;
  background: transparent;
  font: inherit;
  font-size: 16px;
}
.flow-dialog form input:focus { border-color: var(--brown); }
.flow-dialog form .dialog-primary-button { margin-top: 20px; }
.form-error { margin: 10px 0 0; color: #b3261e; font-size: 13px; line-height: 18px; }

.status-view { display: grid; min-height: 65vh; place-items: center; align-content: center; padding: 20px; text-align: center; }
.status-view h1 { margin-top: 16px; color: var(--text); font-size: 26px; }
.status-view p { max-width: 440px; color: var(--secondary-text); line-height: 1.55; }
.status-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 50%; color: var(--brown); background: #f2e8da; font-size: 26px; font-weight: 800; }
.primary-button.compact { margin-top: 4px; }

.skeleton {
  overflow: hidden;
  background: #e9dfd1;
  background-image: linear-gradient(90deg, transparent, rgba(255,255,255,.52), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.35s infinite;
}
.loading-avatar { width: 150px; height: 150px; border-radius: 75px; }
.loading-title { width: min(260px,70vw); height: 20px; margin-top: 18px; border-radius: 7px; }
.loading-subtitle { width: 150px; height: 16px; margin-top: 10px; border-radius: 7px; }
.loading-card { width: min(600px,86vw); height: 130px; margin-top: 34px; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.image-dialog { width: min(820px,calc(100vw - 32px)); padding: 0; overflow: visible; border: 0; background: transparent; }
.image-dialog::backdrop { background: rgba(0,0,0,.95); }
.image-dialog img { display: block; width: 100%; max-height: 82vh; object-fit: contain; }
.dialog-close { position: absolute; z-index: 2; top: -14px; right: -10px; display: grid; width: 38px; height: 38px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: var(--text); background: #fff; cursor: pointer; font-size: 26px; }
[hidden] { display: none !important; }

@media (max-width: 560px) {
  .topbar { padding-inline: 12px; }
  main { padding-top: 20px; }
  .service-item {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
  }
  .service-meta { min-width: 64px; }
  .book-button { padding-inline: 12px; }
  .booking-content { padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
