/**
 * style.css
 * Основные стили лендинга — главная страница.
 */

/* ===== CSS-переменные ===== */
:root {
  --color-text: #1f2937;
  --color-text-light: #6b7280;
  --color-bg: #ffffff;
  --color-footer: #166534;
  --color-footer-text: #dcfce7;
  --color-search-bg: #f3f4f6;
  --color-search-border: #e5e7eb;
  --color-search-placeholder: #9ca3af;

  /* Футер: тёмный красно-коричневый по скриншоту */
  --color-footer-dark: #3d2421;
  --color-footer-mahogany: #4a2c2a;
  --color-footer-text-light: #f5f0ee;

  /* Кнопка согласия (зелёная) */
  --color-consent-green: #22c55e;
  --color-consent-green-hover: #16a34a;

  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;

  --container-max: 1200px;
  --container-padding: 1rem;

  --color-search-hover: #2563eb;
  --color-recipe-bg: #e0f2fe;
  --color-recipe-shadow: rgba(0, 0, 0, 0.1);
  --color-recipe-shadow-accent: rgba(59, 130, 246, 0.2);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Контейнер контента */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ===== Базовые стили ===== */
html {
  min-height: 100%;
  background: transparent;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background-color: transparent; /* чтобы был виден размытый фон */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Фоновое изображение (Gordon Ramsay) — размытое, на всю страницу */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #2c1810; /* запасной цвет */
  background-image: url('../assets/images/Gordon-Ramsay-Peppercorn-Sauce-Recipe-1-683x1024.webp');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(10px) brightness(0.5);
  transform: scale(1.08);
}

/* ===== Основной контент ===== */
.page-main {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2xl) var(--container-padding);
  position: relative;
  z-index: 1;
}

/* Карточка контента поверх размытого фона — читаемость */
.page-content {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  padding: var(--spacing-2xl);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Заголовок */
.page-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--spacing-2xl);
  line-height: 1.3;
}

/* Эмблема (сжата по вертикали, пропорциональна) */
.emblem {
  margin-bottom: var(--spacing-2xl);
}

/* Эмблема в 2 раза больше (пропорционально) */
.emblem-img {
  max-width: 100%;
  width: 100%;
  max-width: 800px;
  max-height: 240px;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center;
}

/* Секция поиска */
.search-section {
  width: 100%;
  max-width: 600px;
}

.search-title {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--spacing-lg);
}

/* Поисковая строка */
.search-bar {
  display: flex;
  align-items: stretch;
  background-color: var(--color-search-bg);
  border: 1px solid var(--color-search-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.search-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #e5e7eb;
  padding: 0 var(--spacing-md);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.search-select {
  appearance: none;
  background: transparent;
  border: none;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  padding: var(--spacing-md) 1.5rem var(--spacing-md) var(--spacing-md);
  cursor: pointer;
}

.search-select:focus {
  outline: none;
}

.search-arrow {
  position: absolute;
  right: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-text);
}

.search-divider {
  width: 1px;
  background-color: var(--color-search-border);
  flex-shrink: 0;
}

.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 0 0 var(--spacing-md);
  min-width: 0;
}

/* Лупа — активна (кликабельна), при наведении синий #2563eb */
.search-icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  margin: 0 -4px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-footer);
  transition: color 0.2s;
}
.search-icon-btn:hover {
  color: #2563eb;
}
.search-icon-btn:focus {
  outline: 2px solid var(--color-footer);
  outline-offset: 2px;
}
.search-icon {
  flex-shrink: 0;
  color: currentColor;
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: var(--spacing-md) 0;
  border: none;
  background: transparent;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.search-input::placeholder {
  color: var(--color-search-placeholder);
}

.search-input:focus {
  outline: none;
}

/* Кнопка поиска — вплотную к полю, без зазора */
.search-submit {
  flex-shrink: 0;
  padding: var(--spacing-md) var(--spacing-lg);
  background-color: var(--color-footer);
  color: var(--color-footer-text);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-submit:hover {
  background-color: var(--color-search-hover);
}

.search-submit:focus {
  outline: 2px solid var(--color-footer);
  outline-offset: 2px;
}

.search-submit:active {
  opacity: 0.9;
}

/* Активное состояние поля поиска — визуальная обратная связь */
.search-bar:focus-within {
  border-color: #9ca3af;
  box-shadow: 0 0 0 2px rgba(22, 101, 52, 0.15);
}

.search-form {
  margin: 0;
}

/* ===== Оверлей размытия (при показе баннера согласия) ===== */
.consent-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.consent-overlay.is-visible {
  display: block;
}

/* ===== Баннер согласия (политика конфиденциальности) ===== */
/* Всегда прижат к низу экрана, поверх контента */
.consent-banner {
  display: none;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 10000;
  background: #ffffff;
  border-top: 4px solid var(--color-consent-green);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
}

.consent-banner.is-visible {
  display: block !important;
}

.consent-banner__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--spacing-xl) var(--container-padding);
}

