/* TuCasa shared base – header, shell, typography, buttons, forms, focus, empty/loading */

*, *::before, *::after { box-sizing: border-box; }
:root {
  --container-max: 1200px;
  --container-pad: 24px;
  --page-gutter: 20px;
  --page-gutter-mobile: 16px;
  --app-shell-bottom: 24px;
  --app-shell-bottom-mobile: 20px;
  --list-section-title-size: 1.35em;
  --list-row-py: 14px;
  --list-row-px: 14px;
  --list-row-indent: 14px;
  --list-title-size: 1rem;
  --list-title-weight: 700;
  --list-title-meta-gap: 6px;
  --list-meta-size: 0.9em;
  --list-chip-gap: 8px;
  --list-meta-media-gap: 12px;
}

.container,
.page-content {
  width: min(100% - (var(--container-pad) * 2), var(--container-max));
  margin-inline: auto;
}

@media (max-width: 768px) {
  :root { --container-pad: 16px; }
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f3f0;
  color: #111;
  overflow: auto;
}
body.body-no-scroll { overflow: hidden; }

/* ---- Header ---- */
.navbar {
  width: 100%;
}
.navbar-inner {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  padding-inline: var(--container-pad);
  position: relative;
}

.tc-header--saaS {
  background: transparent;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: none;
  position: relative;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  margin-bottom: 12px;
}
.tc-header--saaS:has(#topHeaderLinks) .logo { flex: 0 0 auto; }
.tc-header--saaS .menu-toggle { margin-left: auto; }

.logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.1em;
  letter-spacing: 1px;
  margin: 0;
  padding: 12px 0;
  flex: 1;
  text-decoration: none;
  color: #111;
  cursor: pointer;
}

.menu-toggle {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 4px;
  padding: 0;
  box-shadow: none;
  margin-right: 0;
  flex-shrink: 0;
}
.menu-toggle span {
  width: 100%;
  height: 2px;
  background: #111;
  transition: all 0.3s;
}
.nav-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  flex: 0 0 auto;
}
.menu-toggle span.nav-icon {
  width: 20px;
  height: 2px;
  min-height: 2px;
  display: block;
}
.menu-toggle:hover { background: rgba(0,0,0,0.05); }

.menu-dropdown {
  position: absolute;
  top: 70px;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: none;
  min-width: 200px;
  display: none;
  z-index: 999;
  overflow: hidden;
}
.menu-dropdown.open { display: block; }

.menu-item {
  display: block;
  padding: 12px 20px;
  color: #111;
  text-decoration: none;
  font-size: 0.9em;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
  text-align: left;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: #f5f3f0; }
.menu-item-host {
  border-top: 2px solid #e6e2dd;
  margin-top: 4px;
  padding-top: 14px;
  background: #f8f6f3;
  font-weight: 600;
  color: #333;
}
.menu-item-host:hover { background: #f0ede8; }

/* Top nav links (About | Marketplace | City Guides) */
.top-header-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 28px;
  white-space: nowrap;
}
.top-header-links .top-link {
  font-family: 'Inter', sans-serif;
  color: #111;
  text-decoration: none;
  font-size: 1em;
  font-weight: 400;
  letter-spacing: 0.5px;
  padding: 8px 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color 140ms ease, opacity 140ms ease;
  opacity: 0.88;
}
.top-header-links .top-link:hover {
  border-bottom-color: rgba(17, 17, 17, 0.45);
  opacity: 1;
}
.top-header-links .top-link.is-active {
  border-bottom-color: #111;
  opacity: 1;
}
@media (max-width: 1200px) {
  .top-header-links { gap: 20px; }
  .top-header-links .top-link { font-size: 0.95em; }
}
@media (max-width: 900px) {
  .top-header-links { display: none; }
}

/* Focus – visible outline for keyboard, none for mouse */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

/* ---- Buttons ---- */
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: #fff;
  color: #111;
  text-decoration: none;
  border-radius: 0;
  font-family: inherit;
  font-weight: 500;
  letter-spacing: 0.2px;
  line-height: 1.2;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, opacity 160ms ease;
  white-space: nowrap;
  text-transform: none;
}
.btn-sm { min-height: 36px; padding: 8px 14px; font-size: 0.86rem; }
.btn-md { min-height: 42px; padding: 11px 18px; font-size: 0.94rem; }
.btn-lg { min-height: 48px; padding: 14px 24px; font-size: 1rem; }
.btn-small { min-height: 36px; padding: 8px 14px; font-size: 0.86rem; }
.btn-medium { min-height: 42px; padding: 11px 18px; font-size: 0.94rem; }
.btn-large { min-height: 48px; padding: 14px 24px; font-size: 1rem; }

