/* ==========================================================================
   Расписание: календарь и карточки туров
   ========================================================================== */

.sched-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--cream);
  padding: clamp(120px, 10vw, 160px) 0 clamp(34px, 4vw, 58px);
  min-height: clamp(460px, 46vw, 600px);
  display: flex;
  align-items: flex-end;
}
.sched-hero__media { position: absolute; inset: 0; z-index: -2; background: var(--pine); }
.sched-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.sched-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 22, 16, 0.62) 0%, rgba(8, 22, 16, 0.32) 30%, rgba(8, 22, 16, 0.86) 100%),
    linear-gradient(90deg, rgba(8, 22, 16, 0.72), rgba(8, 22, 16, 0.08) 70%);
}
.sched-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: clamp(28px, 4vw, 64px);
  align-items: end;
}
.sched-hero__text .breadcrumbs { margin-bottom: 20px; }
.sched-hero h1 { font-size: clamp(38px, 5.4vw, 78px); line-height: 1; margin: 14px 0 16px; }
.sched-hero .lead { font-size: clamp(15px, 1.3vw, 18px); }
.sched-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 34px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.sched-hero__stats b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 400;
  line-height: 1;
}
.sched-hero__stats span {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 243, 234, 0.55);
}

/* Ближайший выезд */
.next-trip {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.next-trip__media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--stone); }
.next-trip__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.next-trip:hover .next-trip__media img { transform: scale(1.05); }
.next-trip__badge {
  position: absolute; left: 12px; top: 12px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.next-trip__body { padding: 18px 20px 20px; display: grid; gap: 8px; }
.next-trip__date { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-dark); }
.next-trip h2 { font-size: clamp(20px, 1.7vw, 25px); line-height: 1.12; }
.next-trip__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.next-trip__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.next-trip__foot b { font-family: var(--font-display); font-size: 22px; font-weight: 400; }

/* Категории */
.sched-section { padding-top: clamp(34px, 4vw, 54px); overflow-anchor: none; }
.sched-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 2px 14px;
  margin: 0 -2px;
}
.sched-tabs::-webkit-scrollbar { display: none; }
.sched-tab {
  flex: 0 0 auto;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(13, 42, 32, 0.055);
  color: #4a5a51;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.sched-tab:hover { background: rgba(13, 42, 32, 0.1); color: var(--pine); }
.sched-tab.is-active { background: var(--pine); border-color: var(--pine); color: var(--cream); }

/* Раскладка */
.sched-layout {
  overflow-anchor: none;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: clamp(22px, 3vw, 38px);
  align-items: start;
}

/* Календарь */
.calendar {
  scroll-margin-top: calc(var(--header-h) + 18px);
  position: sticky;
  top: calc(var(--header-h) + 18px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.calendar__head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.calendar__title { flex: 1; text-align: center; }
.calendar__title span {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.calendar__title h2 { font-size: 25px; line-height: 1.15; margin-top: 2px; }
.calendar__nav {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--pine);
  transition: background 0.2s, color 0.2s;
}
.calendar__nav:hover { background: var(--pine); color: var(--cream); border-color: var(--pine); }
.calendar__nav svg { width: 17px; height: 17px; }
.calendar__dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.calendar__dow span {
  text-align: center; font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal__day {
  position: relative;
  aspect-ratio: 1;
  border-radius: 11px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
  font-size: 13px;
  color: #3f4d45;
  transition: background 0.18s, color 0.18s;
}
.cal__day:hover { background: rgba(0, 152, 70, 0.1); }
.cal__day.has-tours { background: rgba(0, 152, 70, 0.08); font-weight: 800; color: var(--brand-dark); }
.cal__day.has-tours:hover { background: var(--brand); color: #fff; }
.cal__day.is-selected { background: var(--pine); color: var(--cream); }
.cal__day.is-selected:hover { background: var(--pine); }
.cal__day.is-today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.cal__day.is-out { opacity: 0.26; font-weight: 400; }
.cal__num { line-height: 1; }
.cal__count { font-size: 8.5px; font-weight: 800; line-height: 1; opacity: 0.7; }
.cal__day.is-selected .cal__count { opacity: 1; color: var(--sand); }
.calendar__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 11.5px;
}
.calendar__foot > a { font-weight: 800; color: var(--brand-dark); text-decoration: underline; text-underline-offset: 3px; }
.calendar__legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.calendar__legend i { width: 8px; height: 8px; border-radius: 50%; background: rgba(0, 152, 70, 0.35); }

/* Результаты */
.sched-results__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.sched-results__head h2 { font-size: clamp(26px, 3vw, 42px); line-height: 1.06; margin-top: 8px; }
.sched-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sched-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.3s;
}
.sched-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(0, 152, 70, 0.3); }
.sched-card__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--stone); }
.sched-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.sched-card:hover .sched-card__media img { transform: scale(1.05); }
.sched-card__date {
  position: absolute; left: 10px; bottom: 10px;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(8, 22, 16, 0.72); color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
  backdrop-filter: blur(6px);
}
.sched-card__seats {
  position: absolute; right: 10px; top: 10px;
  padding: 5px 9px; border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
}
.sched-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.sched-card__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); }
.sched-card h3 { font-size: clamp(19px, 1.6vw, 23px); line-height: 1.14; }
.sched-card h3 a:hover { color: var(--brand-dark); }
.sched-card__foot {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.sched-card__price span { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.sched-card__price b { font-size: 16px; color: var(--pine); }
.sched-upcoming { margin-top: clamp(40px, 5vw, 70px); padding-top: clamp(28px, 3.4vw, 44px); border-top: 1px solid var(--line); }
.sched-upcoming .sched-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sched-upcoming .sched-card h3 { font-size: 18px; }
.sched-upcoming .sched-card__body { padding: 14px 16px 16px; }
.sched-upcoming .sched-card__date { font-size: 10px; }
.sched-note { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.sched-empty {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 22px;
  padding: clamp(30px, 5vw, 60px);
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
}
.sched-empty svg { width: 40px; height: 40px; color: var(--brand); opacity: 0.6; }
.sched-empty h3 { font-size: 26px; }
.sched-empty p { color: var(--muted); max-width: 46ch; font-size: 14px; }

/* Адаптив */
@media (max-width: 1100px) {
  .sched-hero__inner { grid-template-columns: 1fr 320px; }
  .sched-layout {
  overflow-anchor: none; grid-template-columns: 330px minmax(0, 1fr); }
  .sched-grid, .sched-upcoming .sched-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sched-hero { padding-top: 110px; }
  .sched-hero__inner { grid-template-columns: 1fr; align-items: start; }
  .next-trip { max-width: 420px; }
  .sched-layout {
  overflow-anchor: none; grid-template-columns: 1fr; }
  .calendar { position: static; }
  .sched-grid, .sched-upcoming .sched-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .sched-hero { min-height: 0; padding-top: 100px; }
  .sched-hero h1 { font-size: clamp(36px, 11vw, 52px); }
  .sched-hero__stats { gap: 12px 22px; }
  .next-trip { max-width: 100%; }
  .calendar { padding: 14px; border-radius: 20px; }
  .calendar__title h2 { font-size: 22px; }
  .cal__day { border-radius: 9px; font-size: 12.5px; }
  .sched-grid, .sched-upcoming .sched-grid { grid-template-columns: 1fr; }
  .sched-card__media { aspect-ratio: 16 / 10; }
}


/* Плавное обновление без перезагрузки */
.sched-section.is-updating .sched-tabs,
.sched-section.is-updating .sched-layout,
.sched-section.is-updating .sched-upcoming {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.2s var(--ease);
}