.consent-banner__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 var(--spacing-md);
  text-align: center;
}

.consent-banner__text {
  font-size: 0.9375rem;
  color: #333;
  line-height: 1.5;
  margin: 0 0 var(--spacing-lg);
}

.consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  align-items: center;
  justify-content: flex-end;
  margin-bottom: var(--spacing-sm);
}

.consent-banner__btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.consent-banner__btn--settings {
  background: #fff;
  color: #111;
  border: 1px solid #333;
}

.consent-banner__btn--settings:hover {
  background: #f5f5f5;
}

.consent-banner__btn--accept {
  background: var(--color-consent-green);
  color: #fff;
  border: none;
}

.consent-banner__btn--accept:hover {
  background: var(--color-consent-green-hover);
}

.consent-banner__links {
  display: flex;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-sm);
}

.consent-banner__link {
  font-size: 0.8125rem;
  color: var(--color-consent-green);
  text-decoration: none;
}

.consent-banner__link:hover {
  text-decoration: underline;
}

/* ===== Модал ввода персональных данных ===== */
.consent-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10001;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
}

.consent-modal.is-visible {
  display: flex;
}

.consent-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.consent-modal__box {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 2.5rem var(--spacing-xl) var(--spacing-xl);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

/* Крестик закрытия — возврат к баннеру политики */
.consent-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: color 0.2s, background-color 0.2s;
}

.consent-modal__close:hover {
  color: #111;
  background: rgba(0, 0, 0, 0.06);
}

/* Цифровой секундомер — внизу модала, формат 00-10-00 */
.consent-modal__timer-wrap {
  text-align: center;
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.consent-modal__timer {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 3rem;
  font-weight: 700;
  color: #b91c1c;
  letter-spacing: 0.05em;
}

.consent-modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 var(--spacing-sm);
}

.consent-modal__desc {
  font-size: 0.9375rem;
  color: #555;
  margin: 0 0 var(--spacing-lg);
}

.consent-modal__form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.consent-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.consent-modal__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
}

.consent-modal__input {
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--color-search-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.consent-modal__input:focus {
  outline: none;
  border-color: var(--color-consent-green);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.consent-modal__error {
  font-size: 0.875rem;
  color: #dc2626;
  margin: 0;
}

.consent-modal__success {
  font-size: 0.875rem;
  color: #166534;
  margin: 0;
  display: none;
}

.consent-modal__success.is-visible {
  display: block;
}

.consent-modal__link {
  color: var(--color-consent-green);
  font-weight: 600;
  text-decoration: underline;
}

.consent-modal__link:hover {
  text-decoration: none;
}

/* Кнопка подтверждения (отображается после успешной отправки формы) */
.consent-modal__confirm-btn {
  display: block;
  width: 100%;
  margin-top: var(--spacing-md);
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-consent-green);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.2s;
}

.consent-modal__confirm-btn:hover {
  background: var(--color-consent-green-hover);
}

/* Контейнер для кнопок модала */
.consent-modal__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: var(--spacing-md);
  flex-wrap: wrap;
}

.consent-modal__submit {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-consent-green);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.2s;
}

.consent-modal__submit:hover:not(:disabled) {
  background: var(--color-consent-green-hover);
}

.consent-modal__submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Кнопка «ОТКЛОНИТЬ» — вернуться к баннеру политики */
.consent-modal__reject {
  padding: 0.625rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #b91c1c;
  background: transparent;
  border: 2px solid #b91c1c;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.consent-modal__reject:hover {
  background: #b91c1c;
  color: #fff;
}

/* ===== Всплывающее окно: бездействие 10 сек / уход с сайта (как на скрине 2) ===== */
.exit-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.exit-popup-overlay.is-visible {
  display: block;
}

.exit-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10003;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  pointer-events: none;
}

.exit-popup.is-visible {
  display: flex;
  pointer-events: auto;
}

