/* MMPRO Topbar: Robust styling for all WooCommerce themes (WoodMart, Astra, Elementor, Storefront) */
#mm-pro-topbar.mm-pro-topbar {
  display: block !important;
  visibility: visible !important;
  position: relative !important;
  z-index: 99999 !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background: #f8f9fa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 6px 16px;
  font-family: inherit;
  font-size: 13px;
  color: #333;
}

/* Inner container: Left & Right alignment */
#mm-pro-topbar .mm-pro-topbar-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  max-width: 1280px;
  margin: 0 auto;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
}

/* Left / Right groups */
#mm-pro-topbar .mm-pro-topbar-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px;
  justify-content: flex-start;
  flex-shrink: 1;
  min-width: 0;
}

#mm-pro-topbar .mm-pro-topbar-left:empty {
  display: none !important;
}

#mm-pro-topbar .mm-pro-topbar-right {
  display: flex !important;
  align-items: center !important;
  gap: 10px;
  justify-content: flex-end;
  margin-inline-start: auto !important;
  flex-shrink: 1;
  min-width: 0;
}

[dir="rtl"] #mm-pro-topbar .mm-pro-topbar-right,
.rtl #mm-pro-topbar .mm-pro-topbar-right {
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* Language selector wrapper */
#mm-pro-topbar .mm-pro-topbar-lang {
  display: inline-flex !important;
  align-items: center !important;
  position: relative !important;
}

/* Language wrapper from GTranslate */
#mm-pro-topbar .mm-pro-topbar-lang .gtranslate_wrapper {
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
}

/* Ensure GTranslate widget inside top bar aligns cleanly */
#mm-pro-topbar .mm-pro-topbar-lang .gt_switcher {
  margin: 0 !important;
  vertical-align: middle !important;
}

/* Theme-safe fallback language select styling */
#mm-pro-topbar .mmpro-lang-select,
#mm-pro-topbar .mm-pro-topbar-lang select,
#mm-pro-topbar .mm-pro-topbar-lang .notranslate select,
#mm-pro-topbar select.gt_selector {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  display: inline-block !important;
  width: auto !important;
  max-width: 220px;
  min-width: 100px;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px !important;
  line-height: 1.2 !important;
  font-weight: 600 !important;
  padding: 6px 28px 6px 12px !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 999px !important;
  background: #fff url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23333333%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E") no-repeat right 10px center / 10px 10px !important;
  color: #333 !important;
  cursor: pointer;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box !important;
}

#mm-pro-topbar .mmpro-lang-select:focus,
#mm-pro-topbar .mm-pro-topbar-lang select:focus,
#mm-pro-topbar select.gt_selector:focus {
  border-color: rgba(0, 0, 0, 0.35) !important;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

/* Remove container-level pseudo caret to prevent duplicate arrows over GTranslate */
#mm-pro-topbar .mm-pro-topbar-lang:after {
  content: none !important;
  display: none !important;
}

/* RTL Caret & padding alignment */
[dir="rtl"] #mm-pro-topbar .mmpro-lang-select,
.rtl #mm-pro-topbar .mmpro-lang-select,
[dir="rtl"] #mm-pro-topbar .mm-pro-topbar-lang select,
.rtl #mm-pro-topbar .mm-pro-topbar-lang select,
[dir="rtl"] #mm-pro-topbar select.gt_selector,
.rtl #mm-pro-topbar select.gt_selector {
  padding: 6px 12px 6px 28px !important;
  background-position: left 10px center !important;
}

/* Strict duplicate suppression: if GTranslate switcher widget exists, hide any secondary select */
#mm-pro-topbar .mm-pro-topbar-lang .gtranslate_wrapper .gt_switcher ~ select,
#mm-pro-topbar .mm-pro-topbar-lang .gtranslate_wrapper .switcher ~ select,
#mm-pro-topbar .mm-pro-topbar-lang .gtranslate_wrapper select ~ select,
#mm-pro-topbar .mm-pro-topbar-lang .gtranslate_wrapper select:nth-of-type(n+2),
#mm-pro-topbar .mm-pro-topbar-lang .gt_switcher + select,
#mm-pro-topbar .mm-pro-topbar-lang select + .gt_switcher {
  display: none !important;
}

/* Hide legacy text label if present */
#mm-pro-topbar .mm-pro-topbar-lang-label {
  display: none !important;
}

/* Prevent selectors breaking to next line */
#mm-pro-topbar select,
#mm-pro-topbar .gtranslate_wrapper {
  white-space: nowrap !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  #mm-pro-topbar.mm-pro-topbar {
    padding: 4px 10px;
  }
  #mm-pro-topbar .mm-pro-topbar-inner {
    gap: 8px !important;
  }
  #mm-pro-topbar .mmpro-lang-select,
  #mm-pro-topbar .mm-pro-topbar-lang select,
  #mm-pro-topbar select.gt_selector {
    font-size: 12px !important;
    padding: 5px 24px 5px 10px !important;
    max-width: 140px;
    min-width: 80px;
  }
  [dir="rtl"] #mm-pro-topbar .mmpro-lang-select,
  .rtl #mm-pro-topbar .mmpro-lang-select,
  [dir="rtl"] #mm-pro-topbar .mm-pro-topbar-lang select,
  .rtl #mm-pro-topbar .mm-pro-topbar-lang select,
  [dir="rtl"] #mm-pro-topbar select.gt_selector,
  .rtl #mm-pro-topbar select.gt_selector {
    padding: 5px 10px 5px 24px !important;
  }
}

@media (max-width: 480px) {
  #mm-pro-topbar .mm-pro-topbar-inner {
    flex-wrap: wrap !important;
    row-gap: 6px;
  }
}

/* Per-Market Announcement Bar (Zero-Page-Builder Overhead) */
.mmpro-announcement-bar {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 9px 14px !important;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 500;
  position: relative !important;
  z-index: 100000 !important;
}
.mmpro-announcement-bar.is-dismissed {
  display: none !important;
}
.mmpro-announcement-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px;
  position: relative;
  padding-inline: 28px;
}
.mmpro-announcement-content {
  display: inline-flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.mmpro-announcement-link {
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.mmpro-announcement-cta {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.4;
  transition: opacity 0.15s ease;
}
.mmpro-announcement-cta:hover {
  opacity: 0.85;
}
.mmpro-announcement-close {
  position: absolute;
  inset-inline-end: 0;
  top: 50%;
  transform: translateY(-50%);
  background: transparent !important;
  border: 0 !important;
  padding: 2px 6px !important;
  margin: 0 !important;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  box-shadow: none !important;
}
.mmpro-announcement-close:hover {
  opacity: 1;
}
@media (max-width: 640px) {
  .mmpro-announcement-bar {
    font-size: 12px;
    padding: 7px 10px;
  }
}