.image-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

/* Бейдж пакета на странице детализации мероприятия.
   По умолчанию встаёт на место бейджа "Проверенный организатор" (слева сверху). */
.event-badge--detail {
  position: absolute;
  top: 15px;
  left: 15px;
  right: auto;
  z-index: 9;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: clamp(0.6rem, 1vw, 0.8rem);
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Если рядом есть бейдж "Проверенный организатор" — опускаем бейдж пакета под него. */
.event-badge--detail.event-badge--below-verified {
  top: 55px;
}

.carousel-item {
  /* Убираем фиксированную высоту, если она была */
  height: 100%;
}
.image-wrapper img,
.carousel-item img {
  object-fit: cover;
  display: block;
}
.image-wrapper.no-image .card-logo-placeholder {
  width: 100%;
  height: 100%;
  padding: 18%;
  box-sizing: border-box;
  object-fit: contain;
  background-color: #f5f5f5;
}

.verified-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: #02369c;
  padding: 6px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.verified-badge .arrow-card {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.verified-badge .card-verified {
  font-family: "Verdana";
  font-size: clamp(0.6rem, 1vw, 0.8rem);
  font-weight: 400;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 2px;
}

.event-description {
  font-family: "Verdana";
  font-size: clamp(0.7rem, 1vw, 0.8rem);
  font-weight: 400;
  color: rgb(7, 7, 7);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.event-description > * {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.event-description p {
  margin: 0 0 0.5em;
  line-height: 1.5;
}

.event-description ul,
.event-description ol {
  margin: 0.5em 0 0.75em 1.25em;
  padding-left: 1.25em;
  line-height: 1.5;
}

.event-description li {
  margin: 0.2em 0;
  padding-left: 0.15em;
}

.event-description a {
  color: #0756b3;
  font-weight: 600;
  text-decoration: none;
}
.event-description a:hover {
  color: #02369c;
}
.event-title {
  font-family: "Verdana";
  font-weight: 400;
  font-size: clamp(1rem, 1vw, 1.5rem);
  color: #000000;
  line-height: 1.2;
}

.date-address-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.date-address-row .date-cell,
.date-address-row .address-cell {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.date-address-row .date-cell p,
.date-address-row .address-cell p {
  margin: 0;
  padding: 0;
  line-height: 1.5;
  display: flex;
  align-items: center;
}

.info-tags-row {
  width: 90%;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 12px;
}

.info-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.info-tag .tag-label {
  font-family: "Verdana";
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  color: #777a8d;
  font-weight: 400;
}

.info-tag .tag-value {
  font-family: "Verdana";
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  color: #000000;
  font-weight: 400;
}
.tag-value {
  margin-right: 15px;
}
.price-detail-h {
  font-family: "Verdana";
  font-weight: 700;
  font-size: 1rem;
  color: #807b7b;
}

.date-address-row .date-cell,
.date-address-row .address-cell {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.date-address-row .date-cell p,
.date-address-row .address-cell p {
  margin: 0;
  padding: 0;
  line-height: 1.5;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
}
.card-date-geo-detail {
  font-size: clamp(0.65rem, 1vw, 0.8rem);
  color: #000000;
  font-family: "Verdana";
  font-weight: 700;
}
.icon-calendar-geo {
  margin-right: 7px;
}

/* Секция видео на всю ширину */
.video-section.full-width-video {
  width: 100%;
  margin: 0; /* Убираем внешние отступы */
  padding: 0; /* Убираем внутренние отступы */
  background-color: #000; /* Черный фон для контраста */
}

.no-video-placeholder {
  width: 100%;
  padding: 40px;
  text-align: center;
  background: #f8f9fa;
  color: #6c757d;
  font-size: 1.2rem;
}
.video-player {
  width: 100%;
  height: auto;
  display: block;
  background-color: #000;
}

.btn-document img {
  margin-left: 25px;
  width: 5rem;
  height: auto;
}
a {
  text-decoration: none;
}
.p-document {
  margin-left: 35px;
  font-family: "Verdana", sans-serif;
  font-size: 0.9rem;
  color: #777a8d;
  font-weight: 400;
}

.event_detail-h {
  font-family: "Verdana";
  font-size: clamp(0.9rem, 1vw, 1.1rem);
  color: #000000;
  font-weight: 700;
}

.question-organizator {
  color: #00056e;
  font-family: "Verdana";
  font-weight: 700;
  font-size: clamp(0.7rem, 1vw, 1rem);
  margin-left: 5px;
  cursor: pointer;
}
.buy-button-detail {
  width: 300px;
  background: #ff8348;
  padding: 8px 30px 8px 30px;
  border: none;
  border-radius: 19.28px;
  color: white;
  font-family: "Montserrat";
  font-weight: 500;
  font-size: clamp(0.7rem, 1vw, 1rem);
}

.favourites-icon {
  width: 2.5rem;
  height: auto;
  margin-bottom: 3px;
  margin-left: 15px;
}

/* === Модальное окно покупки билетов === */
.tickets-section {
  margin-top: 2rem;
}

.tickets-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  column-gap: 15px;
  row-gap: 5px;
  padding: 20px 0;
}

.tickets-header {
  /* Общая сетка с рядами через subgrid — колонки гарантированно совпадают */
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  column-gap: 15px;
}

.tickets-header .ticket-col {
  font-family: "Verdana";
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  font-weight: 700;
  color: #807b7b;
}

.tickets-row {
  /* Общая сетка с заголовком и другими рядами через subgrid */
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  column-gap: 15px;
}

.tickets-row:last-child {
  border-bottom: none;
}

.ticket-col-type {
  font-family: "Verdana", sans-serif;
  font-size: clamp(0.7rem, 1vw, 0.9rem);
  font-weight: 400;
  color: black;
  min-width: 0; /* чтобы truncate работал внутри grid */
  display: flex;
  align-items: center;
}

/* Название билета в одну строку; кликабельность и многоточие только если обрезано */
.ticket-col-type .ticket-desc {
  cursor: default;
  transition: none;
  flex: 1;
  min-width: 0; /* span сжимается вместе с точкой в flex-строке */
}

.ticket-col-type .ticket-desc.is-truncated {
  cursor: pointer;
}

.ticket-col-type .ticket-desc:hover {
  color: inherit;
}

.ticket-col-type .ticket-desc.is-truncated:hover {
  color: #4a7cf7;
}

.ticket-col-type .ticket-desc.is-truncated::after {
  content: " \2026";
  color: #4a7cf7;
  font-weight: 700;
}

.ticket-col-type .ticket-desc:not(.is-truncated)::after {
  content: none;
}

.ticket-col-price {
  font-family: "Verdana", sans-serif;
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  font-weight: 700;
  color: black;
  white-space: nowrap;
  min-width: 0; /* чтобы truncate работал внутри grid */
}

.ticket-col-price .ticket-desc {
  font-weight: 700;
}

/* Тултип цены: покороче и в одну строку */
.ticket-price-tooltip {
  max-width: none;
  white-space: nowrap;
}

.ticket-col-desc {
  font-family: "Verdana", sans-serif;
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  font-weight: 400;
  color: black;
  min-width: 0; /* чтобы truncate работал внутри grid */
}

/* Описание билета: одна строка, клик — полный текст */
.ticket-desc {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: color 0.15s ease;
  font-family: "Verdana", sans-serif;
  font-size: clamp(0.8rem, 1vw, 0.9rem);
}

.ticket-desc:hover {
  color: #4a7cf7;
}

.ticket-desc.is-truncated::after {
  content: " \2026"; /* многоточие для подсказки, что текст сокращён */
  color: #4a7cf7;
  font-weight: 700;
}

.ticket-desc:focus-visible {
  outline: 2px solid #4a7cf7;
  outline-offset: 2px;
  border-radius: 3px;
}

/* Тултип с полным описанием */
.ticket-desc-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: 320px;
  padding: 10px 14px;
  background: #1f2430;
  color: #fff;
  font-family: "Verdana", sans-serif;
  font-size: 0.85rem;
  line-height: 1.4;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  white-space: normal;
  word-break: break-word;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  pointer-events: none;
}

.ticket-desc-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

/* Рандомные цвета точек */
.ticket-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
  flex-shrink: 0;
}

.dot-1 {
  background-color: #28a745; /* зеленый */
}

.dot-2 {
  background-color: #007bff; /* синий */
}

.dot-3 {
  background-color: #dc3545; /* красный */
}

.dot-4 {
  background-color: #ff8348; /* оранжевый */
}

.dot-5 {
  background-color: #6f42c1; /* фиолетовый */
}

.dot-6 {
  background-color: #fd7e14; /* янтарный */
}

.dot-7 {
  background-color: #20c997; /* бирюзовый */
}

.dot-8 {
  background-color: #e83e8c; /* розовый */
}

.free-ticket {
  background-color: #28a745;
}

.adress-detail-p {
  font-family: "Verdana", sans-serif;
  font-weight: 400;
  color: #070707;
  font-size: clamp(0.8rem, 1vw, 0.9rem);
}

/* === Модальное окно покупки билетов === */
.modal-body-modal {
  padding: 0px;
  margin-top: 20px;
}

.ticket-card-body {
  padding: 0;
}

.ticket-row {
  display: flex;
  align-items: center;
}

.ticket-cell {
  display: flex;
  align-items: center;
}

.ticket-cell-name {
  flex: 1;
  min-width: 0; /* чтобы длинное название обрезалось с «…», а не растягивало строку */
  justify-content: flex-start;
}

.ticket-cell-price {
  flex: 1;
  justify-content: center;
}

.ticket-cell-qty {
  flex: 1;
  justify-content: flex-end;
}

.modal-content {
  border-radius: 0px;
  display: block;
  padding: 25px;
  width: 100%;
  margin: 0 auto;
}

.modal-title {
  font-family: "Verdana";
  color: #000;
  font-weight: 400;
  font-size: clamp(0.8rem, 1vw, 1.2rem);
}

.modal-header {
  border-bottom: none;
  padding: 0;
}

.email-input {
  margin-bottom: 10px;
}
.email-ingo {
  border-bottom: none;
}

.buy-button-modal {
  text-align: center;
  font-family: "Montserrat";
  font-weight: 500;
  width: 60%;
  padding: 10px 20px 10px 20px;
  font-size: clamp(0.8rem, 1vw, 1rem);
  color: #fff;
  background: #ff8348;
  border-radius: 25.28px;
  border: none;
  margin: 0 auto;
}
/* === Счётчик количества === */
.quantity-input {
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-input button.minus,
.quantity-input button.plus {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  border: none;
  background: #ff8348;
  color: black;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.quantity-input button.minus:hover,
.quantity-input button.plus:hover {
  opacity: 0.85;
}

.quantity-input input.count-tickets {
  width: 48px;
  text-align: center;
  border: none;
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  font-weight: 400;
  font-family: "Verdana", sans-serif;
  color: #000;
  padding: 0;
  margin: 0;
  /* Убираем стрелки браузера */
  -moz-appearance: textfield;
  appearance: textfield;
}

.quantity-input input.count-tickets::-webkit-inner-spin-button,
.quantity-input input.count-tickets::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.email-input {
  border-radius: 25px;
  border: 1px solid #777a8d;
  padding: 10px;
  width: 100%;
}

.modal-footer {
  border-top: none;
}

.text-muted {
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  color: #9a9a9a;
  font-family: "Montserrat";
  font-weight: 500;
}
.form-label-modal {
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  color: black;
  font-family: "Montserrat";
  font-weight: 500;
}
.ticket-price-modal {
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  color: black;
  font-family: "Verdana";
  font-weight: 700;
}
.form-check-label {
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  color: black;
  font-family: "Montserrat";
  font-weight: 500;
}
.form-check-input[type="checkbox"] {
  margin-top: 6px !important;
}
.ticket-name-modal {
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  color: black;
  font-family: "Verdana";
  font-weight: 400;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.3;
}

/* === Стили корзины === */
.cart-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cart-left {
  flex: 1;
  min-width: 0; /* чтобы длинное название обрезалось, а не растягивало блок */
}

.cart-right {
  text-align: right;
  flex-shrink: 0;
}

/* Название билета в корзине: одна строка, клик — полный текст
   (логика как у .ticket-desc и .ticket-name-text: JS добавляет .is-truncated) */
.cart-item {
  font-family: "Verdana";
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  font-weight: 400;
  color: #9a9a9a;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item.is-truncated {
  cursor: pointer;
}

.cart-item.is-truncated:hover {
  color: #4a7cf7;
}

.cart-item.is-truncated::after {
  content: " \2026";
  color: #4a7cf7;
  font-weight: 700;
}

.cart-item:not(.is-truncated)::after {
  content: none;
}

.cart-item:focus-visible {
  outline: 2px solid #4a7cf7;
  outline-offset: 2px;
  border-radius: 3px;
}

.cart-total-count {
  font-family: "Verdana";
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  font-weight: 400;
  color: #666;
}

.cart-total-price {
  font-family: "Verdana";
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  font-weight: 700;
  color: #000;
}

.map-fallback {
  border-radius: 10px;
  border: 1px solid #b1a9a9;
  padding: 20px;
  display: none;
}
.map-fallback-title {
  font-family: "Verdana";
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  font-weight: 700;
  color: #000;
}
.map-fallback-address {
  font-family: "Verdana";
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  font-weight: 400;
  color: #857d7d;
}

/* Десктоп (>= 768px): фото растягивается по высоте правого блока */
@media (min-width: 768px) {
  .event-detail-container > .row {
    align-items: stretch;
  }

  .event-detail-container .event-detail-image:first-child {
    display: flex;
  }

  .image-wrapper {
    aspect-ratio: unset;
    flex: 1;
    min-height: 0;
  }

  .image-wrapper .carousel,
  .image-wrapper .carousel-inner,
  .image-wrapper .carousel-item {
    height: 100%;
  }

  /* height:100% + min-height:100% — картинка всегда заполняет всю
     ячейку по высоте и не оставляет пустых полос; object-fit:cover
     подрезает только лишнее, масштаб при этом уменьшается вместе
     с блоком, а не остаётся исходным */
}

/* Название билета в модалке покупки: одна строка, клик — полный текст.
   Логика как у описаний билетов в блоке .tickets-section: JS помечает
   элементы, текст которых не влазит в строку, классом .is-truncated */
.ticket-name-modal {
  min-width: 0; /* span сжимается вместе с ячейкой в flex-строке */
}

.ticket-name-modal .ticket-name-text {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  transition: none;
  min-width: 0;
}

.ticket-name-modal .ticket-name-text.is-truncated {
  cursor: pointer;
  color: inherit;
}

.ticket-name-modal .ticket-name-text.is-truncated:hover {
  color: #4a7cf7;
}

.ticket-name-modal .ticket-name-text.is-truncated::after {
  content: " \2026"; /* подсказка, что текст сокращён */
  color: #4a7cf7;
  font-weight: 700;
}

.ticket-name-modal .ticket-name-text:not(.is-truncated)::after {
  content: none;
}

.ticket-name-modal .ticket-name-text:focus-visible {
  outline: 2px solid #4a7cf7;
  outline-offset: 2px;
  border-radius: 3px;
}

/* Тултип полного названия билета в модалке: элемент добавляется в <body>,
   базового z-index: 2000 достаточно, чтобы быть поверх модалки (1055) */

/* Раскрытие по клику (мобильные): класс .is-expanded добавляет JS */
.collapsible-text.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

/* Мобильные (< 768px): фото на всю ширину от края до края, возвращаем пропорции */
@media (max-width: 767.98px) {
  /* Компенсируем боковые отступы container-fluid из base.html —
     изображение игнорирует их и тянется от края до края экрана.
     12px — стандартный padding Bootstrap-контейнеров */
  .event-detail-container > .row {
    margin-left: -12px;
    margin-right: -12px;
  }
  .event-detail-container > .row > .event-detail-image {
    padding-left: 0;
    padding-right: 0;
  }
  /* Инфо-блок остаётся с обычными отступами */
  .event-detail-container > .row > .event-detail-info {
    padding-left: 12px;
    padding-right: 12px;
  }
  /* Тег-строка: значения не должны вылезать за экран —
     перенос по словам вместо nowrap-обрезки */
  .info-tag {
    white-space: normal;
  }
  /* Сворачиваемые тексты: 2 строки, клик — раскрытие */
  .collapsible-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .image-wrapper {
    aspect-ratio: 4 / 3;
  }
  /* Карусель: слайды и картинки заполняют wrapper целиком,
     чтобы фото масштабировалось вместе с блоком, а не обрезалось */
  .image-wrapper .carousel-inner,
  .image-wrapper .carousel-item {
    height: 100%;
  }
  .image-wrapper img,
  .image-wrapper .carousel-item img {
    object-fit: cover;
  }
  .event-title {
    margin-top: 20px;
  }
  .map-fallback {
    padding: 7px;
  }
  .date-address-row {
    display: block;
  }
  .date-cell {
    margin-bottom: 7px !important;
  }
  .modal-content {
    padding: 15px;
  }
  .carousel-item img {
    border-radius: 0px !important;
  }
}
