/**
 * Header stacking — single z-index scale for mobile + desktop.
 *
 * Layer scale (low → high):
 *   1–10     Page content (carousels, sliders, rows)
 *   900–960  Bottom nav / betslip (framework defaults, unchanged)
 *   10000    Header shell (.layout-header-holder-bc)
 *   10010    Fixed / sticky header bar (.header-bc)
 *   10015    Header smart panel arrow
 *   10020    Header interactive controls (profile, auth, toggle)
 *   10030    Header dropdown menus (.nav-menu-sub)
 *   10100    Header sliding overlays (profile panel, notifications, mobile nav)
 *   10120    Header close control when overlay open
 *   10200+   Modals / full-screen popups (framework)
 */

/* --- Cap page content so carousels never compete with header --- */
.layout-content-holder-bc {
  position: relative;
  z-index: 1;
}

.layout-content-holder-bc .hm-row-bc,
.layout-content-holder-bc .hm-row-bc.has-slider,
.layout-content-holder-bc .casinoProviderContent,
.layout-content-holder-bc .carousel,
.layout-content-holder-bc .carousel-viewport,
.layout-content-holder-bc .carousel-container,
.layout-content-holder-bc .carousel-slide,
.layout-content-holder-bc .carouselWrapper,
.layout-content-holder-bc .slider-bc,
.layout-content-holder-bc .swiper {
  position: relative;
  z-index: 1;
}

.layout-content-holder-bc .carousel-viewport,
.layout-content-holder-bc .carousel-container {
  isolation: isolate;
}

/* Profile panel internal balance carousel — stay inside overlay */
.user-profile-container .carousel,
.user-profile-container .carousel-viewport,
.user-profile-container .carousel-container,
.user-profile-container .carousel-slide {
  position: relative;
  z-index: 1;
}

/* --- Header shell --- */
.layout-header-holder-bc {
  position: relative;
  z-index: 10000 !important;
  isolation: isolate;
}

.layout-header-holder-bc .header-bc,
.layout-header-holder-bc .hdr-main-content-bc {
  position: relative;
}

html.is-mobile .header-bc,
[class*="is-mobile"] .header-bc {
  z-index: 10010 !important;
}

html.is-web .layout-header-holder-bc,
[class*="is-web"] .layout-header-holder-bc {
  z-index: 10000 !important;
}

/* --- Header interactive controls --- */
.hdr-user-bc,
.hdr-user-bc .user-balance-dropdown,
.hdr-user-bc .user-balance-dropdown .nav-menu-item,
.hdr-user-bc .hdr-user-avatar-icon-bc,
.hdr-user-bc .hdr-user-info-content-bc,
.hdr-toggle-button-bc,
.hdr-user-close {
  position: relative;
  z-index: 10020 !important;
  pointer-events: auto !important;
}

.hdr-user-bc .btn.sign-in,
.hdr-user-bc .btn.register,
.hdr-user-bc button[title="GİRİŞ"],
.hdr-user-bc button[title="Kayıt"] {
  position: relative;
  z-index: 10020 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Desktop profile / wallet dropdown menus */
.header-user-nav .nav-menu-sub,
.header-user-nav .nav-menu-sub-wallet,
.layout-header-holder-bc .nav-menu-container .nav-menu-sub {
  z-index: 10030 !important;
}

/* Smart panel sits above header bar, below dropdowns */
.hdr-smart-panel-holder-arrow-bc {
  z-index: 10015 !important;
}

/* --- Sliding overlays (mobile profile, notifications, favorites) --- */
.overlay-sliding-wrapper-bc,
.hdr-smart-panel-holder-arrow-bc ~ .overlay-sliding-wrapper-bc {
  z-index: 10100 !important;
}

/* Mobile overlays must clear the full header (main + nav), not just main section */
html.is-mobile .overlay-sliding-wrapper-bc,
[class*="is-mobile"] .overlay-sliding-wrapper-bc {
  top: var(--mobile-header-full-height, var(--mobile-header-main-section-height));
  height: calc(100% - var(--mobile-header-full-height, var(--mobile-header-main-section-height)));
  bottom: auto;
}

/* Close icon stays clickable above overlay backdrop */
.layout-header-holder-bc .hdr-user-close:not(.display-none) {
  z-index: 10120 !important;
}

/* --- Mobile hamburger nav (hdr-nav-menu-holder-bc / m-navigation-container-bc) --- */
html.is-mobile .layout-header-holder-bc .hdr-nav-menu-holder-bc,
[class*="is-mobile"] .layout-header-holder-bc .hdr-nav-menu-holder-bc {
  z-index: 10100 !important;
  padding-top: 0 !important;
  height: 100% !important;
  pointer-events: auto !important;
}

html.is-mobile .hdr-nav-menu-holder-bc .m-navigation-container-bc,
[class*="is-mobile"] .hdr-nav-menu-holder-bc .m-navigation-container-bc {
  position: relative;
  z-index: 1;
  height: 100%;
}

html.is-mobile .hdr-nav-menu-holder-bc .m-nav-title-row-bc,
[class*="is-mobile"] .hdr-nav-menu-holder-bc .m-nav-title-row-bc {
  position: relative;
  z-index: 2;
  padding-top: env(safe-area-inset-top, 0px);
  min-height: calc(44px + env(safe-area-inset-top, 0px));
  box-sizing: border-box;
}

/* Close (X) must sit above header bar and remain tappable */
html.is-mobile .hdr-nav-menu-holder-bc .closed-n-p-bc,
[class*="is-mobile"] .hdr-nav-menu-holder-bc .closed-n-p-bc {
  position: relative;
  z-index: 10120 !important;
  pointer-events: auto !important;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
}

/* --- Non-interactive hidden layers --- */
#webspor-betslip-backdrop:not(.is-visible) {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.popup-holder-bc.loginpopup.display-none,
.popup-holder-bc.registerpopup.display-none,
.popup-holder-bc.display-none {
  pointer-events: none !important;
}

/* Promotion detail (portaled to body via promotions-modal.js) */
.popup-holder-bc.promotion-details-popup:not(.display-none),
.overlay-sliding-wrapper-bc.promotion-details-popup:not(.display-none) {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10250 !important;
}
