/* Osano CMP 2026.10.1 placement. Selectors are classes recorded in
   qa/05/dom-evidence.json from the live container (showDrawer / showDoNotSell).
   Colour stays in site.css. This file only places the open dialog, keeps the
   close control on screen, and locks page scroll while that dialog is open.

   Open preferences: .osano-cm-info--open, and the dialog drops
   .osano-cm-info-dialog--hidden. Do Not Sell adds .osano-cm-info--do_not_sell
   on that same panel. The regional banner and the floating launcher are not in this file. */

/* The dialog is the full-viewport layer. Dim the page; do not cover it. */
.osano-cm-window .osano-cm-info-dialog:not(.osano-cm-info-dialog--hidden){
  position:fixed !important;
  inset:0 !important;
  width:100% !important;
  height:100% !important;
  max-height:none !important;
  margin:0 !important;
  background:rgba(0,0,0,.55) !important;
  transform:none !important;
  z-index:70 !important;
}

/* Current Do Not Sell markup puts role=dialog on .osano-cm-window__info-dialog.
   That element is the modal, not the viewport. The older .osano-cm-info--do_not_sell
   panel still fills it. A window veil dims the page without growing the dialog box. */
.osano-cm-window:has(.osano-cm-info--open.osano-cm-info--do_not_sell)::before{
  content:"";
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  z-index:0;
}
.osano-cm-window .osano-cm-info-dialog:not(.osano-cm-info-dialog--hidden):has(.osano-cm-info--do_not_sell){
  position:fixed !important;
  inset:auto !important;
  top:50% !important;
  right:auto !important;
  bottom:auto !important;
  left:50% !important;
  width:min(420px,calc(100vw - 32px)) !important;
  max-width:calc(100vw - 32px) !important;
  height:auto !important;
  max-height:85svh !important;
  margin:0 !important;
  transform:translate(-50%,-50%) !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
  background:transparent !important;
  border-radius:0 !important;
}
@media (max-width:860px){
  .osano-cm-window .osano-cm-info-dialog:not(.osano-cm-info-dialog--hidden):has(.osano-cm-info--do_not_sell){
    top:auto !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;
    width:100% !important;
    max-width:none !important;
    height:auto !important;
    max-height:85svh !important;
    transform:none !important;
    border-radius:16px 16px 0 0 !important;
  }
}

/* Shared open panel: header stays put, the view list scrolls inside. */
.osano-cm-window .osano-cm-info.osano-cm-info--open{
  display:flex !important;
  flex-direction:column !important;
  box-sizing:border-box !important;
  overflow:hidden !important;
  margin:0 !important;
  padding-bottom:env(safe-area-inset-bottom,0px) !important;
  z-index:71 !important;
}
.osano-cm-window .osano-cm-info.osano-cm-info--open .osano-cm-info-dialog-header{
  position:relative !important;
  top:auto !important;
  flex:0 0 auto !important;
  width:100% !important;
  box-sizing:border-box !important;
  min-height:58px !important;
  padding-right:56px !important;
  z-index:2 !important;
}
.osano-cm-window .osano-cm-info.osano-cm-info--open .osano-cm-info-dialog-header__close{
  position:absolute !important;
  top:6px !important;
  right:8px !important;
  left:auto !important;
  bottom:auto !important;
  margin:0 !important;
  flex:0 0 auto !important;
  visibility:visible !important;
  z-index:3 !important;
}
.osano-cm-window .osano-cm-info.osano-cm-info--open .osano-cm-info-views{
  flex:1 1 auto !important;
  min-height:0 !important;
  height:auto !important;
  padding-top:8px !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  overscroll-behavior:contain !important;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y;
}

/* Desktop preferences: a 420px panel on the right, not the viewport. */
.osano-cm-window .osano-cm-info.osano-cm-info--position_right.osano-cm-info--open:not(.osano-cm-info--do_not_sell){
  position:fixed !important;
  top:0 !important;
  right:0 !important;
  bottom:0 !important;
  left:auto !important;
  width:420px !important;
  max-width:420px !important;
  height:auto !important;
  max-height:100svh !important;
  transform:none !important;
  border-radius:0 !important;
}
.osano-cm-window .osano-cm-info.osano-cm-info--position_right.osano-cm-info--open:not(.osano-cm-info--do_not_sell) .osano-cm-info-views{
  max-height:calc(100svh - 4.75rem - env(safe-area-inset-bottom,0px)) !important;
}

/* Phone preferences: bottom sheet, page still visible above it. */
@media (max-width:860px){
  .osano-cm-window .osano-cm-info.osano-cm-info--position_right.osano-cm-info--open:not(.osano-cm-info--do_not_sell){
    top:auto !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;
    width:100% !important;
    max-width:none !important;
    height:auto !important;
    max-height:85svh !important;
    transform:none !important;
    border-radius:16px 16px 0 0 !important;
  }
  .osano-cm-window .osano-cm-info.osano-cm-info--position_right.osano-cm-info--open:not(.osano-cm-info--do_not_sell) .osano-cm-info-views{
    max-height:calc(85svh - 4.75rem - env(safe-area-inset-bottom,0px)) !important;
  }
}

/* Do Not Sell is a centered modal in both layouts. */
.osano-cm-window .osano-cm-info.osano-cm-info--open.osano-cm-info--do_not_sell{
  position:fixed !important;
  top:50% !important;
  left:50% !important;
  right:auto !important;
  bottom:auto !important;
  width:min(420px,calc(100vw - 32px)) !important;
  max-width:calc(100vw - 32px) !important;
  height:auto !important;
  max-height:85svh !important;
  transform:translate(-50%,-50%) !important;
  border-radius:0 !important;
}
.osano-cm-window .osano-cm-info-dialog:has(.osano-cm-info--do_not_sell) .osano-cm-info.osano-cm-info--open.osano-cm-info--do_not_sell{
  position:relative !important;
  top:auto !important;
  right:auto !important;
  bottom:auto !important;
  left:auto !important;
  width:100% !important;
  max-width:none !important;
  height:auto !important;
  max-height:85svh !important;
  transform:none !important;
  flex:1 1 auto !important;
}
.osano-cm-window .osano-cm-info.osano-cm-info--open.osano-cm-info--do_not_sell .osano-cm-info-views{
  max-height:calc(85svh - 4.75rem - env(safe-area-inset-bottom,0px)) !important;
}

/* Closed layers only set visibility:hidden. A child with visibility:visible
   still paints, which left an empty close square under the nav. Remove them
   from paint and hit-testing until the recorded open class is present. */
.osano-cm-window .osano-cm-info-dialog.osano-cm-info-dialog--hidden,
.osano-cm-window .osano-cm-info:not(.osano-cm-info--open){
  display:none !important;
  visibility:hidden !important;
  pointer-events:none !important;
}

/* Page scroll locks only while the recorded open class is present. */
html:has(.osano-cm-window .osano-cm-info--open),
body:has(.osano-cm-window .osano-cm-info--open){
  overflow:hidden;
}

@media (prefers-reduced-motion:reduce){
  .osano-cm-window .osano-cm-info,
  .osano-cm-window .osano-cm-info-dialog{
    transition:none !important;
    animation:none !important;
  }
}

.osano-cm-window .osano-cm-info.osano-cm-info--open .osano-cm-close:focus-visible{
  outline:3px solid var(--ivory) !important;
  outline-offset:2px !important;
}
