/* =========================
   TOC Viajamundi
   ========================= */

/* --- Anti horizontal scrollbar (cinturón) --- */
@supports (overflow: clip){
  body.single{ overflow-x: clip; }
}
@supports not (overflow: clip){
  body.single{ overflow-x: hidden; }
}

/* Menú TOC: en estado normal NO hacemos full-bleed */
body.single .vm-listing-toc{
  position: sticky;
  top: var(--vm-toc-top);
  z-index: 50;
  background: #fff;
  margin-bottom: var(--vm-stack-m);
  box-sizing: border-box;
  width: auto;
  margin-left: 0;
  margin-right: 0;
  border: 1px solid var(--vm-border);
  border-radius: var(--vm-radius-md);
  overflow: hidden;
}

/* Sticky: aquí SÍ full-bleed */
body.single .vm-listing-toc.is-sticky{
  border: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: 0 2px 3px #00000020;
  border-bottom: 1px solid rgba(0,0,0,.08);
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Si el navegador soporta dvw, evitamos el “vw + scrollbar width” */
@supports (width: 100dvw){
  body.single .vm-listing-toc.is-sticky{
    width: 100dvw;
    margin-left: calc(50% - 50dvw);
    margin-right: calc(50% - 50dvw);
  }
}

/* Inner: ancho bonito + borde SOLO en estado normal */
body.single .vm-listing-toc-inner{
    max-width: 1110px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px 0px;
}

/* En sticky: quitamos el borde del inner */
body.single .vm-listing-toc.is-sticky .vm-listing-toc-inner{
  border-bottom: 0;
}

/* En pantallas donde tu content-container mete padding */
@media (max-width: 1200px){
  body.single .vm-listing-toc-inner{
    padding-left: 20px;
    padding-right: 20px;
    flex-wrap: nowrap;
  }
}

/* Left 70% / Right 30% */
.vm-toc-left{
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.vm-toc-left::-webkit-scrollbar{ display:none; }

.vm-listing-toc.no-cta .vm-toc-left{ flex-basis: 100%; }

/* Indicador único (línea activa animada) */
.vm-toc-indicator{
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--vm-accent);
  width: 0;
  transform: translateX(0);
  pointer-events: none;
  opacity: 0;
}

/* Activamos transiciones tras primer posicionamiento */
.vm-toc-indicator.is-ready{
  opacity: 1;
  transition:
    transform .26s cubic-bezier(.22, 1, .36, 1),
    width .26s cubic-bezier(.22, 1, .36, 1),
    opacity .15s ease;
}

.vm-toc-right{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  white-space: nowrap;
}

.vm-toc-actions{
  display: flex;
  align-items: center;
}

/* Lista horizontal: sin gap para que los underlines casi se toquen */
.vm-toc-list{
  display: flex;
  align-items: flex-end;
  gap: 0;              /* <- antes 22px */
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

/* Links: más padding lateral para “alargar” el underline */
.vm-toc-link{
    position: relative;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--vm-muted);
    font-weight: 500;
    font-size: 15.3px;
    letter-spacing: .1px;
    padding: 16px 14px;
    background: transparent;
    border-radius: 0;
    transition: color .16s ease;
}

/* Underline indicator (hover/active) */
.vm-toc-link::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;

  /* lo bajamos a la línea inferior del inner */
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease, background-color .18s ease;
  width: 100%;
}

.vm-toc-link:focus { color: var(--vm-muted); }
/* Hover: underline gris (distinto al active) */
.vm-toc-link:hover{
  color: var(--vm-brand);
}
.vm-toc-link:hover::after{
  background: rgba(30, 41, 59, .28); /* gris elegante */
  transform: scaleX(1);
}

/* Active: underline azul (principal) */
.vm-toc-link.active,
.vm-toc-link[aria-current="true"]{
  color: var(--vm-brand);
}
.vm-toc-link.active::after,
.vm-toc-link[aria-current="true"]::after{
  background: transparent;
  transform: scaleX(1);
}

/* Focus accesible */
.vm-toc-link:focus-visible{
  outline: 2px solid rgba(37, 99, 235, .35);
  outline-offset: 3px;
  border-radius: 8px;
}

