/* TVK Universal Language Switcher Styling */
.tvk-lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 199, 44, 0.12);
  border: 1px solid rgba(255, 199, 44, 0.35);
  border-radius: 30px;
  padding: 6px 14px;
  cursor: pointer;
  color: #e8e0d6;
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  user-select: none;
  outline: none;
}

.tvk-lang-toggle-btn:hover {
  background: rgba(255, 199, 44, 0.22);
  border-color: #FFC72C;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 199, 44, 0.25);
}

.tvk-lang-toggle-btn .lang-icon {
  font-size: 0.95rem;
}

.tvk-lang-toggle-btn .lang-opt {
  color: #a8b4c4;
  transition: color 0.25s ease, font-weight 0.25s ease;
  padding: 2px 4px;
}

.tvk-lang-toggle-btn .lang-opt.active {
  color: #FFC72C;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(255, 199, 44, 0.4);
}

.tvk-lang-toggle-btn .lang-divider {
  color: rgba(255, 255, 255, 0.2);
  font-weight: 300;
}

.tvk-lang-toggle-btn.floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
  .tvk-lang-toggle-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
  }
}


/* ==========================================================================
   UNIVERSAL ANTI-OVERLAP TAB & NAVIGATION BUTTON STANDARDS
   Prevents flex collapse, zero-width shrinking, and text collision
   ========================================================================== */
div[style*="overflowX"],
div[style*="overflow-x"],
.tab-container-scroll,
.floating-tab-pill {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

div[style*="overflowX"] > button,
div[style*="overflow-x"] > button,
div[style*="overflowX"] > a,
div[style*="overflow-x"] > a,
.tab-pill-btn,
.nav-pill-btn {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  min-width: max-content !important;
}


/* ==========================================================================
   UNIVERSAL ANTI-OVERLAP TAB & NAVIGATION BUTTON STANDARDS (MOBILE & DESKTOP)
   Prevents flex collapse, zero-width shrinking, and text collision across all viewports
   ========================================================================== */
.tab-btn,
.tab-button,
.nav-tab-btn,
.tab-pill-btn,
.nav-pill-btn,
button.tab-btn,
div[style*="overflowX"] button,
div[style*="overflow-x"] button,
div[style*="overflowX:`auto`"] button,
div[style*="overflow-x:`auto`"] button,
div[style*="overflowX: auto"] button,
div[style*="overflow-x: auto"] button,
div[style*="overflowX:auto"] button,
div[style*="overflow-x:auto"] button,
div[style*="overflowX: 'auto'"] button,
div[style*="overflow-x: 'auto'"] button,
div[style*="overflowX: \"auto\""] button,
div[style*="overflow-x: \"auto\""] button,
.dept-view-toggle button,
.dept-toolbar button,
.dept-toolbar-filters button {
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  flex-basis: auto !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  min-width: max-content !important;
  display: inline-flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

div[style*="overflowX"],
div[style*="overflow-x"],
.tab-container-scroll,
.floating-tab-pill,
.dept-view-toggle,
.dept-toolbar,
.dept-toolbar-filters {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  width: 100% !important;
  max-width: 100% !important;
}


/* ==========================================================================
   UNIVERSAL MOBILE POPUP & MODAL RESPONSIVENESS SYSTEM (ZERO OVERFLOW)
   Guarantees all dialogs, spotlight modals, department previews, and 
   split overlays fit within mobile screens with smooth touch scrolling.
   ========================================================================== */

/* Universal overlay backdrop constraints */
.partner-spotlight-backdrop,
.dept-modal-backdrop,
.smart-share-modal-backdrop,
.gdn-modal-backdrop,
div[style*="position: fixed"],
div[style*="position:fixed"] {
  box-sizing: border-box !important;
}

/* Modal containers base safety */
.partner-spotlight-modal,
.dept-modal-container {
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  /* Backdrops on mobile viewports */
  .partner-spotlight-backdrop,
  .dept-modal-backdrop,
  .smart-share-modal-backdrop,
  .gdn-modal-backdrop,
  div[style*="position: fixed"][style*="zIndex: 9999"],
  div[style*="position:fixed"][style*="zIndex:9999"],
  div[style*="position: fixed"][style*="zIndex: 1000"],
  div[style*="position:fixed"][style*="zIndex:1000"],
  div[style*="position: fixed"][style*="zIndex: 1e3"],
  div[style*="position:fixed"][style*="zIndex:1e3"],
  div[style*="position: fixed"][style*="zIndex: 1010"],
  div[style*="position:fixed"][style*="zIndex:1010"],
  div[style*="position: fixed"][style*="zIndex: 1e5"],
  div[style*="position:fixed"][style*="zIndex:1e5"],
  div[style*="position: fixed"][style*="zIndex: 100020"],
  div[style*="position:fixed"][style*="zIndex:100020"] {
    padding: 10px !important;
    padding-top: max(10px, env(safe-area-inset-top)) !important;
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    padding-left: max(10px, env(safe-area-inset-left)) !important;
    padding-right: max(10px, env(safe-area-inset-right)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-x: hidden !important;
  }

  /* Modal cards / containers */
  .partner-spotlight-modal,
  .dept-modal-container,
  div[style*="maxWidth: 560px"],
  div[style*="maxWidth:560px"],
  div[style*="max-width: 560px"],
  div[style*="max-width:560px"],
  div[style*="maxWidth: 620px"],
  div[style*="maxWidth:620px"],
  div[style*="maxWidth: 750px"],
  div[style*="maxWidth:750px"],
  div[style*="maxWidth: 850px"],
  div[style*="maxWidth:850px"],
  div[style*="maxWidth: 900px"],
  div[style*="maxWidth:900px"],
  div[style*="maxWidth: 1200px"],
  div[style*="maxWidth:1200px"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    max-height: min(92vh, 92dvh) !important;
    border-radius: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    margin: auto !important;
    box-sizing: border-box !important;
  }

  /* Scrollable bodies inside any modal */
  .partner-spotlight-body,
  .dept-modal-body {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex: 1 1 auto !important;
    max-height: calc(92dvh - 110px) !important;
    padding: 14px 16px !important;
    box-sizing: border-box !important;
  }

  /* Modal headers */
  .dept-modal-header,
  .partner-spotlight-header {
    padding: 10px 14px !important;
    flex-shrink: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Modal footers & action buttons */
  .dept-modal-footer,
  .partner-modal-actions {
    padding: 12px 14px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  .partner-modal-actions > * {
    flex: 1 1 100% !important;
    min-width: 0 !important;
    justify-content: center !important;
    padding: 10px 14px !important;
  }

  /* Modal logo & image banners */
  .dept-modal-hero-img-wrap {
    height: 130px !important;
  }

  .partner-modal-logo-banner {
    padding: 14px 12px !important;
    min-height: 75px !important;
  }

  .partner-modal-logo-banner img {
    max-height: 50px !important;
    max-width: 80% !important;
  }

  /* Split layout modal handling for mobile */
  .modal-split-container {
    flex-direction: column !important;
    max-height: calc(92dvh - 60px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .modal-sidebar {
    width: 100% !important;
    border-left: none !important;
    border-top: 1px solid var(--tvk-border-light, #e2e8f0) !important;
    padding: 14px !important;
  }
}
