/* ============================================================
   VIPTIK — Адаптив
   ============================================================ */

/* Планшет (< 1024px) */
@media (max-width: 1023px) {
  .container { padding: 0 20px; }

  .nav {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(320px, 88vw);
    background: rgba(255,255,255,.34); z-index: 950; padding: 84px 20px 28px;
    backdrop-filter: blur(26px) saturate(1.12);
    -webkit-backdrop-filter: blur(26px) saturate(1.12);
    transform: translateX(100%); transition: transform var(--t-med) var(--ease);
    overflow-y: auto; box-shadow: var(--shadow-lg);
    -webkit-overflow-scrolling: touch;
  }
  .nav.open { transform: translateX(0); }
  .nav__list {
    flex-direction: column; align-items: stretch; gap: 4px;
    min-height: calc(100dvh - 112px);
    display: flex;
  }
  .nav__link {
    display: flex; padding: 12px 16px; border-radius: var(--r-md);
    font-size: 1rem; color: var(--ink);
  }
  .nav__item--cta {
    display: flex; flex-direction: column; gap: 10px;
    margin-top: auto; padding-top: 18px;
    border-top: 1px solid var(--stone);
  }

  .burger { display: flex; flex-shrink: 0; }
  .nav-overlay { display: block; pointer-events: none; }
  .nav-overlay.active { pointer-events: auto; }

  .header__inner { gap: 10px; padding: 10px 0; }
  .header--scrolled {
    top: 10px;
    padding: 0 14px;
  }
  .header--scrolled .header__bg {
    border-radius: 18px;
    box-shadow:
      0 10px 32px rgba(44,87,120,.2),
      0 3px 10px rgba(34,32,29,.08);
  }
  .header--scrolled .header__inner { padding: 8px 0; }
  .header__logo { flex-shrink: 0; min-width: 0; }
  .header__logo-img { height: 36px; }
  .header__actions { display: flex; gap: 8px; margin-left: auto; }
  .header__phone { font-size: .88rem; }
  .header__cta { padding: 9px 16px; font-size: .86rem; }
  .nav__item--cta { display: none !important; }
  .topbar__item--hours,
  .topbar__item--addr,
  .topbar__socials { display: none; }
  .topbar__inner { justify-content: center; }
  .topbar__phone {
    width: 100%;
    justify-content: center;
    font-size: .95rem;
    letter-spacing: .01em;
    white-space: nowrap;
  }

  .hero__content .container { grid-template-columns: 1fr; gap: 28px; }
  .hero__visual { max-width: 480px; }
  .hero__copy { max-width: none; }

  .dest-grid { grid-template-columns: repeat(2, 1fr); }
  .mood-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .steps { gap: 22px; }
  .callback-inner { grid-template-columns: 1fr; gap: 32px; }
  .search-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 88vw);
    z-index: 860; transform: translateX(-100%);
    transition: transform var(--t-med) var(--ease);
    border-radius: 0; overflow-y: auto;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .tour-detail__grid { grid-template-columns: 1fr; gap: 28px; }
  .tour-detail__sticky { position: static; }
  .footer__inner { grid-template-columns: 1fr 1fr; gap: 32px; }

  .about-intro { grid-template-columns: 1fr; gap: 36px; }
  .about-values { grid-template-columns: repeat(2, 1fr); }
  .about-team { grid-template-columns: repeat(2, 1fr); }
}