/* CTA (botón derecho) */
.vm-toc-cta{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 16px;
    border-radius: 40px;
    background: var(--vm-brand);
    color: #fff;
    text-decoration: none;
    font-weight: 750;
    font-size: 14px;
    border: 0;
    cursor: pointer;
    transition: transform .12s ease, background-color .16s ease, box-shadow .16s ease;
}
.vm-toc-cta:focus{
  color: #fff;
}
.vm-toc-cta:hover{
  opacity: .94;
  color: #fff;
}
.vm-toc-cta:active{
  opacity: .89;
}
.vm-toc-cta:focus-visible{
  outline: 2px solid rgba(37, 99, 235, .35);
  outline-offset: 3px;
}

/* =========================================================
   TOC: acciones (vm-header-actions) + botones
========================================================= */
.vm-header-actions{
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.vm-action-btn{
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--vm-border);
  background: #fff;
  color: var(--vm-brand);
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.vm-action-btn:focus{
  background: #fff;
  color: var(--vm-brand);
  border: 1px solid var(--vm-border) !important;
}
.vm-action-btn:hover{
  background: var(--vm-soft);
  color: var(--vm-brand);
}
.vm-action-btn:active{
  background: var(--vm-soft-active);
  color: var(--vm-brand-700);
}
.vm-action-btn svg{ display:block; }

/* Favoritos */
.vm-header-actions .favorite-icon{
  width: 20px;
  height: 20px;
}
.vm-header-actions .favorite-icon path{
  fill: #fff;
  stroke: currentColor;
  stroke-width: 2;
}
.vm-action-btn:hover .favorite-icon path,
.vm-action-btn.favorite-button.add-favorite path:hover{
  fill: #ffcccc;
  stroke: #ff0000;
}
.vm-action-btn:hover .favorite-icon.active path,
.vm-header-actions .favorite-icon.active path{
  fill: #ffcccc;
  stroke: #ff0000;
}
.vm-action-btn:hover .favorite-icon.active,
.vm-header-actions .favorite-icon.active:hover{
  filter: brightness(1.3);
}

/* =========================================================
   RESPONSIVE
========================================================= */

/* Mobile */
@media (max-width: 768px){
  body.single .vm-listing-toc{
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border: none;
    border-radius: 0;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
  }

  @supports (width: 100dvw){
    body.single .vm-listing-toc{
      width: 100dvw;
      margin-left: calc(50% - 50dvw);
      margin-right: calc(50% - 50dvw);
    }
  }

  /* 2 filas: right arriba, left abajo */
  body.single .vm-listing-toc-inner{
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 10px;
    padding-left: 0;
    padding-right: 0;
  }

  /* En sticky, un poco de padding lateral */
  body.single .vm-listing-toc.is-sticky .vm-listing-toc-inner{
    padding-left: 0;
    padding-right: 0;
  }

  /* Fila 1 */
  .vm-toc-right{
    width: 100%;
    justify-content: space-between;
    padding-bottom: 0;
    order: 1;
    padding: 0 15px;
  }

  /* Fila 2 */
  .vm-toc-left{
    width: 100%;
    order: 2;
  }

  /* Compactar un pelín para que no moleste */
  .vm-toc-right .vm-header-actions{ gap: 8px; }
  .vm-toc-right .vm-action-btn{ width: 36px; height: 36px; }
  .vm-toc-cta{height: 36px;padding: 0 14px;font-size: 13.5px;}

  /* Links */
  .vm-toc-link{padding: 10px 16px 12px; margin: 0; font-size: 14.7px;}
}

/* Mobile ultra small */
@media (max-width: 355px){
  .vm-toc-right{
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .vm-toc-right::-webkit-scrollbar{ display:none; }

  .vm-header-actions{ gap: 6px; }

  .vm-action-btn{
    width: 32px;
    height: 32px;
  }

  /* Compacta iconos sin depender del width/height inline del SVG */
  .vm-action-btn svg{
    width: 18px !important;
    height: 18px !important;
  }

  .vm-toc-cta{
    height: 34px;
    padding: 0 10px;
    font-size: 12.5px;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .vm-toc-link{
    font-size: 13px;
    padding: 9px 10px 11px;
  }
}

/* Evita que el TOC tape el inicio de sección */
.vm-toc-target,
#opiniones,
#ubicacion,
#informacion,
#price-comparator,
#price-comparator-form,
#expandable-info,
#expandable-schedule,
[id^="rest-expandable-"],
[id^="playa-expandable-"]{
  scroll-margin-top: var(--vm-toc-scroll-margin);
}