/**
 * Top Bar widget for Creative Elements - front styles
 */
.cetb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 16px;
  row-gap: 4px;
  padding: 6px 16px;
  min-height: 36px;
  font-size: 13px;
  line-height: 1.4;
  position: relative;
  z-index: 50;
}
.cetb-zone {
  display: flex;
  align-items: center;
  column-gap: 14px;
  min-width: 0;
}
.cetb-zone--center {
  flex: 1 1 auto;
  justify-content: center;
}
.cetb-zone--right {
  margin-left: auto;
}
.cetb-bar > .cetb-zone--left:only-child,
.cetb-bar > .cetb-zone--right:only-child {
  margin-left: 0;
}

/* Flags */
.cetb-flag {
  width: 20px;
  height: auto;
  border-radius: 2px;
  display: block;
  flex: 0 0 auto;
}
.cetb-globe {
  flex: 0 0 auto;
}

/* Dropdowns */
.cetb-drop {
  position: relative;
}
.cetb-drop-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 4px 2px;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  white-space: nowrap;
}
.cetb-caret {
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}
.cetb-drop.is-open .cetb-caret {
  transform: rotate(180deg);
}
.cetb-drop-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 180px;
  max-height: 60vh;
  overflow: auto;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  color: #222;
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 1050;
}
.cetb-zone--right .cetb-drop-menu {
  left: auto;
  right: 0;
}
.cetb-drop.is-open .cetb-drop-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.cetb-drop-menu li {
  margin: 0;
}
.cetb-drop-menu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.cetb-drop-menu li a:hover {
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
}
.cetb-drop-menu .is-current a {
  font-weight: 700;
}

/* Region selector (design = region) */
.cetb-region {
  position: relative;
}
.cetb-region > .cetb-region-toggle {
  border: 1px solid #e0b95a;
  border-radius: 4px;
  padding: 5px 10px;
  gap: 8px;
  font-weight: 600;
}
.cetb-region.is-open .cetb-caret {
  transform: rotate(180deg);
}

/* Region modal (fixed = escapes any overflow:hidden container) */
.cetb-region-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.cetb-region-modal[hidden] {
  display: none;
}
.cetb-region-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  border: 0;
}
.cetb-region-dialog {
  position: relative;
  z-index: 1;
  width: 900px;
  max-width: 100%;
  background: #fff;
  color: #1a1a1a;
  border-radius: 8px;
  padding: 36px 44px 44px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  animation: cetb-pop 0.18s ease;
}
@keyframes cetb-pop {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}
.cetb-region-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
  color: inherit;
  padding: 4px 8px;
}
.cetb-region-close:hover {
  opacity: 0.7;
}
.cetb-region-head {
  text-align: center;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.cetb-region-head h3 {
  margin: 0 0 8px;
  font-size: 42px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.05;
}
.cetb-region-head p {
  margin: 0 auto;
  max-width: 520px;
  font-size: 15px;
  opacity: 0.75;
}
.cetb-region-grid {
  display: grid;
  grid-template-columns: repeat(var(--cetb-cols, 3), minmax(0, 1fr));
  gap: 2px 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.cetb-region-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 8px;
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 700;
}
.cetb-region-item a:hover {
  background: rgba(0, 0, 0, 0.05);
}
.cetb-region-item .cetb-flag {
  width: 26px;
  flex: 0 0 auto;
}
.cetb-region-cur {
  opacity: 0.6;
  font-weight: 400;
}

.cetb-modal-open {
  overflow: hidden;
}

/* Rotating messages */
.cetb-rotator {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.cetb-msgs {
  display: grid;
  min-width: 0;
}
.cetb-msg {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s;
}
.cetb-msg.is-active {
  opacity: 1;
  visibility: visible;
}
.cetb-rotator--slide .cetb-msg {
  transform: translateY(10px);
}
.cetb-rotator--slide .cetb-msg.is-active {
  transform: none;
}
.cetb-msg a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: underline;
}
.cetb-msg i {
  flex: 0 0 auto;
}
.cetb-arrow {
  background: none;
  border: 0;
  padding: 2px 4px;
  color: inherit;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}
.cetb-arrow:hover {
  opacity: 1;
}

/* Modern marquee (continuous scroll) */
.cetb-rotator--marquee {
  display: block;
  width: 100%;
  overflow: hidden;
}
.cetb-marquee {
  width: 100%;
  overflow: hidden;
}
.cetb-marquee-track {
  display: flex;
  width: max-content;
  flex-wrap: nowrap;
  will-change: transform;
  animation-name: cetb-marquee;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: 20s;
}
.cetb-marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  white-space: nowrap;
}
.cetb-marquee-item a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: underline;
}
.cetb-marquee-item i {
  flex: 0 0 auto;
}
@keyframes cetb-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .cetb-marquee-track {
    animation: none;
  }
}

/* Responsive */
@media (max-width: 767px) {
  .cetb-hide-mobile {
    display: none !important;
  }
  .cetb-bar {
    column-gap: 10px;
    row-gap: 6px;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 12px;
    justify-content: center;
  }
  .cetb-zone {
    column-gap: 10px;
    margin: 0;
  }
  /* Mobile alignment (per-device, independent of desktop position) */
  .cetb-bar.cetb-malign-center {
    justify-content: center;
  }
  .cetb-bar.cetb-malign-left {
    justify-content: flex-start;
  }
  .cetb-bar.cetb-malign-right {
    justify-content: flex-end;
  }
  .cetb-bar.cetb-malign-between {
    justify-content: space-between;
  }
  .cetb-zone--right {
    margin-left: 0;
  }
  .cetb-zone--center {
    order: 3;
    flex-basis: 100%;
    justify-content: center;
  }
  .cetb-bar > .cetb-zone--center:only-child {
    order: 0;
    flex-basis: auto;
  }
  .cetb-drop-menu {
    min-width: 150px;
  }
  /* Compact centered region popup on mobile (not full screen) */
  .cetb-region-modal {
    padding: 16px;
    align-items: center;
  }
  .cetb-region-dialog {
    width: 100% !important;
    max-width: 360px;
    min-height: 0;
    max-height: 85vh;
    overflow: auto;
    border-radius: 8px;
    padding: 22px 20px 26px;
  }
  .cetb-region-head {
    padding-top: 8px;
    padding-bottom: 16px;
    margin-bottom: 16px;
  }
  .cetb-region-head h3 {
    font-size: 30px;
  }
  .cetb-region-head p {
    font-size: 13px;
  }
  .cetb-region-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .cetb-region-item a {
    padding: 10px 6px;
    gap: 10px;
  }
  .cetb-region-item .cetb-flag {
    width: 22px;
  }
  .cetb-region-close {
    top: 10px;
    right: 12px;
    font-size: 28px;
  }
}
@media (min-width: 768px) {
  .cetb-hide-desktop {
    display: none !important;
  }
}
