/* ============================================
   YellowPages Info — mobile-first стили
   Шрифты: системный стек (без внешних импортов)
   ============================================ */

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

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  color: #333;
  background-color: #f5f5f5;
  min-height: 100vh;
}

/* --- Боковые рекламные баннеры (слева и справа), на мобильных скрыты и не в начале DOM --- */
.ad-sidebar {
  display: none;
}

@media (min-width: 1100px) {
  .ad-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: fixed;
    top: 80px;
    width: 160px;
    max-width: 160px;
    padding: 0.5rem;
    z-index: 50;
  }
  .ad-sidebar--left {
    left: 0;
  }
  .ad-sidebar--right {
    right: 0;
  }
  .ad-sidebar__unit {
    min-height: 200px;
  }
  /* Отступ для контента, чтобы не заходить под баннеры */
  .header .header-inner,
  main {
    margin-left: 160px;
    margin-right: 160px;
  }
}

/* Иврит и арабский: системные шрифты с поддержкой RTL */
[lang="he"],
[lang="ar"] {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #1a73e8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Скрытый лейбл для доступности */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --- Sticky Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: #1a1a1a;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: #1a73e8;
}

.nav {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
  color: #555;
  border-radius: 8px;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link:hover {
  background: #f0f0f0;
  color: #1a1a1a;
  text-decoration: none;
}

/* Переключатель языка (עב | RU | EN | ع) */
.lang-switcher {
  display: flex;
  gap: 0.25rem;
  margin-inline-start: 0.5rem;
}

.lang-btn {
  padding: 0.3rem 0.4rem;
  min-width: 32px;
  min-height: 40px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #555;
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.lang-btn:hover {
  background: #e0e0e0;
  color: #1a1a1a;
}

.lang-btn.active {
  background: #1a73e8;
  color: #fff;
}

/* --- Main content wrapper (мобильная версия: минимум отступов сверху) --- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0.75rem 1.5rem;
}

/* --- Hero (минимум отступа сверху на мобильном) --- */
.hero {
  padding: 0.5rem 0 0.5rem;
  text-align: center;
}

.hero-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.25;
}

.hero-desc {
  margin: 0;
  font-size: 1rem;
  color: #555;
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

/* --- Search --- */
.search-section {
  padding: 0.4rem 0 0.6rem;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: #888;
}

.search-input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

/* --- Section title --- */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #1a1a1a;
}

/* --- Stores grid: на мобильном маленькие квадратики 2 в ряд, отступы от краёв как на эскизе --- */
.stores-section {
  padding: 0.5rem 0.75rem 1rem;
}

.stores-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.no-results {
  text-align: center;
  color: #666;
  padding: 2rem 1rem;
}

/* --- Store card (на мобильном маленькие квадратики, по 2 в ряд) --- */
.store-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease;
}

.store-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.store-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #e8e8e8;
}

/* На мобильном картинка ниже — карточка как маленький квадратик (примерно 2.5–3 ряда влезают на экран) */
@media (max-width: 599px) {
  .store-card-image {
    aspect-ratio: 3 / 4;
  }
}

.store-card-body {
  padding: 0.35rem 0.4rem;
}

