.notif-bar__tab{
  z-index: 2;
  /* Flush with bar bottom so the wave reads as one shape with the strip/banner */
  top: 100%;
  cursor: pointer;
  width: var(--cwnb-wave-width, 70px);
  height: var(--cwnb-wave-height, 21px);
  position: absolute;
  transform: translate(0);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.notif-bar--tab-d-right .notif-bar__tab{
  right: var(--notif-bar-tab-inset, 14px);
  left: auto;
  transform: translate(0);
}

.notif-bar--tab-d-left .notif-bar__tab{
  left: var(--notif-bar-tab-inset, 14px);
  right: auto;
  transform: translate(0);
}

.notif-bar--tab-d-center .notif-bar__tab{
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

/* Mirror the wave so the scoop faces inward on the left. */
.notif-bar--tab-d-left .notif-bar__tab__wave{
  transform: scaleX(-1);
  transform-origin: center;
}

.notif-bar{
  z-index: 100;
  position: relative;
  width: 100%;
  max-width: 100%;
  font-size: var(--cwnb-font, 14px);
  /* Do not set overflow here — it can clip the wave tab (below the bar) or affect overflow-y */
}

/* Bar fill lives on .notif-bar__surface (full width) so close animation does not reveal a max-width “column”. */
.notif-bar:not(.notif-bar--hidden){
  background: transparent;
}

.notif-bar--hidden{
  background: transparent !important;
}

.notif-bar--mounted.notif-bar--hidden::before{
  content: "";
  display: block;
  width: 100%;
  height: 6px;
  background: var(--cwnb-bg, #000);
}

.notif-bar--mounted.notif-bar--transition-ready.notif-bar--hidden::before{
  transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

/* Before JS runs, keep thin strip without transition (avoids flash). */
.notif-bar--hidden:not(.notif-bar--mounted)::before{
  content: "";
  display: block;
  width: 100%;
  height: 6px;
  background: var(--cwnb-bg, #000);
}

.notif-bar--sticky{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100000;
}

body.admin-bar .notif-bar--sticky{
  top: var(--wp-admin--admin-bar--height, 32px);
}

.notif-bar--dismissed{
  display: none !important;
}

.notif-bar--hidden .notif-bar__close{
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.notif-bar__tab > *{
  pointer-events: none;
}

.notif-bar__tab__wave{
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  fill: var(--cwnb-bg, #000);
}

.notif-bar__tab__icon{
  z-index: 2;
  color: var(--cwnb-icon-closed, var(--cwnb-icon, #fff));
  display: grid;
  place-items: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(calc(-50% + var(--cwnb-icon-offset-x, 0px)), calc(-50% + var(--cwnb-icon-offset-y, -1px)));
  width: max(var(--cwnb-icon-size-closed, 16px), var(--cwnb-icon-size-open, 16px));
  height: max(var(--cwnb-icon-size-closed, 16px), var(--cwnb-icon-size-open, 16px));
  box-sizing: border-box;
  padding-bottom: 0;
  overflow: visible;
}

.notif-bar:not(.notif-bar--hidden) .notif-bar__tab__icon{
  color: var(--cwnb-icon-open, var(--cwnb-icon, #fff));
}

/* Default: info in wave when collapsed, X in circle when open */
.notif-bar__tab__icon--default .notif-bar__tab__icon--when-open{
  display: none;
}

.notif-bar__tab__icon--default .notif-bar__tab__icon--when-collapsed{
  display: block;
}

.notif-bar:not(.notif-bar--hidden) .notif-bar__tab__icon--default .notif-bar__tab__icon--when-collapsed{
  display: none;
}

.notif-bar:not(.notif-bar--hidden) .notif-bar__tab__icon--default .notif-bar__tab__icon--when-open{
  display: block;
}

/* Custom SVGs may be non-square (e.g. viewBox 32×71); never force 1:1 or the icon looks like a sliver. */
.notif-bar__tab__icon svg{
  display: block;
  width: var(--cwnb-icon-size-closed, 16px);
  height: var(--cwnb-icon-size-closed, 16px);
  flex-shrink: 0;
  /* Inherit from .notif-bar__tab__icon (uses --cwnb-icon); do not hardcode #fff */
  color: inherit;
}

.notif-bar__tab__icon--when-open svg{
  width: var(--cwnb-icon-size-open, 16px);
  height: var(--cwnb-icon-size-open, 16px);
}

.notif-bar__tab__img{
  display: block;
  width: var(--cwnb-icon-size-closed, 16px);
  height: var(--cwnb-icon-size-closed, 16px);
  object-fit: contain;
  flex-shrink: 0;
}

.notif-bar__tab__icon--when-open .notif-bar__tab__img{
  width: var(--cwnb-icon-size-open, 16px);
  height: var(--cwnb-icon-size-open, 16px);
}

.notif-bar__tab__icon svg *{
  fill: currentColor !important;
}

/* Default fallback icon uses strokes (svg fill="none") */
.notif-bar__tab__icon svg[fill="none"] *{
  fill: none !important;
  stroke: currentColor !important;
}

/* Full-width band behind content; grid row collapses here (not on .notif-bar__container max-width box). */
.notif-bar__surface{
  box-sizing: border-box;
  width: 100%;
  display: grid;
  grid-template-rows: 1fr;
  background: var(--cwnb-bg, #000);
  color: var(--cwnb-fg, #fff);
  overflow: hidden;
}

.notif-bar__container{
  box-sizing: border-box;
  width: 100%;
  max-width: var(--global-content-width, 1200px);
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
  min-height: 0;
}

/* Smooth height: grid 0fr/1fr — transitions only after .notif-bar--transition-ready (see JS). */
.notif-bar--mounted.notif-bar--transition-ready .notif-bar__surface{
  transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.notif-bar--mounted.notif-bar--hidden .notif-bar__surface{
  grid-template-rows: 0fr;
}

.notif-bar__container-inner{
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  justify-content: flex-start;
  min-height: 0;
  overflow: hidden;
  max-height: 600px;
  width: 100%;
  opacity: 1;
  /* Padding lives inside the collapsing row so open/close does not leave edge bands */
  padding-left: calc(var(--global-content-edge-padding, 16px) + var(--cwnb-pad-x, 16px));
  padding-right: calc(var(--global-content-edge-padding, 16px) + var(--cwnb-pad-x, 16px));
}

.notif-bar--mounted.notif-bar--transition-ready .notif-bar__container-inner{
  /* Opacity only — avoid translateY, which can expose body at the top/sides during transition */
  transition: opacity 0.3s ease;
}

.notif-bar--mounted.notif-bar--hidden .notif-bar__container-inner{
  opacity: 0;
  pointer-events: none;
}

/* Without mounted (SSR / before init), fall back to instant collapse. */
.notif-bar--hidden:not(.notif-bar--mounted) .notif-bar__surface{
  grid-template-rows: 0fr;
}

.notif-bar--hidden:not(.notif-bar--mounted) .notif-bar__container-inner{
  visibility: hidden;
  height: 0;
  max-height: 0;
  overflow: hidden;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
}

.notif-bar__content{
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--cwnb-font, 14px);
  line-height: 1.35;
  display: block;
  text-align: left;
  padding: var(--cwnb-pad-y, 10px) 0;
  color: var(--cwnb-fg, #fff) !important;
  font-weight: var(--cwnb-content-font-weight, 400);
  text-transform: var(--cwnb-content-text-transform, none);
}

.notif-bar--content-align-d-left .notif-bar__content{
  text-align: left;
}

.notif-bar--content-align-d-center .notif-bar__content{
  text-align: center;
}

.notif-bar--content-align-d-right .notif-bar__content{
  text-align: right;
}

.notif-bar__content p{
  margin: 0 0 0.75em;
  font-weight: inherit;
}

.notif-bar__content p:last-child{
  margin-bottom: 0;
}

.notif-bar__content a{
  color: var(--cwnb-link, currentColor);
  text-decoration: none;
  font-weight: inherit;
  text-transform: inherit;
}

.notif-bar__content a:hover{
  color: var(--cwnb-link-hover, var(--cwnb-link, currentColor));
}

.notif-bar--link-underline-always .notif-bar__content a{
  text-decoration: underline;
}

.notif-bar--link-underline-hover .notif-bar__content a{
  text-decoration: none;
}

.notif-bar--link-underline-hover .notif-bar__content a:hover{
  text-decoration: underline;
}

.notif-bar--link-underline-unset .notif-bar__content a,
.notif-bar--link-underline-unset .notif-bar__content a:hover{
  text-decoration: none;
}

.notif-bar__actions{
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding: var(--cwnb-pad-y, 10px) 8px;
}

/* Button alignment: desktop is default below; tablet/mobile overrides and stacked layout use
   theme-aligned breakpoints from PHP (Kadence or Divi; wp_add_inline_style on gotb-notification-bar). */
.notif-bar--btn-align-d-left .notif-bar__actions{
  justify-content: flex-start;
  margin-left: 0;
  margin-right: 0;
}
.notif-bar--btn-align-d-center .notif-bar__actions{
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}
.notif-bar--btn-align-d-right .notif-bar__actions{
  justify-content: flex-end;
  margin-left: auto;
  margin-right: 0;
}

.notif-bar__cta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
  font-size: var(--cwnb-btn-font-size, 13px) !important;
  text-transform: var(--cwnb-btn-text-transform, none) !important;
}

/* Custom: plugin-controlled styling */
.notif-bar--btn-custom .notif-bar__cta{
  padding: var(--cwnb-btn-pad-y, 8px) var(--cwnb-btn-pad-x, 12px);
  border-radius: var(--cwnb-btn-radius, 999px);
  background: var(--cwnb-btn-bg, rgba(255,255,255,.14));
  color: var(--cwnb-btn-fg, var(--cwnb-fg, #fff));
  font-weight: 600;
  border: 0;
}

.notif-bar--btn-custom .notif-bar__cta:hover{
  background: var(--cwnb-btn-bg-hover, rgba(255,255,255,.22));
  color: var(--cwnb-btn-fg-hover, var(--cwnb-btn-fg, var(--cwnb-fg, #fff)));
}

/* Stacked just above the wave (tab is top: 100%, height 21px) */
.notif-bar__close{
  position: absolute;
  z-index: 4;
  background-color: rgba(255,255,255,.14);
  width: 35px;
  height: 35px;
  color: var(--cwnb-fg, #fff);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.25rem;
  bottom: 0;
}

.notif-bar--tab-d-right .notif-bar__close{
  right: calc(var(--notif-bar-tab-inset, 14px) + var(--cwnb-wave-half, 35px));
  left: auto;
  transform: none;
}

.notif-bar--tab-d-left .notif-bar__close{
  left: calc(var(--notif-bar-tab-inset, 14px) + var(--cwnb-wave-half, 35px));
  right: auto;
  transform: none;
}

.notif-bar--tab-d-center .notif-bar__close{
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}

.notif-bar__close:hover{
  background: rgba(255,255,255,.22);
}

.notif-bar-sr-only{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.notif-bar-hidden{
  display: none;
}

.reset-button-style{
  -webkit-appearance: none;
  text-align: inherit;
  box-shadow: none;
  color: inherit;
  font: inherit;
  background: 0 0;
  border: none;
  border-radius: 0;
  padding: 0;
}

/* Global theme `button:hover` / `:focus` is often more specific than `.reset-button-style` alone (no :hover rules). */
.notif-bar__tab.reset-button-style:hover,
.notif-bar__tab.reset-button-style:focus,
.notif-bar__tab.reset-button-style:active{
  background: transparent;
  box-shadow: none;
}

.notif-bar__tab.reset-button-style:focus-visible{
  outline: 2px solid var(--cwnb-icon, #fff);
  outline-offset: 2px;
  background: transparent;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce){
  .notif-bar--mounted.notif-bar--transition-ready .notif-bar__surface,
  .notif-bar--mounted.notif-bar--transition-ready .notif-bar__container-inner,
  .notif-bar--mounted.notif-bar--transition-ready.notif-bar--hidden::before{
    transition: none !important;
  }
}
