/* ============================================================
   DESIGN SYSTEM — Каяк напрокат
   Shared reset, tokens, typography, components, utilities
   ============================================================ */

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* --- Design Tokens (CSS Custom Properties) --- */
:root {
  --color-bg: #D2DFE9;
  --color-blue: #054C84;
  --color-orange: #EC6305;
  --color-panel: #608BAD;
  --color-dark: #252525;
  --color-grey: #696969;
  --color-muted: #C9D6E0;
  --color-white: #ffffff;
  --color-card-bg: #EBEBEB;

  --font-primary: 'Montserrat', sans-serif;
  --font-heading: 'Roboto Condensed', sans-serif;

  --shadow-soft: 0 12px 30px rgba(8, 39, 63, .12);
  --shadow-logo: 0 4px 20px rgba(0, 0, 0, .25);
  --shadow-card: 8px 8px 70px rgba(0, 0, 0, .25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 25px;

  --container: 1440px;
  --gutter: 24px;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}


.container--narrow {
  max-width: 960px;
}

/* --- Utilities --- */
.text-shadow {
  text-shadow: 0 4px 20px rgba(0, 0, 0, .15);
}

.logo-text-shadow {
  text-shadow: 0.8px 3.3px 3.1px rgba(0, 0, 0, .25);
}

.gradient-card {
  background: linear-gradient(180deg, transparent 65%, rgba(0, 0, 0, 1) 100%);
}

/* Feature card hover */
.feature-card {
  cursor: pointer;
  transition: transform .3s ease;
}

.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .15);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
  border-radius: inherit;
}

.feature-card:hover {
  transform: translateY(-10px);
}

.feature-card:hover::after {
  opacity: 1;
}

/* Нижняя часть дольше тянется к --color-bg, чтобы стык со вторым блоком был мягким */
.hero-gradient-rental {
  background: linear-gradient(
    0deg,
    #D2DFE9 0%,
    #d8e3ed 12%,
    #b9c6d8 24%,
    #939FC4 40%,
    #054C84 100%
  );
}

/* Нижний слой hero проката: плавный уход в фон страницы (второй блок — bg-brand-bg) */
.rental-hero-bottom-fade {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 11;
  height: 8rem;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
}

@media (min-width: 1024px) {
  .rental-hero-bottom-fade {
    height: 14rem;
  }
}

/* Фиксированная «Наверх»: скрыта у верха страницы, видна после прокрутки (см. scroll-top.js) */
.scroll-top-btn {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  border-radius: 9999px;
  background: transparent;
  isolation: isolate;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.375rem);
  transition:
    opacity 0.28s ease,
    visibility 0.28s ease,
    transform 0.28s ease;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* Мягкое «облако» вокруг иконки — только при наведении / фокусе (вдвое компактнее прежнего) */
.scroll-top-btn::before {
  content: '';
  position: absolute;
  inset: -0.5625rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: scale(0.62);
  transform-origin: center;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
  z-index: 0;
  pointer-events: none;
}

.scroll-top-btn:hover::before,
.scroll-top-btn:focus-visible::before {
  opacity: 1;
  transform: scale(1);
}

.scroll-top-btn:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 4px;
}

.scroll-top-btn img {
  position: relative;
  z-index: 1;
  display: block;
  width: 2rem;
  height: 2.5rem;
  max-width: none;
  object-fit: contain;
}

@media (min-width: 1024px) {
  .scroll-top-btn {
    width: 6.25rem;
    height: 6.25rem;
  }

  .scroll-top-btn img {
    width: 2.5rem;
    height: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top-btn,
  .scroll-top-btn::before {
    transition-duration: 0.01ms;
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  transition: opacity .2s ease, transform .15s ease;
  white-space: nowrap;
}

.btn:hover {
  opacity: .88;
}

.btn:active {
  transform: scale(.97);
}

.btn-orange {
  background-color: var(--color-orange);
  color: var(--color-white);
  max-width: 300px;
}

.btn-orange-outline {
  background-color: transparent;
  border: 2px solid var(--color-orange);
  color: var(--color-orange);
}

.btn-disabled {
  background-color: #D7D7D7;
  color: #A1A1A1;
  pointer-events: none;
}

/* Size variants */
.btn-md {
  padding: 0.625rem 2rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.btn-lg {
  padding: 0.875rem 2.5rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
}

@media (min-width: 1024px) {
  .lg\:btn-lg {
    padding: 0.875rem 2.5rem;
    font-size: 1.25rem;
    line-height: 1.75rem;
  }
}

/* --- Calendar --- */
.cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-blue);
  cursor: pointer;
  transition: background-color .15s ease;
}

.cal-day:hover {
  background-color: rgba(5, 76, 132, .1);
}

.cal-day--muted {
  color: #C0C2C9;
  pointer-events: none;
}

.cal-day--selected {
  background-color: var(--color-blue);
  color: var(--color-white);
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background-color: var(--color-blue);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
}

/* --- Kayak Card --- */
.kayak-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: var(--color-white);
  padding: 20px;
}

.kayak-card__photo {
  margin-top: 12px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background-color: var(--color-card-bg);
}

.kayak-card__photo img {
  width: 100%;
  object-fit: contain;
}

.kayak-card__meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.kayak-card__meta-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kayak-card__price {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--color-orange);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .kayak-card__price {
    font-size: 1.3rem;
  }
}

.kayak-card__actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.kayak-card__actions .btn {
  flex: 1;
}

/* Gear cards: single button occupies 50% and aligns to the right */
[data-gear-slug] .kayak-card__actions {
  justify-content: flex-end;
}

[data-gear-slug] .kayak-card__actions .btn {
  flex: 0 0 50%;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-white);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  pointer-events: auto;
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  transition: transform .4s cubic-bezier(.22, .68, 0, 1.1), opacity .4s ease;
}

.toast--visible {
  transform: translateX(0);
  opacity: 1;
}

.toast--hiding {
  transform: translateX(calc(100% + 24px));
  opacity: 0;
}

.toast--error {
  background-color: var(--color-orange);
}

.toast--success {
  background-color: #1a9e5c;
}

.toast__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.toast__text {
  flex: 1;
}

.toast__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: rgba(255, 255, 255, .7);
  border-radius: 50%;
  transition: color .15s ease, background-color .15s ease;
}

.toast__close:hover {
  color: var(--color-white);
  background-color: rgba(255, 255, 255, .15);
}

@media (max-width: 480px) {
  .toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

/* --- Loader --- */
.loader-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: relative;
  animation: rotate 1s linear infinite;
}

.loader::before,
.loader::after {
  content: "";
  box-sizing: border-box;
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 5px solid var(--color-blue);
  animation: prixClipFix 2s linear infinite;
}

.loader::after {
  inset: 8px;
  transform: rotate3d(90, 90, 0, 180deg);
  border-color: var(--color-orange);
}

.loader--sm {
  width: 24px;
  height: 24px;
}

.loader--sm::before,
.loader--sm::after {
  border-width: 3px;
}

.loader--sm::after {
  inset: 4px;
}

.loader--light::before {
  border-color: var(--color-white);
}

.loader--light::after {
  border-color: rgba(255, 255, 255, .5);
}

@keyframes rotate {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes prixClipFix {
  0%   { clip-path: polygon(50% 50%, 0 0, 0 0, 0 0, 0 0, 0 0); }
  50%  { clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 0, 100% 0, 100% 0); }
  75%, 100% { clip-path: polygon(50% 50%, 0 0, 100% 0, 100% 100%, 100% 100%, 100% 100%); }
}