.store-card-title {
  margin: 0 0 0.15rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.store-card-category {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: 0.625rem;
  color: #1a73e8;
  background: #e8f0fe;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
}

.store-card-desc {
  margin: 0 0 0.25rem;
  font-size: 0.625rem;
  color: #555;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.store-card-hours {
  margin: 0 0 0.25rem;
  font-size: 0.625rem;
  color: #666;
}

.store-coupon-area {
  margin-bottom: 0.35rem;
}

.store-coupon-toggle {
  width: 100%;
  padding: 0.3rem 0.4rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: #fff;
  background: #1a73e8;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  min-height: 28px;
  transition: background 0.2s ease;
}

.store-coupon-toggle:hover {
  background: #1557b0;
}

.store-coupon-toggle:active {
  transform: scale(0.98);
}

.store-coupon-reveal {
  margin-top: 0.3rem;
  padding: 0.35rem;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px dashed #ccc;
}

.store-coupon-code {
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  letter-spacing: 0.05em;
  color: #1a1a1a;
  margin-bottom: 0.25rem;
}

.store-copy-btn {
  padding: 0.25rem 0.35rem;
  font-size: 0.625rem;
  background: #fff;
  border: 1px solid #1a73e8;
  color: #1a73e8;
  border-radius: 4px;
  cursor: pointer;
  min-height: 26px;
  min-width: 26px;
}

.store-copy-btn:hover {
  background: #e8f0fe;
}

.store-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.store-btn {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0.35rem;
  font-size: 0.5625rem;
  font-weight: 600;
  text-align: center;
  border-radius: 6px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.store-btn:hover {
  text-decoration: none;
  opacity: 0.9;
}

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

.store-btn-call {
  background: #34a853;
  color: #fff;
}

.store-btn-map {
  background: #f0f0f0;
  color: #1a1a1a;
}

/* --- Ad block --- */
.ad-section {
  padding: 1.5rem 0;
}

.ad-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px dashed #ddd;
  text-align: center;
}

.ad-label {
  display: block;
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.ad-placeholder {
  margin: 0;
  font-size: 0.9375rem;
  color: #666;
}

/* --- Footer / Contacts --- */
.footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid #e0e0e0;
  background: #fff;
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.footer-cta {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: #555;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.footer-link {
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-copy {
  margin: 0;
  font-size: 0.875rem;
  color: #888;
}

/* --- Toast (RTL-safe: центрирование через inset-inline) --- */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translate(-50%, 0);
  padding: 0.75rem 1.5rem;
  background: #1a1a1a;
  color: #fff;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

[dir="rtl"] .toast {
  left: 50%;
  right: auto;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   Media queries: планшет и десктоп
   ============================================ */

/* Планшет: 2 колонки, карточки побольше */
@media (min-width: 600px) {
  .header-inner {
    padding: 0.6rem 1rem;
    gap: 0.75rem;
  }

  main {
    padding: 0 1rem 2rem;
  }

  .hero {
    padding: 1rem 0 1rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .section-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .stores-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .store-card-body {
    padding: 0.75rem;
  }

  .store-card-title {
    font-size: 1rem;
    -webkit-line-clamp: 2;
  }

  .store-card-category {
    font-size: 0.75rem;
  }

  .store-card-desc,
  .store-card-hours {
    font-size: 0.8125rem;
  }

  .store-card-image {
    aspect-ratio: 16 / 10;
  }

  .store-coupon-toggle {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    min-height: 44px;
  }

  .store-copy-btn {
    font-size: 0.8125rem;
    min-height: 40px;
  }

  .store-btn {
    font-size: 0.8125rem;
    min-height: 40px;
  }
}

/* Десктоп: 3 колонки, крупные карточки */
@media (min-width: 900px) {
  .header-inner {
    padding: 1rem 1.5rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  .nav-link {
    padding: 0.5rem 1rem;
  }

  main {
    padding: 0 1.5rem 3rem;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-desc {
    font-size: 1.0625rem;
  }

  .stores-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .store-card {
    border-radius: 16px;
  }

  .store-card-body {
    padding: 1rem;
  }

  .store-card-title {
    font-size: 1.125rem;
    -webkit-line-clamp: unset;
  }

  .store-card-category {
    font-size: 0.8125rem;
  }

  .store-card-desc {
    font-size: 0.9375rem;
    -webkit-line-clamp: unset;
  }

  .store-card-hours {
    font-size: 0.875rem;
  }

  .store-coupon-toggle {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    min-height: 48px;
  }

  .store-coupon-reveal {
    padding: 1rem;
    margin-top: 0.75rem;
  }

  .store-coupon-code {
    font-size: 1.25rem;
  }

  .store-copy-btn {
    font-size: 0.9375rem;
    padding: 0.5rem 1rem;
    min-height: 44px;
  }

  .store-btn {
    min-width: 100px;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    min-height: 48px;
  }

  .footer {
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