.btn-primary {
  background: #111;
  color: #fff;
  border-color: #111;
}
.btn-primary:hover {
  background: #2a2a2a;
  border-color: #2a2a2a;
}
.btn-secondary {
  background: #fff;
  color: #333;
  border-color: #d9d5ce;
}
.btn-secondary:hover {
  background: #f8f6f3;
  border-color: #cfc9c1;
}
.btn-ghost {
  background: transparent;
  color: #333;
  border-color: transparent;
}
.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.05);
}
.btn-danger {
  background: #8b3a3a;
  color: #fff;
  border-color: #8b3a3a;
}
.btn-danger:hover {
  background: #7a2f2f;
  border-color: #7a2f2f;
}
.btn:disabled,
.btn[aria-disabled="true"],
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled,
.btn-danger:disabled {
  background: #f0f0f0;
  color: #999;
  border-color: #e0e0e0;
  cursor: not-allowed;
  opacity: 1;
}
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

/* Global button motion opt-out: disable transitions/animations on all button UI */
button,
input[type="submit"],
input[type="button"],
.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.primary-button,
.secondary-button,
.search-button,
.action-btn,
.action-btn-small,
a.button,
.map-review-close {
  transition: none !important;
  animation: none !important;
}

button:active,
input[type="submit"]:active,
input[type="button"]:active,
.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-ghost:active,
.btn-danger:active,
.primary-button:active,
.secondary-button:active,
.search-button:active,
.action-btn:active,
.action-btn-small:active,
a.button:active,
.map-review-close:active {
  transform: none !important;
}

/* Keep button colors fixed on interaction across all templates */
button:hover,
button:active,
input[type="submit"]:hover,
input[type="submit"]:active,
input[type="button"]:hover,
input[type="button"]:active,
.btn:hover,
.btn:active,
.btn-primary:hover,
.btn-primary:active,
.btn-secondary:hover,
.btn-secondary:active,
.btn-ghost:hover,
.btn-ghost:active,
.btn-danger:hover,
.btn-danger:active,
.primary-button:hover,
.primary-button:active,
.secondary-button:hover,
.secondary-button:active,
.search-button:hover,
.search-button:active,
.action-btn:hover,
.action-btn:active,
.action-btn-small:hover,
.action-btn-small:active,
a.button:hover,
a.button:active,
.map-review-close:hover,
.map-review-close:active {
  background: inherit !important;
  color: inherit !important;
  border-color: inherit !important;
  opacity: 1 !important;
}

/* Preserve intended default colors for primary and secondary button families */
.btn-primary,
.primary-button,
.search-button,
.action-btn,
.action-btn-small,
button[type="submit"] {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}

.btn-primary:hover,
.btn-primary:active,
.primary-button:hover,
.primary-button:active,
.search-button:hover,
.search-button:active,
.action-btn:hover,
.action-btn:active,
.action-btn-small:hover,
.action-btn-small:active,
button[type="submit"]:hover,
button[type="submit"]:active {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}

.btn-secondary,
.secondary-button,
a.button,
.map-review-close {
  background: #fff !important;
  color: #333 !important;
  border-color: #d9d5ce !important;
}

.btn-secondary:hover,
.btn-secondary:active,
.secondary-button:hover,
.secondary-button:active,
a.button:hover,
a.button:active,
.map-review-close:hover,
.map-review-close:active {
  background: #fff !important;
  color: #333 !important;
  border-color: #d9d5ce !important;
}

/* Compatibility mapping for legacy button classes */
.primary-button,
.search-button,
.action-btn,
.action-btn-small,
button[type="submit"] {
  background: #111;
  color: #fff;
  border-color: #111;
}
.secondary-button,
a.button,
.map-review-close {
  background: #fff;
  color: #333;
  border-color: #d9d5ce;
}
.primary-button,
.secondary-button,
.search-button,
.action-btn,
.action-btn-small,
.map-review-close,
a.button,
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 11px 18px;
  border: 1px solid;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.2px;
  border-radius: 0;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, opacity 160ms ease;
  text-transform: none;
}

/* Submit loading state */
.btn.is-loading,
.btn-primary.is-loading,
.btn-secondary.is-loading,
.btn-ghost.is-loading,
.btn-danger.is-loading,
.primary-button.is-loading,
button[type="submit"].is-loading {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}
.btn.is-loading::after,
.btn-primary.is-loading::after,
.btn-secondary.is-loading::after,
.btn-ghost.is-loading::after,
.btn-danger.is-loading::after,
.primary-button.is-loading::after,
button[type="submit"].is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: none !important;
}
.btn-secondary.is-loading::after,
.btn-ghost.is-loading::after,
.secondary-button.is-loading::after {
  border-color: rgba(0,0,0,0.1);
  border-top-color: #333;
}
@keyframes tucasa-spin {
  to { transform: rotate(360deg); }
}

