/* Buenos Padel — unified header & footer (Redesign v3 «Dark Court» · Task 37) */

:root {
  --bp-header-h: 72px;
}

/* Reserve space for sticky header */
body.bp-has-nav {
  padding-top: var(--bp-header-h);
}

/* Lock body scroll when mobile drawer is open */
body.bp-nav-open {
  overflow: hidden;
}

/* ========== Header ========== */

.bp-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(5, 13, 24, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line, #16273d);
  font-family: var(--ff-body);
  -webkit-font-smoothing: antialiased;
}

.bp-nav__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: var(--bp-header-h);
  display: flex;
  align-items: center;
  gap: 32px;
}

.bp-nav__brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.bp-nav__brand img {
  display: block;
  height: 38px;
  width: auto;
  aspect-ratio: 710 / 211;
  object-fit: contain;
}

.bp-nav__links {
  display: flex;
  gap: 24px;
  margin-left: auto;
  align-items: center;
}

.bp-nav__links a {
  color: var(--text-soft, #c6d3e2);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.bp-nav__links a:hover {
  color: var(--accent, #93d032);
}

.bp-nav__links a.is-active {
  color: var(--accent, #93d032);
  border-bottom-color: var(--accent, #93d032);
}

.bp-nav__links a.bp-nav__invest {
  color: var(--accent, #93d032);
  font-weight: 700;
}
.bp-nav__links a.bp-nav__invest:hover { color: #ffffff; }

.bp-nav__cta {
  flex-shrink: 0;
  background: var(--accent, #93d032);
  color: var(--accent-ink, #050d18);
  text-decoration: none;
  font-family: var(--ff-body);
  font-weight: 800;
  font-size: 14px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  letter-spacing: 0;
  text-transform: none;
  transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.bp-nav__cta:hover {
  background: #ffffff;
  transform: translateY(-1px);
  color: var(--accent-ink, #050d18);
}

.bp-nav__burger {
  display: none;
  background: none;
  border: 0;
  width: 40px;
  height: 40px;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  margin-left: auto;
}

.bp-nav__burger span {
  display: block;
  height: 2px;
  background: var(--text, #f2f6fb);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.bp-nav__burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.bp-nav__burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.bp-nav__burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* ========== Drawer (mobile) ========== */

.bp-drawer {
  display: none;
}

.bp-drawer[data-bp-drawer]:not([hidden]) {
  display: flex;
}

.bp-drawer {
  position: fixed;
  top: var(--bp-header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg, #050d18);
  flex-direction: column;
  padding: 24px;
  gap: 8px;
  overflow-y: auto;
  animation: bp-drawer-in 0.2s ease;
}

@keyframes bp-drawer-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bp-drawer__links {
  display: flex;
  flex-direction: column;
}

.bp-drawer__links a {
  color: var(--text, #f2f6fb);
  text-decoration: none;
  font-family: var(--ff-display);
  font-weight: 700;
  text-transform: none;
  font-size: 22px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line, #16273d);
  letter-spacing: -0.01em;
}

.bp-drawer__links a.is-active {
  color: var(--accent, #93d032);
}

.bp-drawer__cta {
  margin-top: 24px;
  background: var(--accent, #93d032);
  color: var(--accent-ink, #050d18);
  text-decoration: none;
  font-family: var(--ff-body);
  font-weight: 800;
  font-size: 16px;
  padding: 16px 24px;
  border: 0;
  border-radius: 999px;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
}

/* ========== Footer ========== */

.bp-footer {
  background: linear-gradient(180deg, var(--bg, #050d18), #04152a);
  color: var(--text, #f2f6fb);
  font-family: var(--ff-body);
  padding: 70px 24px 40px;
  margin-top: 110px;
  border-top: 1px solid var(--line, #16273d);
  overflow: hidden;
}

.bp-footer__inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px;
}

.bp-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.bp-footer__logo {
  display: block;
  height: 48px;
  width: auto;
  aspect-ratio: 710 / 211;
  object-fit: contain;
}

.bp-footer__tagline {
  font-family: var(--ff-display);
  font-weight: 700;
  text-transform: none;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--text-soft, #c6d3e2);
  margin: 0;
}

/* Мобильное приложение: стор-бейджи + строка про баллы (Task 34) */
.bp-footer__app {
  margin-top: 12px;
}

.bp-footer__app-note {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted, #8fa3ba);
  max-width: 240px;
}

.bp-footer__app-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bp-footer__app-badges a {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border: 1.5px solid rgba(242, 246, 251, 0.35);
  border-radius: 999px;
  color: var(--text, #f2f6fb);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.bp-footer__app-badges a:hover {
  border-color: var(--accent, #93d032);
  color: var(--accent, #93d032);
  background: transparent;
}

/* Рейтинг-виджет Яндекс Справочника (Task 34) */
.bp-footer__rating {
  display: block;
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
}

.bp-footer__col h4 {
  font-family: var(--ff-body);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--dim, #5b7089);
  margin: 0 0 16px;
}

.bp-footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bp-footer__col a {
  color: var(--text-soft, #c6d3e2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  transition: color 0.15s ease;
}

.bp-footer__col a:hover {
  color: var(--accent, #93d032);
  text-decoration: none;
  opacity: 1;
}

.bp-footer__entity {
  display: block;
  font-size: 12px;
  color: var(--dim, #5b7089);
  letter-spacing: 0.02em;
  margin: 0 0 3px;
}

.bp-footer__divider {
  height: 0;
  border-top: 1px solid var(--line, #16273d);
  margin: 8px 0 2px;
  padding: 0;
}

.bp-footer__sub {
  list-style: none;
  padding: 6px 0 4px 12px;
  margin: 6px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid var(--line, #16273d);
}
.bp-footer__sub a {
  font-size: 13px;
  color: var(--muted, #8fa3ba);
}
.bp-footer__sub a:hover { color: var(--accent, #93d032); }

.bp-footer__soon {
  color: var(--dim, #5b7089);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.bp-footer__soon span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: rgba(242, 246, 251, 0.08);
  color: var(--muted, #8fa3ba);
  padding: 2px 8px;
  border-radius: 999px;
}

/* Giant outlined wordmark (design: footer «BUENOS PADEL») */
.bp-footer__wordmark {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: clamp(48px, calc(var(--bp-avail, 100vw) * 0.078), 150px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--outline-ink, #1d3a5f);
  white-space: nowrap;
  text-align: center;
  margin: 70px auto 0;
  user-select: none;
}

.bp-footer__legal {
  max-width: 1440px;
  margin: 36px auto 0;
  padding-top: 0;
  border-top: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--dim, #5b7089);
}


/* ========== Responsive ========== */

@media (max-width: 1180px) {
  .bp-nav__links,
  .bp-nav__cta {
    display: none;
  }
  .bp-nav__burger {
    display: flex;
  }
  .bp-nav__inner {
    gap: 16px;
    padding: 0 16px;
  }
}
@media (max-width: 960px) {
  .bp-footer__inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .bp-footer__brand {
    grid-column: 1 / -1;
  }
  .bp-footer__wordmark { margin-top: 48px; }
}

@media (max-width: 520px) {
  .bp-footer {
    padding: 48px 16px 28px;
    margin-top: 72px;
  }
  .bp-footer__inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* ========== Booking widget override ========== */
/* my.buenospadel.ru/widget.js hardcodes bottom:140px on its round button —
   clearance for the old YClients bubble that no longer exists. Pull it down. */
#buenos-widget-button {
  bottom: 24px !important;
}

/* ========== Theatrical curtains (Task 37 experiment -> sitewide) ========== */
/* Инжектятся nav.js на каждой странице. На десктопе (>=1181px) шторам всегда
   резервируется место: контейнеры и футер ужимаются, ткань контент не трогает.
   Шторы выше секций (z:999), но ниже навбара (1000) — выходят из-под него. */
.bp-curtains { --amp: 4; }
.bp-curtain {
  position: fixed;
  top: 0;
  bottom: 0;
  /* полное полотно в полэкрана; наружу выглядывает только кромка
     --bp-curtain-w, остальная ткань ждёт за краем (пасхалка: потяни) */
  width: calc(50vw + 6px);
  z-index: 999;
  pointer-events: none;
  display: none;
}
.bp-curtain--l { left: 0; transform: translateX(calc(var(--bp-curtain-w, 0px) - 100%)); }
.bp-curtain--r { right: 0; transform: translateX(calc(100% - var(--bp-curtain-w, 0px))); }
.bp-curtain--r svg { transform: scaleX(-1); }

/* Брендинг на полотнах — виден, когда штору вытягивают (пасхалка) */
.bp-curtain__brand {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72%;
  text-align: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.bp-curtain__brand img {
  display: block;
  width: min(340px, 64%);
  height: auto;
  margin: 0 auto;
  opacity: 0.92;
  filter: drop-shadow(0 6px 28px rgba(0, 0, 0, 0.5));
}
.bp-curtain__brand--text {
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: clamp(22px, 2.2vw, 40px);
  line-height: 1.3;
  color: var(--text, #f2f6fb);
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.55);
}
.bp-curtain svg { width: 100%; height: 100%; display: block; }
.bp-curtain .fold {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  animation: bp-curtain-sway 6.5s ease-in-out infinite;
}
.bp-curtain .fold:nth-of-type(2) { animation-delay: -1.6s; animation-duration: 8s; }
.bp-curtain .fold:nth-of-type(3) { animation-delay: -3.1s; animation-duration: 5.8s; }
.bp-curtain .fold:nth-of-type(4) { animation-delay: -4.4s; animation-duration: 8.7s; }
.bp-curtain .fold:nth-of-type(5) { animation-delay: -2.3s; animation-duration: 7.2s; }
@keyframes bp-curtain-sway {
  0%, 100% { transform: translateX(0) skewX(0deg); }
  50% { transform: translateX(calc(var(--amp, 4) * 1px)) skewX(calc(var(--amp, 4) * 0.14deg)); }
}
@media (min-width: 1181px) {
  :root {
    --bp-curtain-w: clamp(48px, calc((100vw - 1400px) / 2 - 16px), 220px);
    /* доступная контенту ширина: вьюпорт минус шторы и зазоры; display-клампы
       в landing.css масштабируются от неё, а не от 100vw */
    --bp-avail: calc(100vw - 2 * var(--bp-curtain-w) - 32px);
  }
  .bp-curtain { display: block; }
  /* body-префикс: перебиваем базовый .bp-container { max-width:1400 } из
     landing.css, который грузится позже nav.css */
  body .bp-container,
  body .bp-traction__grid,
  body .bp-footer__inner,
  body .bp-footer__legal {
    max-width: min(1400px, calc(100vw - 2 * var(--bp-curtain-w) - 32px));
  }
  body .bp-traction__grid { margin-left: auto; margin-right: auto; }
  body .bp-footer__wordmark {
    max-width: min(1400px, calc(100vw - 2 * var(--bp-curtain-w) - 32px));
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bp-curtain .fold { animation: none; }
}
