/* CONTUHIJO CORE 2.0 RC3 · compatibility quarantine.
   ---------------------------------------------------
   This is the ONLY new Core stylesheet allowed to use !important.
   Reason: Colibri/Bootstrap/Marga can emit unlayered and inline legacy geometry.
   These rules restore the production-proven functional canvas without touching
   Vue, data, prices, validation, submit, reservations or payments.
   Brand Pack styles never belong here. */
@layer cth20.compat {

  /* ---------- Legacy editorial: never strand content in an old half-column. */
  body.cth-core20-platform.vmon-editorial-route :where(.vmon-editorial__content--legacy-safe,.cth-native-editorial__content)
    :where(.h-section,.h-section-grid-container,.h-row-container,.h-row,.h-column,.h-column-container,.h-column__inner,.h-column__content,.h-y-container,.row,.container,.container-fluid,[class*="h-col-"],[class*="col-xs-"],[class*="col-sm-"],[class*="col-md-"],[class*="col-lg-"],[class*="col-xl-"]){
      width:100%!important;max-width:100%!important;min-width:0!important;float:none!important;
      margin-left:0!important;margin-right:0!important;box-sizing:border-box!important;
      flex:0 0 100%!important;flex-basis:100%!important;
  }
  body.cth-core20-platform.vmon-editorial-route :where(.vmon-editorial__content--legacy-safe,.cth-native-editorial__content)
    :where(.row,.h-row,.h-row-container){display:block!important;}
  body.cth-core20-platform.vmon-editorial-route :where(.vmon-editorial__content--legacy-safe,.cth-native-editorial__content)
    :where(figure,.wp-caption,.wp-block-image,.gallery,img,video,iframe,table){max-width:100%!important;}
  body.cth-core20-platform.vmon-editorial-route :where(.vmon-editorial__content--legacy-safe,.cth-native-editorial__content)
    :where(figure,.wp-caption,.wp-block-image,.gallery){width:100%!important;}
  body.cth-core20-platform.vmon-editorial-route :where(.vmon-editorial__content--legacy-safe,.cth-native-editorial__content) img{
    display:block!important;width:100%!important;height:auto!important;margin-left:auto!important;margin-right:auto!important;
  }

  /* ---------- Trip tabs: every panel and its ancestor owns the full canvas. */
  body.cth-core20-platform.vmon-marga-page .md-template
    :where(.cth-trip-tabs-shell,.cth-trip-tabs,.cth-trip-tab-panel,.h-tabs,.h-tabs-navigation,.h-tabs-content,.h-tabs-item-content,#itinerario,#imagenes,#alojamiento,#precioIncluye){
      width:100%!important;max-width:none!important;min-width:0!important;float:none!important;box-sizing:border-box!important;
  }
  body.cth-core20-platform.vmon-marga-page .md-template
    :where(.h-column,.h-column-container).cth-trip-tabs-shell{flex:0 0 100%!important;flex-basis:100%!important;}
  body.cth-core20-platform.vmon-marga-page .md-template .h-row.cth-trip-tabs-shell{display:block!important;margin-left:0!important;margin-right:0!important;}
  @supports selector(.md-template:has(#imagenes)){
    body.cth-core20-platform.vmon-marga-page .md-template
      :where(.h-row-container,.h-row,.h-column,.h-column-container,.h-column__inner,.h-column__content):has(:is(#itinerario,#imagenes,#alojamiento,#precioIncluye,.h-tabs)){
        width:100%!important;max-width:none!important;min-width:0!important;float:none!important;box-sizing:border-box!important;
    }
    body.cth-core20-platform.vmon-marga-page .md-template
      :where(.h-column,.h-column-container):has(:is(#itinerario,#imagenes,#alojamiento,#precioIncluye,.h-tabs)){
        flex:0 0 100%!important;flex-basis:100%!important;
    }
    body.cth-core20-platform.vmon-marga-page .md-template .h-row:has(:is(#itinerario,#imagenes,#alojamiento,#precioIncluye,.h-tabs)){
      display:block!important;margin-left:0!important;margin-right:0!important;
    }
  }
  body.cth-core20-platform.vmon-marga-page .h-tabs .h-tabs-item-content.hide,
  body.cth-core20-platform.vmon-marga-page .h-tabs .h-tabs-item-content[hidden]{display:none!important;}
  body.cth-core20-platform.vmon-marga-page .h-tabs .h-tabs-item-content.h-tabs-content-active:not(.hide){display:block!important;}
  body.cth-core20-platform.vmon-marga-page :where(#itinerario,#imagenes,#alojamiento,#precioIncluye){scroll-margin-top:110px!important;}
  @supports selector(.h-tabs:has(#imagenes:target)){
    body.cth-core20-platform.vmon-marga-page .h-tabs:has(#itinerario:target,#imagenes:target,#alojamiento:target,#precioIncluye:target)>.h-tabs-item-content{display:none!important;}
    body.cth-core20-platform.vmon-marga-page .h-tabs>#itinerario:target,
    body.cth-core20-platform.vmon-marga-page .h-tabs>#imagenes:target,
    body.cth-core20-platform.vmon-marga-page .h-tabs>#alojamiento:target,
    body.cth-core20-platform.vmon-marga-page .h-tabs>#precioIncluye:target{display:block!important;}
  }
  body.cth-core20-platform.vmon-marga-page #precioIncluye :where(table,.table){width:100%!important;max-width:none!important;float:none!important;}

  /* ---------- General contact + nested trip information. */
  body.cth-core20-platform.vmon-contact-route .vmon380-contact-form .vmon-shell{width:min(calc(100% - 32px),1240px)!important;}
  body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) :where(.vmon-marga--contact,#contacto-form),
  body.cth-core20-platform.cth-marga-trip-contact :where(.md-template,#contacto-form),
  body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact)
    :where(.h-section,.h-section-grid-container,.h-row-container,.h-row,.h-column,.h-column-container,.h-column__inner,.h-column__content,.h-y-container):has(#contacto-form){
      width:100%!important;max-width:none!important;min-width:0!important;float:none!important;box-sizing:border-box!important;
      flex:0 0 100%!important;flex-basis:100%!important;
  }
  body.cth-core20-platform.cth-marga-trip-contact .content.colibri-page-content .h-row:has(#contacto-form){display:block!important;}
  body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form{
    width:min(calc(100% - 32px),1060px)!important;max-width:1060px!important;min-width:0!important;
    margin:28px auto 64px!important;float:none!important;box-sizing:border-box!important;
  }
  body.cth-core20-platform.vmon-contact-route #contacto-form :where(.h-row,.row){width:100%!important;max-width:none!important;min-width:0!important;box-sizing:border-box!important;}
  body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form
    :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]),select,textarea){max-width:100%!important;box-sizing:border-box!important;}
  body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form :where(img,iframe,table,.g-recaptcha){max-width:100%!important;}
  body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form .g-recaptcha{transform-origin:left top;}

  @media(max-width:767px){
    body.cth-core20-platform.vmon-contact-route .vmon380-contact-form{padding:26px 0 42px!important;}
    body.cth-core20-platform.vmon-contact-route .vmon380-contact-form .vmon-shell{width:min(calc(100% - 20px),1240px)!important;}
    body.cth-core20-platform.vmon-contact-route .vmon380-contact-form__surface{padding:0!important;border-radius:16px!important;overflow:hidden!important;}
    body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form{width:min(calc(100% - 20px),1240px)!important;padding:20px 14px 24px!important;border-radius:16px!important;}
    body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form :where(.h-row,.row){display:block!important;margin:0!important;}
    body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form [class*="h-col-"],
    body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form [class*="col-"]{
      display:block!important;float:none!important;width:100%!important;max-width:100%!important;min-width:0!important;
      flex:0 0 100%!important;padding:7px 0!important;margin:0!important;
    }
    body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form :where(.control-group,.form-group){width:100%!important;max-width:100%!important;min-width:0!important;margin:0 0 12px!important;}
    body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form
      :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]),select,textarea){
        display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;font-size:16px!important;
    }
    body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form
      :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]),select){min-height:48px!important;}
    body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form textarea{min-height:150px!important;resize:vertical!important;}
    body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form :where(input[type="checkbox"],input[type="radio"]){width:auto!important;min-width:0!important;min-height:0!important;flex:0 0 auto!important;}
    body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form :where(button,input[type="submit"],.md-btn){max-width:100%!important;min-height:46px!important;}
  }
  @media(max-width:390px){body.cth-core20-platform :where(.vmon-contact-route,.cth-marga-trip-contact) #contacto-form .g-recaptcha{transform:scale(.86);margin-right:-44px;margin-bottom:-12px;}}

  /* ---------- Reservation: preserve every traveller, normalize only layout. */
  body.cth-core20-platform.cth-marga-reservation .content.colibri-page-content{width:100%!important;max-width:none!important;margin:0!important;padding:0!important;}
  body.cth-core20-platform.cth-marga-reservation .md-template{
    width:min(calc(100% - 36px),1240px)!important;max-width:1240px!important;min-width:0!important;
    margin:28px auto 84px!important;padding:42px 0 84px!important;box-sizing:border-box!important;
  }
  body.cth-core20-platform.cth-marga-reservation .md-template :where(.h-row-container,.h-row,.h-column,.h-column-container,.h-column__inner,.h-column__content){min-width:0!important;box-sizing:border-box!important;}
  body.cth-core20-platform.cth-marga-reservation .md-template :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea){max-width:100%!important;box-sizing:border-box!important;}
  body.cth-core20-platform.cth-marga-reservation .md-template img{max-width:100%!important;height:auto!important;object-fit:contain!important;}
  body.cth-core20-platform.cth-marga-reservation .md-template form,
  body.cth-core20-platform.cth-marga-reservation .md-template form>div,
  body.cth-core20-platform.cth-marga-reservation .md-template :where(.control-group,.form-group,.form-row){max-width:100%!important;min-width:0!important;box-sizing:border-box!important;}
  body.cth-core20-platform.cth-marga-reservation .md-template :where(.h-row,.row){gap:clamp(10px,1.5vw,18px)!important;align-items:flex-start!important;}
  body.cth-core20-platform.cth-marga-reservation .md-template :where(label,.md-label){position:static!important;float:none!important;max-width:100%!important;line-height:1.25!important;}
  body.cth-core20-platform.cth-marga-reservation .md-template :where(button,.md-btn,input[type="button"],input[type="submit"]){min-height:42px!important;box-sizing:border-box!important;}
  body.cth-core20-platform.cth-marga-reservation .md-template :where(.input-group,.md-counter,.counter,.quantity,.cantidad,.pasajeros,.viajeros){min-width:0!important;box-sizing:border-box!important;}
  body.cth-core20-platform.cth-marga-reservation .md-template :where(.input-group,.md-counter,.counter,.quantity) img{width:22px!important;height:22px!important;max-width:22px!important;max-height:22px!important;margin:0!important;}
  body.cth-core20-platform.cth-marga-reservation .md-template :where(.input-group,.md-counter,.counter,.quantity) :where(button,.md-btn,input[type="button"]){position:static!important;float:none!important;flex:0 0 auto!important;margin:0!important;}
  @media(min-width:768px){
    body.cth-core20-platform.cth-marga-reservation .md-template form :where(.h-row,.row){width:100%!important;max-width:100%!important;}
    body.cth-core20-platform.cth-marga-reservation .md-template form [class*="h-col-"]{min-width:0!important;}
  }
  @media(max-width:767px){
    body.cth-core20-platform.cth-marga-reservation .md-template{width:min(calc(100% - 20px),1240px)!important;padding:24px 0 56px!important;}
    body.cth-core20-platform.cth-marga-reservation .md-template :where(.h-row,.row){display:block!important;margin-left:0!important;margin-right:0!important;}
    body.cth-core20-platform.cth-marga-reservation .md-template form [class*="h-col-"],
    body.cth-core20-platform.cth-marga-reservation .md-template form [class*="col-"]{
      display:block!important;float:none!important;width:100%!important;max-width:100%!important;min-width:0!important;flex:0 0 100%!important;
      padding-left:0!important;padding-right:0!important;margin:0 0 12px!important;
    }
    body.cth-core20-platform.cth-marga-reservation .md-template :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea){width:100%!important;max-width:100%!important;min-width:0!important;font-size:16px!important;}
    body.cth-core20-platform.cth-marga-reservation .md-template :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select){min-height:46px!important;}
    body.cth-core20-platform.cth-marga-reservation .md-template textarea{min-height:130px!important;}
    body.cth-core20-platform.cth-marga-reservation .md-template :where(input[type="checkbox"],input[type="radio"]){width:auto!important;min-width:0!important;min-height:0!important;}
    body.cth-core20-platform.cth-marga-reservation .md-template :where(.input-group,.md-counter,.counter,.quantity){display:inline-flex!important;align-items:center!important;gap:6px!important;width:auto!important;max-width:100%!important;vertical-align:middle!important;}
    body.cth-core20-platform.cth-marga-reservation .md-template :where(.input-group,.md-counter,.counter,.quantity) :where(button,.md-btn,input[type="button"]){width:42px!important;min-width:42px!important;max-width:42px!important;height:42px!important;min-height:42px!important;padding:0!important;display:grid!important;place-items:center!important;}
  }

  /* ---------- Search: proven 1240px canvas, visible controls, three cards. */
  body.cth-core20-platform.vmon-search-route :where(#content.page-content,#content>.h-section,#content>.h-section>.h-section-grid-container,#content>.h-section>.h-section-grid-container>.h-row-container,#content>.h-section>.h-section-grid-container>.h-row-container>.h-row,#content>.h-section>.h-section-grid-container>.h-row-container>.h-row>.h-col){
    width:100%!important;max-width:none!important;margin:0!important;padding:0!important;
  }
  body.cth-core20-platform.vmon-search-route #buscador.md-template{
    display:block!important;width:min(calc(100% - 32px),1240px)!important;max-width:1240px!important;
    margin:0 auto!important;padding:clamp(34px,5vw,68px) 0 92px!important;background:transparent!important;
  }
  body.cth-core20-platform.vmon-search-route #buscador.md-template>.h-section-grid-container,
  body.cth-core20-platform.vmon-search-route #buscador form.h-px-2{width:100%!important;max-width:none!important;margin-left:0!important;margin-right:0!important;padding-left:0!important;padding-right:0!important;}
  body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.d-none.d-lg-block:first-of-type{margin:0 0 18px!important;padding:18px!important;}
  body.cth-core20-platform.vmon-search-route #buscador .md-search-field{min-height:54px!important;padding:0 16px!important;box-shadow:none!important;}
  body.cth-core20-platform.vmon-search-route #buscador .md-search-submit{min-width:64px!important;}
  @media(min-width:901px){
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.d-none.d-lg-block:first-of-type{display:block!important;}
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.h-row{display:grid!important;grid-template-columns:1fr!important;gap:22px!important;margin:0!important;}
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.h-row>.h-column.h-col-lg-3{display:block!important;width:100%!important;max-width:none!important;flex:none!important;margin:0!important;padding:0!important;}
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.h-row>.h-column.h-col-lg-3>.d-flex.flex-column{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:12px!important;align-items:end!important;padding:20px!important;}
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.h-row>.h-column.h-col-lg-3 .md-control{width:auto!important;max-width:none!important;flex:none!important;margin:0!important;padding:0!important;}
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.h-row>.h-column.h-col-lg-3 .md-label{display:block!important;margin:0 0 7px!important;}
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.h-row>.h-column.h-col-lg-3 .select2-container{width:100%!important;max-width:none!important;}
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.h-row>.h-column.h-col-lg-3 .select2-selection--multiple{min-height:46px!important;}
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.h-row>.h-column.h-col-lg-3 .md-btn{width:100%!important;min-height:46px!important;}
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.h-row>.h-column.h-col{width:100%!important;max-width:none!important;flex:none!important;margin:0!important;padding:0!important;}
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.h-row>.h-column.h-col>.h-row.gutters-col-2{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:20px!important;align-items:stretch!important;margin:0!important;}
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.h-row>.h-column.h-col>.h-row.gutters-col-2>.h-column{width:auto!important;max-width:none!important;flex:none!important;margin:0!important;padding:0!important;}
  }
  @media(min-width:901px) and (max-width:1120px){body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.h-row>.h-column.h-col-lg-3>.d-flex.flex-column{grid-template-columns:repeat(3,minmax(0,1fr))!important;}}
  @media(max-width:900px){
    body.cth-core20-platform.vmon-search-route #buscador.md-template{width:min(calc(100% - 24px),1240px)!important;padding:28px 0 70px!important;}
    body.cth-core20-platform.vmon-search-route #buscador form.h-px-2>.d-none.d-lg-block:first-of-type{display:none!important;}
    body.cth-core20-platform.vmon-search-route #buscador .open-menu{display:inline-grid!important;place-items:center!important;width:54px!important;height:54px!important;margin:0 0 18px!important;}
  }
  body.cth-core20-platform.vmon-search-route .select2-container--open{z-index:10050!important;}
  body.cth-core20-platform.vmon-search-route .select2-dropdown{width:min(360px,calc(100vw - 32px))!important;max-width:calc(100vw - 32px)!important;box-sizing:border-box!important;}
  body.cth-core20-platform.vmon-search-route :where(.select2-results,.select2-results__options){display:block!important;width:100%!important;margin:0!important;padding:6px!important;list-style:none!important;box-sizing:border-box!important;max-height:320px!important;overflow-x:hidden!important;overflow-y:auto!important;white-space:normal!important;}
  body.cth-core20-platform.vmon-search-route .select2-results__option{display:block!important;float:none!important;clear:both!important;width:100%!important;max-width:none!important;box-sizing:border-box!important;white-space:normal!important;text-align:left!important;}
  @media(max-width:900px){body.cth-core20-platform.vmon-search-route .select2-dropdown{width:calc(100vw - 24px)!important;max-width:calc(100vw - 24px)!important;}}

  /* RC5 TOP · trip 12/12 fallback. This does not require PHP DOMDocument or
     JavaScript geometry. It exists in the compatibility quarantine because
     old Colibri/Marga rules are unlayered and may carry inline dimensions. */
  body.cth-core20-platform:is(.cth-route--marga,.cth-route--marga-embedded) .md-template.cth-trip-presentation-v2 .h-row:has(> .h-column .h-tabs){
    display:block!important;width:100%!important;max-width:none!important;min-width:0!important;
    margin-left:0!important;margin-right:0!important;
  }
  body.cth-core20-platform:is(.cth-route--marga,.cth-route--marga-embedded) .md-template.cth-trip-presentation-v2 .h-row:has(> .h-column .h-tabs) > .h-column{
    display:block!important;float:none!important;width:100%!important;max-width:none!important;min-width:0!important;
    flex:0 0 100%!important;flex-basis:100%!important;margin-left:0!important;margin-right:0!important;
  }
  body.cth-core20-platform:is(.cth-route--marga,.cth-route--marga-embedded) .md-template.cth-trip-presentation-v2 .h-row:has(> .h-column .h-tabs) > .h-column :where(.h-column__inner,.h-column__content,.h-y-container,.h-tabs,.h-tabs-item-content){
    width:100%!important;max-width:none!important;min-width:0!important;box-sizing:border-box!important;
  }
  body.cth-core20-platform:is(.cth-route--marga,.cth-route--marga-embedded) .md-template.cth-trip-presentation-v2 :where(#itinerario,#imagenes,#alojamiento) img{
    display:block!important;width:100%!important;max-width:100%!important;height:auto!important;float:none!important;box-sizing:border-box!important;
  }
  body.cth-core20-platform:is(.cth-route--marga,.cth-route--marga-embedded) .md-template.cth-trip-presentation-v2 :where(#itinerario,#imagenes,#alojamiento) table,
  body.cth-core20-platform:is(.cth-route--marga,.cth-route--marga-embedded) .md-template.cth-trip-presentation-v2 .h-row:has(> .h-column .h-tabs) > .h-column:not(:has(.h-tabs)) table{
    float:none!important;width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important;box-sizing:border-box!important;
  }
  body.cth-core20-platform:is(.cth-route--marga,.cth-route--marga-embedded) .md-template.cth-trip-presentation-v2 .h-row:has(> .h-column .h-tabs) > .h-column:not(:has(.h-tabs)){
    margin-top:clamp(28px,4vw,48px)!important;padding:clamp(22px,3vw,38px)!important;
    border:1px solid rgba(15,23,42,.11)!important;border-radius:24px!important;background:#fff!important;
  }

}