/* ---- Tags / Chips ---- */
.tag {
  --tag-height: 24px;
  --tag-pad-x: 10px;
  --tag-font-size: 0.72rem;
  --tag-line-height: 1.15;
  --tag-icon-size: 12px;
  --tag-gap: 5px;
  display: inline-flex;
  align-items: center;
  gap: var(--tag-gap);
  max-width: 100%;
  min-height: var(--tag-height);
  padding: 0 var(--tag-pad-x);
  border: 1px solid #d8d2ca;
  border-radius: 9999px;
  background: transparent;
  color: #444;
  font-size: var(--tag-font-size);
  font-weight: 500;
  line-height: var(--tag-line-height);
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
.tag-sm {
  --tag-height: 24px;
  --tag-pad-x: 10px;
  --tag-font-size: 0.72rem;
  --tag-line-height: 1.15;
  --tag-icon-size: 12px;
  --tag-gap: 5px;
}
.tag-md {
  --tag-height: 24px;
  --tag-pad-x: 10px;
  --tag-font-size: 0.72rem;
  --tag-line-height: 1.15;
  --tag-icon-size: 12px;
  --tag-gap: 5px;
}
.tag-lg {
  --tag-height: 24px;
  --tag-pad-x: 10px;
  --tag-font-size: 0.72rem;
  --tag-line-height: 1.15;
  --tag-icon-size: 12px;
  --tag-gap: 5px;
}
.tag svg,
.tag img,
.tag i,
.tag [class*="icon"] {
  width: var(--tag-icon-size);
  height: var(--tag-icon-size);
  flex: 0 0 auto;
}
.tag-neutral { border-color: #d8d2ca; color: #444; }
.tag-info { border-color: #ccd5e0; color: #315b8b; }
.tag-success { border-color: #8fbca1; color: #3f6f51; }
.tag-warning { border-color: #d8bd96; color: #7c5f39; }
.tag-danger { border-color: #caa0a0; color: #7c3e3e; }
.tag-status { border-color: #d6c9ba; color: #6b5640; }
.tag-highlight { border-color: #cec4b7; color: #3a3128; }
.tag-michelin {
  border-color: #DA291C;
  background: transparent;
  color: #DA291C;
}
.tag-fill,
.tag-solid {
  background: #f8f6f3;
}
.tag-action {
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.tag-action:hover {
  background: #f0ede8;
  border-color: #cfc9c1;
}
.tag-action.tag-michelin:hover {
  background: rgba(218, 41, 28, 0.08);
  border-color: #DA291C;
  color: #DA291C;
}
.tag-action:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}
.tag-action.tag-michelin:focus-visible {
  outline-color: #DA291C;
}

/* ---- Form groups ---- */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35em;
  color: #333;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d5ce;
  background: #fff;
  font-family: inherit;
  font-size: 1em;
  color: #111;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #111;
}
.form-group input[disabled],
.form-group select[disabled],
.form-group textarea[disabled] {
  background: #f5f3f0;
  color: #666;
  cursor: not-allowed;
}

/* ---- App shell ---- */
.app-shell {
  min-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  padding: 0 var(--page-gutter) var(--app-shell-bottom);
  box-sizing: border-box;
}
@media (max-width: 768px) {
  .app-shell { padding: 0 var(--page-gutter-mobile) var(--app-shell-bottom-mobile); }
}

/* ---- Empty & loading states ---- */
.empty-state,
.loading-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: #555;
}
.empty-state {
  background: #f8f6f3;
  border: 1px dashed #e6e2dd;
  border-radius: 0;
}
.empty-state .empty-state-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #333;
  margin: 0 0 0.5em;
}
.empty-state .empty-state-text {
  margin: 0;
  font-size: 0.95em;
}
.loading-state {
  background: #f8f6f3;
}
.loading-state .loading-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 2px solid #e6e2dd;
  border-top-color: #111;
  border-radius: 50%;
  animation: tucasa-spin 0.7s linear infinite;
  margin-bottom: 12px;
}
.loading-state .loading-text {
  display: block;
  font-size: 0.95em;
}

/* ---- Image layout stability (aspect-ratio placeholders) ---- */
.img-ratio-16-9 { aspect-ratio: 16 / 9; background: #e6e2dd; }
.img-ratio-4-3 { aspect-ratio: 4 / 3; background: #e6e2dd; }
.img-ratio-1-1 { aspect-ratio: 1; background: #e6e2dd; }
.img-ratio-container { overflow: hidden; }
.img-ratio-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
