/* Premium loading — ВСЕТОЧКИ Tours */

.tour-modal-backdrop--loading-gate {
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.tour-pl-card {
  position: relative;
  width: min(100%, 520px);
  max-width: calc(100vw - 32px);
  margin: 0 auto;
  padding: 28px 26px 24px;
  border-radius: 22px;
  background: linear-gradient(165deg, #ffffff 0%, #fffbf8 55%, #fff5ef 100%);
  border: 1px solid rgba(255, 125, 84, 0.18);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  text-align: center;
  box-sizing: border-box;
}

.tour-pl-card--compact {
  width: 100%;
  max-width: none;
  padding: 20px 18px 18px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.tour-pl-card--error {
  border-color: rgba(239, 68, 68, 0.2);
  background: linear-gradient(165deg, #fff 0%, #fef2f2 100%);
}

.tour-pl-card__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 20, 20, 0.06);
  color: #444;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.tour-pl-card__close:hover {
  background: rgba(255, 125, 84, 0.14);
}

.tour-pl-card__mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tour-pl-card--compact .tour-pl-card__mark {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
}

.tour-pl-card__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 125, 84, 0.15);
  animation: tourPlRing 2.4s ease-in-out infinite;
}

.tour-pl-card__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9a6c 0%, #ff7d54 100%);
  box-shadow: 0 0 0 6px rgba(255, 125, 84, 0.12);
  animation: tourPlDot 2s ease-in-out infinite;
}

.tour-pl-card__route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

.tour-pl-card__route span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #141414;
  opacity: 0.85;
}

.tour-pl-card__route span:nth-child(2) {
  background: #ff7d54;
  animation: tourPlRouteMid 1.8s ease-in-out infinite;
}

.tour-pl-card__route i {
  flex: 0 0 28px;
  height: 2px;
  background: linear-gradient(90deg, #141414, #ff7d54);
  opacity: 0.35;
  border-radius: 2px;
}

.tour-pl-card__title {
  margin: 0 0 8px;
  font-size: clamp(17px, 4vw, 20px);
  font-weight: 800;
  line-height: 1.3;
  color: #141414;
  letter-spacing: -0.02em;
}

.tour-pl-card--compact .tour-pl-card__title {
  font-size: 16px;
}

.tour-pl-card__subtitle {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
  max-width: 38ch;
  margin-left: auto;
  margin-right: auto;
}

.tour-pl-card--compact .tour-pl-card__subtitle {
  margin-bottom: 14px;
  font-size: 12px;
}

.tour-pl-card__status {
  min-height: 20px;
  font-size: 12px;
  font-weight: 600;
  color: #ff7d54;
  letter-spacing: 0.02em;
  transition: opacity 0.35s ease;
}

.tour-pl-card__status.is-fading {
  opacity: 0;
}

.tour-pl-card__progress {
  margin-top: 14px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 125, 84, 0.12);
  overflow: hidden;
}

.tour-pl-card__progress i {
  display: block;
  height: 100%;
  width: 36%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff7d54, #ffb08a);
  animation: tourPlProgress 2.2s ease-in-out infinite;
}

.tour-pl-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.tour-pl-card__actions .tour-ag-btn {
  min-width: 120px;
}

/* Inline overlay inside modal / checkout */
.tour-pl-inline-host {
  position: relative;
}

.tour-pl-inline-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(255, 251, 248, 0.82);
  backdrop-filter: blur(6px);
  border-radius: inherit;
}

.tour-pl-inline-overlay .tour-pl-card {
  width: min(100%, 440px);
}

/* Detail modal skeleton */
.tour-modal-content--detail-loading {
  max-height: min(92dvh, 920px);
}

.tour-pl-detail-skeleton {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 24px;
  padding: clamp(20px, 4vw, 28px);
  align-items: start;
}

.tour-pl-detail-skeleton__media {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  background: linear-gradient(90deg, #f6e8e0 20%, #fff6f0 40%, #f6e8e0 60%);
  background-size: 200% 100%;
  animation: tourPlShimmer 1.4s ease-in-out infinite;
}

.tour-pl-detail-skeleton__lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tour-pl-detail-skeleton__line {
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #eee 20%, #f8f8f8 45%, #eee 70%);
  background-size: 200% 100%;
  animation: tourPlShimmer 1.4s ease-in-out infinite;
}

.tour-pl-detail-skeleton__line--w80 { width: 80%; }
.tour-pl-detail-skeleton__line--w60 { width: 60%; }
.tour-pl-detail-skeleton__line--w45 { width: 45%; }
.tour-pl-detail-skeleton__line--price { width: 40%; height: 22px; margin-top: 8px; }

.tour-pl-detail-skeleton__sticky {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 24px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.tour-pl-detail-skeleton__btn {
  width: 180px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(90deg, #ffe8dc 20%, #fff0e8 45%, #ffe8dc 70%);
  background-size: 200% 100%;
  animation: tourPlShimmer 1.4s ease-in-out infinite;
}

/* Contract skeleton */
.tour-pl-contract-skeleton {
  margin-top: 12px;
  padding: 20px;
  border: 1px solid #e8eaed;
  border-radius: 14px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tour-pl-contract-skeleton__title {
  height: 18px;
  width: 55%;
  border-radius: 6px;
  background: linear-gradient(90deg, #e8e8e8 20%, #f4f4f4 45%, #e8e8e8 70%);
  background-size: 200% 100%;
  animation: tourPlShimmer 1.4s ease-in-out infinite;
}

.tour-pl-contract-skeleton__line {
  height: 11px;
  border-radius: 5px;
  background: linear-gradient(90deg, #ececec 20%, #f6f6f6 45%, #ececec 70%);
  background-size: 200% 100%;
  animation: tourPlShimmer 1.4s ease-in-out infinite;
}

.tour-pl-contract-skeleton__line--w90 { width: 90%; }
.tour-pl-contract-skeleton__line--w75 { width: 75%; }
.tour-pl-contract-skeleton__line--w60 { width: 60%; }

.tour-pl-contract-skeleton__block {
  margin-top: 8px;
  height: 72px;
  border-radius: 10px;
  background: linear-gradient(90deg, #e8e8e8 20%, #f2f2f2 45%, #e8e8e8 70%);
  background-size: 200% 100%;
  animation: tourPlShimmer 1.4s ease-in-out infinite;
}

@keyframes tourPlShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

@keyframes tourPlRing {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes tourPlDot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes tourPlRouteMid {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.35); opacity: 1; }
}

@keyframes tourPlProgress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
  .tour-pl-card__ring,
  .tour-pl-card__dot,
  .tour-pl-card__route span:nth-child(2),
  .tour-pl-card__progress i,
  .tour-pl-detail-skeleton__media,
  .tour-pl-detail-skeleton__line,
  .tour-pl-detail-skeleton__btn,
  .tour-pl-contract-skeleton__title,
  .tour-pl-contract-skeleton__line,
  .tour-pl-contract-skeleton__block {
    animation: none !important;
  }
}

@media (max-width: 900px) {
  .tour-modal-backdrop.tour-modal-backdrop--loading-gate {
    align-items: center !important;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)) !important;
  }

  .tour-modal-backdrop--loading-gate .tour-pl-card {
    width: calc(100% - 32px);
    max-width: 480px;
  }

  .tour-modal-backdrop--loading-gate .tour-modal-content--detail-loading {
    width: calc(100% - 24px);
    max-width: 100%;
    height: auto;
    max-height: min(82dvh, 680px);
    border-radius: 18px;
  }

  .tour-pl-detail-skeleton {
    grid-template-columns: 1fr;
  }
}