/* Мобильный (< 768px) */
@media (max-width: 767px) {
  .section { padding: 52px 0; }
  .section-header { margin-bottom: 32px; }

  .topbar { display: none; }

  .header__inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px;
  }
  .header__logo { grid-column: 1; min-width: 0; }
  .header__actions {
    grid-column: 3;
    display: contents;
  }
  .header__phone {
    grid-column: 2;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0 2px;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0;
    white-space: nowrap;
    color: var(--ember);
  }
  .header__phone-icon { display: none; }
  .header__phone-text--full { display: none; }
  .header__phone-text--short {
    display: inline;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header__cta { grid-column: 3; }
  .burger { grid-column: 4; }

  .header--scrolled {
    top: 8px;
    padding: 0 10px;
  }
  .header--scrolled .header__bg { border-radius: 16px; }
  .header__logo-img { height: 30px; }
  .header__cta-long { display: none; }
  .header__cta-short { display: inline; }
  .header__cta { padding: 8px 10px; font-size: .74rem; white-space: nowrap; }

  .page-hero { padding: 48px 0 36px; }
  .page-hero h1 { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .page-hero p { font-size: 1rem; }

  .hero--video { min-height: auto; }
  .hero__content { padding: 32px 0 40px; }
  .hero__badge { font-size: .74rem; padding: 6px 12px; line-height: 1.35; }
  .hero__title { font-size: clamp(1.9rem, 8.5vw, 2.8rem); }
  .hero__subtitle { font-size: 1rem; margin-bottom: 22px; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; justify-content: center; }
  .hero__moods { gap: 8px; }
  .hero__moods a { font-size: .82rem; padding: 8px 12px; }
  .hero__float { display: none; }

  .search-box { padding: 16px; border-radius: var(--r-lg); }
  .search-tabs { width: 100%; }
  .search-tab { flex: 1; justify-content: center; padding: 9px 12px; font-size: .84rem; }
  .search-form__grid { grid-template-columns: 1fr; }
  .search-btn { width: 100%; }

  .search-hero-form { flex-direction: column; align-items: stretch; max-width: none; }
  .search-hero-form .btn { width: 100%; }
  .actual-search-note { font-size: .84rem; }

  .dest-grid { grid-template-columns: 1fr; }
  .mood-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; }
  .mood-section__header { flex-direction: column; align-items: flex-start; }
  .mood-section__header .btn { width: 100%; }

  .review-card { flex: 0 0 calc(100vw - 48px); }
  .form-row { grid-template-columns: 1fr; }
  .callback-form { padding: 22px 18px; }

  .filter-tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; padding-bottom: 4px; margin-left: -4px; margin-right: -4px; padding-left: 4px; padding-right: 4px; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab { flex-shrink: 0; font-size: .84rem; padding: 8px 14px; }
  .results-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .results-sort { width: 100%; justify-content: space-between; }
  .sort-select { flex: 1; max-width: 220px; }

  .footer__inner { grid-template-columns: 1fr; gap: 28px; padding-top: 48px; }
  .footer__bottom-inner { flex-direction: column; text-align: center; }
  .footer__bottom-links { flex-wrap: wrap; justify-content: center; }
  .footer__callback-row { flex-wrap: wrap; }
  .footer__callback-btn { width: 100%; }

  .about-metrics { grid-template-columns: 1fr 1fr; }
  .about-values { grid-template-columns: 1fr; }
  .about-team { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; }
  .about-licenses { flex-direction: column; align-items: stretch; }
  .about-license { min-width: 0; }
  .about-cta__actions { flex-direction: column; align-items: stretch; }
  .about-cta__actions .btn { width: 100%; }

  .contact-fast { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .contact-map__frame { height: 280px; }
  .contact-map__bubble { min-width: 108px; height: 50px; }
  .contact-map__bubble img { height: 24px; }
  .contact-map__open { right: 10px; bottom: 10px; font-size: .78rem; padding: 8px 12px; }
  .contact-form-card { padding: 24px 18px; }

  /* Тур */
  .tour-hero { height: clamp(240px, 58vw, 360px); }
  .tour-hero__content { padding: 18px 0; }
  .tour-hero__bottom { flex-direction: column; align-items: flex-start; }
  .tour-hero__price { text-align: left; width: 100%; }
  .tour-hero__title { font-size: clamp(1.35rem, 6vw, 1.8rem); }
  .breadcrumb--light { font-size: .78rem; flex-wrap: wrap; }
  .gallery-grid { grid-template-columns: 1fr 1fr; grid-template-rows: 140px 100px; }
  .gallery-grid__main { grid-column: 1 / -1; grid-row: auto; height: 180px; }
  .tour-conditions__row { flex-direction: column; gap: 4px; }
  .tour-conditions__label { min-width: 0; }

  .price-card {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 650;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: none;
    max-height: min(88vh, 640px);
    overflow-y: auto;
    transform: translateY(calc(100% - 76px));
    transition: transform var(--t-med) var(--ease);
    padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 32px rgba(34,32,29,.18);
  }
  .price-card.expanded { transform: translateY(0); }
  .price-card__handle {
    display: block; width: 44px; height: 5px; margin: 0 auto 12px;
    border: none; border-radius: var(--r-full); background: var(--stone); cursor: pointer;
  }
  .price-card__price { font-size: 1.6rem; }
  .price-card__actions { flex-direction: column; }
  .price-card__actions .btn { width: 100%; }
  body.tour-page { padding-bottom: 84px; }

  /* Плавающие элементы */
  .tik-widget { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .scroll-top { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); right: 16px; width: 42px; height: 42px; }
  .cookie-banner {
    left: 12px; right: 12px; bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px;
  }
  .cookie-banner .btn { width: 100%; }
  .toast-container { left: 12px; right: 12px; top: auto; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  .toast { max-width: none; }
}

/* Узкие экраны (< 400px) */
@media (max-width: 399px) {
  .container { padding: 0 16px; }
  .header__inner { gap: 4px; }
  .header__logo-img { height: 26px; }
  .header__phone { font-size: .72rem; letter-spacing: 0; }
  .header__cta { padding: 7px 8px; font-size: .7rem; }
  .burger { width: 36px; height: 36px; padding: 9px; }
  .hero__badge { display: flex; align-items: flex-start; }
  .gr-banner { padding: 22px 18px; }
  .gr-banner__actions .btn { width: 100%; }
}
