/* =========================================================
   BMW Supplier XChange — App Announcement Banner
   States: visible (banner open) / dismissed (floating icon)
   ========================================================= */

/* ---- Banner bar ---- */
#xchange-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background-color: rgba(0,61,120,1);
  color: #ffffff;
  z-index: 1100;
  display: flex;
  align-items: center;
  transform: translateY(0);
  transition: transform 0.4s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

#xchange-banner.xchange-banner--hidden {
  transform: translateY(-100%);
  pointer-events: none;
}

/* ---- Banner inner layout ---- */
.xchange-banner-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ---- Banner text ---- */
.xchange-banner-text {
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: 0.01em;
}

@media (max-width: 767px) {
  .xchange-banner-text {
    font-size: 12px;
    line-height: 1.4;
  }
}

@media (max-width: 480px) {
  #xchange-banner {
    height: auto;
    min-height: 100px;
    padding: 12px 0;
  }
  .xchange-banner-text {
    font-size: 11px;
  }
}

/* ---- PDF / How-To icon button ---- */
.xchange-banner-pdf-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.7);
  color: #ffffff;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  outline: none;
}

.xchange-banner-pdf-btn:hover,
.xchange-banner-pdf-btn:focus {
  background-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
  color: #ffffff;
  text-decoration: none;
}

.xchange-banner-pdf-btn svg {
  width: 26px;
  height: 26px;
  fill: #ffffff;
  pointer-events: none;
}

/* ---- Close (×) button ---- */
.xchange-banner-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  padding: 0;
}

.xchange-banner-close:hover,
.xchange-banner-close:focus {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.9);
  outline: none;
}

/* ---- Navbar offset when banner is open ---- */
body.xchange-banner-open nav#navbar-main {
  top: 100px !important;
  transition: top 0.4s ease !important;
}

body:not(.xchange-banner-open) nav#navbar-main {
  transition: top 0.4s ease !important;
}

/* ---- Floating icon (bottom-right, shown when dismissed) ---- */
#xchange-floating-icon {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: rgba(0,61,120,1);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1100;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#xchange-floating-icon.xchange-floating-icon--visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

#xchange-floating-icon:hover,
#xchange-floating-icon:focus {
  background-color: rgba(0, 75, 220, 1);
  outline: none;
  transform: scale(1.08);
}

#xchange-floating-icon.xchange-floating-icon--visible:hover {
  transform: scale(1.08);
}

#xchange-floating-icon svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
  pointer-events: none;
}

/* ---- Tooltip on floating icon ---- */
#xchange-floating-icon::after {
  content: "XChange App Info";
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#xchange-floating-icon:hover::after {
  opacity: 1;
}
