/* Accessible difficulty and comfort tooltips shared by tour and catalog pages. */
.wgt-info {
  border: 0;
  padding: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.wgt-info:focus-visible,
.tc-info-button:focus-visible {
  outline: 3px solid rgba(0, 154, 166, .25);
  outline-offset: 2px;
}

.wgt-info-wrap.is-open .wgt-info,
.tc-info-wrap.is-open .tc-info-button {
  background: #7A8B99;
  color: #fff;
}

.wgt-info-wrap.is-open .wgt-tooltip,
.tc-info-wrap.is-open .wgt-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.tc-difficulty-row {
  display: flex;
  align-items: center;
  gap: 4px;
  height: auto;
  min-height: 20px;
}

.tc-info-wrap {
  position: relative;
  display: inline-flex;
  margin-left: 3px;
}

/* The catalog card normally clips its rounded edges. While the tooltip is
   open (or hovered on desktop), let the popover extend beyond the card. */
.tc-card:has(.tc-info-wrap.is-open),
.tc-card:has(.tc-info-wrap:hover) {
  position: relative;
  z-index: 20;
  overflow: visible;
  transform: none;
}

.tc-info-button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #E6EDF2;
  color: #687987;
  font: 700 12px/1 Georgia, serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}

.tc-info-wrap .wgt-tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: 320px;
  padding: 20px;
  box-sizing: border-box;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 15px 35px rgba(0,0,0,.15), 0 5px 15px rgba(0,0,0,.05);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 99999;
}

.tc-info-wrap .tt-item {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #F0F4F8;
}

.tc-info-wrap .tt-item:last-child { margin: 0; padding: 0; border: 0; }
.tc-info-wrap .tt-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 4px; }
.tc-info-wrap .tt-name { font-size: 14px; font-weight: 700; color: #2C3E50; }
.tc-info-wrap .tt-item.active .tt-name { color: #009AA6; }
.tc-info-wrap .tt-bar { width: 34px; height: 6px; flex: 0 0 auto; overflow: hidden; border-radius: 7px; background: #E6EDF2; }
.tc-info-wrap .tt-bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg,#009AA6,#3DDC84); }
.tc-info-wrap .tt-desc { margin: 0; color: #627282; font-size: 12px; line-height: 1.45; }

@media (hover: hover) and (pointer: fine) {
  .tc-info-wrap:hover .tc-info-button { background: #7A8B99; color: #fff; }
  .tc-info-wrap:hover .wgt-tooltip { opacity: 1; visibility: visible; transform: translateY(0); }
}

@media (max-width: 640px) {
  .wgt-info-wrap .wgt-tooltip,
  .tc-info-wrap .wgt-tooltip {
    position: fixed;
    top: 50%;
    left: 16px;
    right: 16px;
    bottom: auto;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 20px;
    border-radius: 14px;
    transform: translateY(calc(-50% + 8px));
    box-shadow: 0 18px 55px rgba(14,22,38,.28);
    overscroll-behavior: contain;
  }

  .wgt-info-wrap.is-open .wgt-tooltip,
  .tc-info-wrap.is-open .wgt-tooltip {
    transform: translateY(-50%);
  }

  .wgt-info-wrap:hover:not(.is-open) .wgt-tooltip,
  .tc-info-wrap:hover:not(.is-open) .wgt-tooltip {
    opacity: 0;
    visibility: hidden;
    transform: translateY(calc(-50% + 8px));
  }
}