.exit-popup__backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.exit-popup__box {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 2rem var(--spacing-xl) var(--spacing-xl);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
  pointer-events: auto;
}

.exit-popup__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}

.exit-popup__close:hover {
  color: #111;
  background: #f3f4f6;
}

.exit-popup__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #b91c1c;
  margin: 0 0 0.25rem;
  line-height: 1.3;
}

.exit-popup__subtitle {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--spacing-md);
}

.exit-popup__desc {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  line-height: 1.5;
  margin: 0 0 var(--spacing-xl);
}

.exit-popup__graphic {
  margin-bottom: var(--spacing-xl);
}

.exit-popup__emblem {
  max-width: 220px;
  height: auto;
  display: inline-block;
  object-fit: contain;
}

.exit-popup__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #6b7c3d;
  border: none;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, filter 0.2s;
  font-family: inherit;
}

.exit-popup__btn:hover {
  background: #5a6b2e;
  filter: brightness(1.05);
}

/* Второе окно выбора: «Вернуться» / «Приложение в телефон» — поверх первого попапа */
.exit-popup--choice {
  z-index: 10004;
}

.exit-popup__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  justify-content: center;
  margin-top: var(--spacing-lg);
}

.exit-popup__btn--secondary {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-search-border);
}

.exit-popup__btn--secondary:hover {
  background: #f3f4f6;
  filter: none;
}

/* Тост «Вход успешно предоставлен» */
.consent-toast {
  position: fixed;
  bottom: var(--spacing-xl);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: var(--spacing-md) var(--spacing-xl);
  background: var(--color-consent-green);
  color: #fff;
  font-weight: 500;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  z-index: 10002;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
}

.consent-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.consent-toast--error {
  background: #dc2626;
}

/* ===== Футер (тёмный красно-коричневый, частично прозрачный — видно фон) ===== */
.footer {
  width: 100%;
  background-color: rgba(74, 44, 42, 0.75); /* тёмный махагон, 75% непрозрачности */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--color-footer-text-light);
  padding: var(--spacing-2xl) var(--container-padding);
  margin-top: auto;
  position: relative;
  overflow: hidden;
}

/* Текстура отключена — однородный фон */
.footer__texture {
  display: none;
}

.footer-content {
  max-width: var(--container-max);
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer__copyright,
.footer__ogrn,
.footer__legal {
  font-size: 0.9375rem;
  margin: 0 0 var(--spacing-sm);
  opacity: 0.95;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem var(--spacing-sm);
  margin: var(--spacing-md) 0;
}

.footer__nav--secondary {
  margin-top: 0.25rem;
}

.footer__sep {
  color: rgba(255, 255, 255, 0.6);
  user-select: none;
}

.footer-link {
  color: var(--color-footer-text-light);
  font-size: 0.875rem;
  text-decoration: underline;
  opacity: 0.95;
  transition: opacity 0.2s;
}

.footer-link:hover {
  opacity: 1;
}

/* Цвет текстового блока футера */
.footer-content,
.footer__copyright,
.footer__ogrn,
.footer__legal,
.footer-link,
.footer__sep {
  color: #767573;
}

.footer__social {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.footer-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
}

.footer-social-btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
}

.footer-social-btn--vk { background: #4c75a3; }
.footer-social-btn--ok { background: #f58220; }
.footer-social-btn--tg { background: #229ed9; }
.footer-social-btn--wa { background: #25d366; }
.footer-social-btn--email { background: #ea4335; }

/* ===== Кнопка «Наверх» (слева) ===== */
.btn-scroll-top {
  position: fixed;
  bottom: 2rem;
  left: 1.5rem;
  z-index: 100;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid #f97316;
  background: var(--color-footer-dark);
  color: #f97316;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, transform 0.2s;
}

.btn-scroll-top:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-scroll-top svg {
  width: 24px;
  height: 24px;
}

/* ===== Кнопка чата (справа) ===== */
.btn-chat {
  position: fixed;
  bottom: 2rem;
  right: 1.5rem;
  z-index: 100;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  transition: opacity 0.2s, transform 0.2s;
}

.btn-chat:hover {
  opacity: 0.95;
  transform: scale(1.05);
}

.btn-chat__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #ef4444;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Адаптивность футера */
@media (max-width: 768px) {
  .footer__nav {
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
  }

  .footer__sep {
    display: none;
  }

  .btn-scroll-top,
  .btn-chat {
    bottom: 1rem;
  }
}
