@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --primary: #0F5B50;
  --primary-dark: #0a4a3f;
  --primary-light: #127562;
  --primary-gradient: linear-gradient(145deg, var(--primary-light) 0%, var(--primary) 50%, var(--primary-dark) 100%);
  --green-shine: linear-gradient(160deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.08) 35%, transparent 60%);
  --secondary: #6B7270;
  --accent: #C9A86A;
  --surface: #ffffff;
  --bg: #EFE9DF;
  --border: rgba(15, 91, 80, 0.1);
  --radius: 16px;
  --text-main: #1a1a1a;
  --text-muted: #64748b;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Mini App / Telegram WebView: скролл только внутри #app, чтобы не сворачивало окно */
html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html {
  overflow-x: hidden;
}

body {
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', Roboto, sans-serif;
  color: var(--primary);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

#root, #app, .app {
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: 80px; /* место под фиксированный tabbar */
  box-sizing: border-box;
}

/* Header & Layout */
.header {
  padding: 32px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-content {
  flex: 1;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 4px 0 0;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.header p {
  color: var(--accent);
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.content {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* CARDS (Warm Style) */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 20px rgba(15, 91, 80, 0.04);
  transition: transform 0.2s ease;
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:active {
  transform: scale(0.98);
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  letter-spacing: -0.01em;
}

.highlight-card {
  position: relative;
  background: var(--primary-gradient);
  color: white;
  border: none;
  box-shadow: 0 12px 30px rgba(15, 91, 80, 0.25);
  overflow: hidden;
}

.highlight-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: var(--green-shine);
}

.highlight-card .label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.highlight-card .value {
  font-size: 20px;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: -0.01em;
}

.wifi-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.password-box {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.copy-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

/* Info Rows & Buttons */
.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(15, 91, 80, 0.1);
}

.info-content {
  flex: 1;
}

.info-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

.info-desc {
  color: var(--secondary);
  font-size: 14px;
}

.btn {
  flex: 1;
  padding: 14px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-primary {
  position: relative;
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(15, 91, 80, 0.2);
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: var(--green-shine);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #E8F5E9;
  color: var(--primary);
}

/* Locals Banner */
.locals-banner {
  background: #ffffff;
  color: var(--primary);
  border: 2px solid var(--accent) !important;
}

/* --- SCROLL UTILS FOR NEW LOCALS PAGE --- */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.snap-x {
  scroll-snap-type: x mandatory;
  scroll-padding: 0 20px;
}

.snap-start {
  scroll-snap-align: start;
}

/* Category Btn */
.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 8px 6px;
  border-radius: 10px;
  border: none;
  background: #ffffff;
  color: var(--secondary);
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  flex-shrink: 0;
}

.category-btn.active,
.category-btn:hover {
  color: var(--primary);
  background: #ffffff;
  border: 1px solid var(--primary);
}

.category-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 3px;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

/* Location Card NEW — фиксированный размер, не растягивается */
.location-card {
  flex: 0 0 260px;
  width: 260px;
  max-width: 260px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  scroll-snap-align: start;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.location-card:active {
  transform: scale(0.98);
}

.location-image-wrapper {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.location-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rating-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.location-content {
  padding: 12px;
}

.location-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--primary);
}

.location-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--secondary);
}

.price-indicator span {
  margin-left: 2px;
}

.price-active {
  color: var(--primary);
  font-weight: 700;
}

.price-inactive {
  color: #e2e8f0;
}


/* Tabbar */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(239, 233, 223, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(15, 91, 80, 0.1);
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-around;
  z-index: 100;
}

.tab-btn {
  border: none;
  background: none;
  color: var(--secondary);
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.05em;
  cursor: pointer;
  width: 60px;
  white-space: nowrap;
}

.tab-btn.active {
  color: var(--primary);
}

/* Animated Locals Button */
.tab-btn .icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-btn.locals-animated .icon-wrapper {
  animation: bounceAndGlow 2s ease-in-out infinite;
}

@keyframes bounceAndGlow {

  0%,
  100% {
    transform: translateY(0);
    color: var(--secondary);
  }

  10% {
    transform: translateY(-8px);
  }

  20% {
    transform: translateY(0);
    color: #e74c3c;
    filter: drop-shadow(0 0 8px rgba(231, 76, 60, 0.6));
  }

  30% {
    color: var(--secondary);
    filter: none;
  }
}

/* MODAL OVERLAY — выравнивание по верху, фиксированная высота при клавиатуре */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 91, 80, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-sheet {
  background: #fcfcfc;
  width: 100%;
  max-width: 600px;
  max-height: min(88vh, 88dvh);
  min-height: 0;
  border-radius: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}


@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}
