/**
   * Top Bar CTA - Frontend Styles
   *
   * CSS Variables (defined in PHP):
   * --tbcta-bg-color    : Background color
   * --tbcta-text-color  : Text color
   * --tbcta-height      : Bar height (desktop)
   */

/* ===========================================
    Base Styles
   =========================================== */

.tbcta-bar {
  box-sizing: border-box;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: var(--tbcta-height, 50px);
  height: var(--tbcta-height, 50px);
  background-color: var(--tbcta-bg-color, #1e40af);
  color: var(--tbcta-text-color, #ffffff);
  font-size: 18px;
  line-height: 1.4;
  z-index: 9999;
}

.tbcta-bar.tbcta-message-hidden {
  padding: 0 !important;
}

.tbcta-bar *,
.tbcta-bar *::before,
.tbcta-bar *::after {
  box-sizing: border-box;
}

/* ===========================================
    Container & Content
   =========================================== */

.tbcta-container {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1200px;
  width: 100%;
  gap: 12px;
  padding: 8px 20px;
  text-align: center;
}

.tbcta-message-hidden > .tbcta-container {
  padding: 0 !important;
}

.tbcta-message {
  margin: 0;
}

/* ===========================================
    Link Styles
   =========================================== */

.tbcta-link {
  color: var(--tbcta-text-color, #ffffff);
  font-size: var(--tbcta-link-size, 18px);
  font-weight: var(--tbcta-link-weight, bold);
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.tbcta-message-hidden > .tbcta-container > .tbcta-link {
  display: block;
  width: 100%;
  height: 100%;
  padding: 12px 20px;
  cursor: pointer;
}

.tbcta-link:hover,
.tbcta-link:focus {
  color: var(--tbcta-text-color, #ffffff);
  opacity: 0.8;
  text-decoration: none;
}

/* ===========================================
    Sticky Mode / Positions
   =========================================== */

.tbcta-bar.tbcta-sticky {
  position: fixed;
  left: 0;
  right: 0;
}

.tbcta-bar.tbcta-top {
  top: 0;
}

.tbcta-bar.tbcta-bottom {
  bottom: 0;
}

.admin-bar .tbcta-bar.tbcta-top.tbcta-sticky {
  top: 32px;
}

/* ===========================================
    Visibility - Desktop & Mobile
   =========================================== */

.tbcta-bar.tbcta-desktop-only {
  display: flex;
}

.tbcta-bar.tbcta-mobile-only {
  display: none;
}

@media screen and (max-width: 783px) {
  .tbcta-bar.tbcta-desktop-only {
    display: none;
  }

  .tbcta-bar.tbcta-mobile-only {
    display: flex;
  }
}

/* ===========================================
    Responsive - Tablet & Mobile (< 783px)
   =========================================== */

@media screen and (max-width: 782px) {
  .tbcta-bar {
    height: auto;
    min-height: auto;
    padding: 12px 0;
  }

  .tbcta-container {
    flex-direction: column;
    gap: 8px;
    padding: 0 15px;
  }

  .tbcta-message {
    white-space: normal;
    word-wrap: break-word;
  }

  .admin-bar .tbcta-bar.tbcta-top.tbcta-sticky {
    top: 46px;
  }
}

/* ===========================================
    Responsive - Mobile (< 601px)
   =========================================== */

@media screen and (max-width: 600px) {
  .admin-bar .tbcta-bar.tbcta-top.tbcta-sticky {
    top: 0;
  }
}
