/* =============================================
   KingSystem.ua - CSS Fixes
   ============================================= */

/* --- TASK 4: Desktop Menu - Better contrast, larger text, spacing --- */
@media (min-width: 768px) {
  /* Increase font size and weight for menu items */
  .jet-nav .menu-item-link-top .jet-nav-link-text {
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px !important;
  }

  /* Submenu improvements */
  .jet-nav__sub {
    background: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12) !important;
    padding: 12px 0 !important;
    min-width: 220px !important;
  }

  .jet-nav__sub .menu-item-link-sub {
    padding: 10px 24px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #333 !important;
    transition: background-color 0.2s, color 0.2s !important;
  }

  .jet-nav__sub .menu-item-link-sub:hover {
    background-color: #f0faf6 !important;
    color: #56BE99 !important;
  }

  /* Submenu separator between items */
  .jet-nav__sub .jet-nav__item + .jet-nav__item {
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
  }

  /* 3rd level submenu */
  .jet-nav__sub .jet-nav__sub {
    border-radius: 12px !important;
  }

  /* --- ISSUE 11: "Монтаж" submenu in 3 columns (UA: 5942, RU: 6226) --- */
  /* --- "Сервіс/Сервис" submenu in 3 columns (UA: 5959, RU: 6229) --- */
  .jet-nav__item-5942 > .jet-nav__sub,
  .jet-nav__item-6226 > .jet-nav__sub,
  .jet-nav__item-5959 > .jet-nav__sub,
  .jet-nav__item-6229 > .jet-nav__sub {
    column-count: 3 !important;
    min-width: 660px !important;
    column-gap: 0 !important;
  }
  .jet-nav__item-5942 > .jet-nav__sub > .jet-nav__item,
  .jet-nav__item-6226 > .jet-nav__sub > .jet-nav__item,
  .jet-nav__item-5959 > .jet-nav__sub > .jet-nav__item,
  .jet-nav__item-6229 > .jet-nav__sub > .jet-nav__item {
    break-inside: avoid !important;
    -webkit-column-break-inside: avoid !important;
    border-top: none !important;
  }
  .jet-nav__item-5942 > .jet-nav__sub > .jet-nav__item + .jet-nav__item,
  .jet-nav__item-6226 > .jet-nav__sub > .jet-nav__item + .jet-nav__item,
  .jet-nav__item-5959 > .jet-nav__sub > .jet-nav__item + .jet-nav__item,
  .jet-nav__item-6229 > .jet-nav__sub > .jet-nav__item + .jet-nav__item {
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
  }
}

/* --- MOBILE SLIDE MENU (mmenu-style sliding panels) --- */
@media (max-width: 767px) {

  /* === 1. Panel container — full-height left sidebar === */
  #jet-popup-1106 .jet-popup__container {
    width: 85vw !important;
    max-width: 380px !important;
    height: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    background: #fff !important;
    margin: 0 !important;
    box-shadow: 4px 0 25px rgba(0,0,0,0.15) !important;
  }

  /* === 2. Inner flex layout — propagate through Elementor wrappers === */
  #jet-popup-1106 .jet-popup__container-inner {
    padding: 0 !important;
    overflow: hidden !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
  }
  #jet-popup-1106 .jet-popup__container-content {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  #jet-popup-1106 .jet-popup__container-content > .elementor {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  #jet-popup-1106 .e-con.e-parent {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* === 3. Close button === */
  #jet-popup-1106 .jet-popup__close-button {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 40px !important;
    height: 40px !important;
    z-index: 100 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: rgba(0,0,0,0.05) !important;
    transition: background 0.2s !important;
    transform: none !important;
  }
  #jet-popup-1106 .jet-popup__close-button:active {
    background: rgba(0,0,0,0.12) !important;
  }

  /* === 4. Logo === */
  #jet-popup-1106 .elementor-widget-image {
    flex: 0 0 auto !important;
    padding: 14px 20px !important;
    border-bottom: 1px solid #f0f0f0 !important;
  }
  #jet-popup-1106 .elementor-widget-image img {
    max-height: 34px !important;
    width: auto !important;
  }

  /* === 5. Nav widget — fills remaining space === */
  #jet-popup-1106 .elementor-widget-jet-nav-menu {
    flex: 1 1 0 !important;
    overflow: hidden !important;
    min-height: 0 !important;
    position: relative !important;
  }
  #jet-popup-1106 .elementor-widget-jet-nav-menu > .elementor-widget-container {
    height: 100% !important;
  }
  #jet-popup-1106 .elementor-widget-jet-nav-menu > .elementor-widget-container,
  #jet-popup-1106 .jet-nav-wrap,
  #jet-popup-1106 .jet-nav-wrap > [class*="-container"] {
    height: 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* === 6. Nav — positioning context for sliding panels === */
  #jet-popup-1106 .jet-nav {
    position: relative !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    width: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* === 7. All nav items — static (no positioning context) === */
  #jet-popup-1106 .jet-nav .jet-nav__item {
    position: static !important;
  }

  /* === 8. Level 1 items === */
  #jet-popup-1106 .jet-nav > .jet-nav__item > a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 20px !important;
    min-height: 54px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    text-decoration: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
    transition: background 0.15s !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  #jet-popup-1106 .jet-nav > .jet-nav__item > a:active {
    background: #f5f5f5 !important;
  }

  /* === 9. Submenu panels — slide from right === */
  #jet-popup-1106 .jet-nav .jet-nav__sub {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: #fff !important;
    transform: translateX(100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s !important;
    visibility: hidden !important;
    z-index: 5 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    columns: unset !important;
    column-count: unset !important;
    min-width: unset !important;
  }

  /* Active panel slides in */
  #jet-popup-1106 .jet-nav .jet-nav__item.ks-open > .jet-nav__sub {
    transform: translateX(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s !important;
  }

  /* Nested panels stack above */
  #jet-popup-1106 .jet-nav .jet-nav__sub .jet-nav__sub {
    z-index: 6 !important;
  }

  /* === 10. Back button (injected by JS) === */
  #jet-popup-1106 .ks-back-btn {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 0 20px !important;
    min-height: 52px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #56BE99 !important;
    background: #f8faf9 !important;
    border: none !important;
    border-bottom: 1px solid #e8f5ef !important;
    cursor: pointer !important;
    width: 100% !important;
    text-align: left !important;
    box-sizing: border-box !important;
    font-family: 'Raleway', sans-serif !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  #jet-popup-1106 .ks-back-btn:active {
    background: #eef7f2 !important;
  }
  #jet-popup-1106 .ks-back-btn svg {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    stroke: #56BE99 !important;
  }

  /* === 11. Level 2 items === */
  #jet-popup-1106 .jet-nav .jet-nav__sub > .jet-nav__item > a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 20px !important;
    min-height: 50px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #333 !important;
    text-decoration: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
    transition: background 0.15s !important;
    background: transparent !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  #jet-popup-1106 .jet-nav .jet-nav__sub > .jet-nav__item > a:active {
    background: #f5f5f5 !important;
  }

  /* === 12. Level 3 items === */
  #jet-popup-1106 .jet-nav .jet-nav__sub .jet-nav__sub > .jet-nav__item > a {
    min-height: 48px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #555 !important;
    border-bottom: 1px solid #f5f5f5 !important;
  }
  #jet-popup-1106 .jet-nav .jet-nav__sub .jet-nav__sub > .jet-nav__item > a:active {
    background: rgba(86, 190, 153, 0.08) !important;
    color: #56BE99 !important;
  }

  /* === 13. Arrow chevrons for parent items === */
  #jet-popup-1106 .jet-nav .menu-item-has-children > a img,
  #jet-popup-1106 .jet-nav .menu-item-has-children > a .jet-nav-arrow {
    display: none !important;
  }
  #jet-popup-1106 .jet-nav .menu-item-has-children > a::after {
    content: '' !important;
    display: block !important;
    width: 8px !important;
    height: 8px !important;
    border-right: 2px solid #bbb !important;
    border-bottom: 2px solid #bbb !important;
    transform: rotate(-45deg) !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
    padding-left: 12px !important;
    transition: border-color 0.15s !important;
  }
  #jet-popup-1106 .jet-nav .menu-item-has-children > a:active::after {
    border-color: #56BE99 !important;
  }

  /* === 14. Bottom section (phone + social) === */
  #jet-popup-1106 .elementor-widget-shortcode {
    flex: 0 0 auto !important;
    padding: 16px 20px 8px !important;
    border-top: 1px solid #f0f0f0 !important;
  }
  #jet-popup-1106 .elementor-widget-button {
    flex: 0 0 auto !important;
    padding: 4px 20px !important;
  }
  #jet-popup-1106 .elementor-widget-social-icons {
    flex: 0 0 auto !important;
    padding: 8px 20px 20px !important;
  }

  /* === 15. Body scroll lock === */
  body:has(#jet-popup-1106.jet-popup--show-state) {
    overflow: hidden !important;
  }

  /* === 16. Hide Binotel when menu is open === */
  body:has(#jet-popup-1106.jet-popup--show-state) .bnt-widget,
  body:has(#jet-popup-1106.jet-popup--show-state) [id*="binotel"],
  body:has(#jet-popup-1106.jet-popup--show-state) .bnt-chat-container,
  body:has(#jet-popup-1106.jet-popup--show-state) .bnt-small-widget {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* === 17. Scrollable popup for form popups (not menu) === */
  .jet-popup--show-state:not(#jet-popup-1106) .jet-popup__container-inner {
    overflow-y: auto !important;
    max-height: 85vh !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* === 18. Overlay === */
  #jet-popup-1106 .jet-popup__overlay {
    background: rgba(0, 0, 0, 0.4) !important;
  }
}

/* --- TASK 6: Fix "Отримати консультацію" popup form --- */
/* Fix square format - make it a proper modal */
.jet-popup .elementor-form,
.jet-popup .jet-popup__container-inner {
  max-width: 500px !important;
  margin: 0 auto !important;
}

/* Left-align text in form */
.jet-popup .elementor-form .elementor-field-group,
.jet-popup .elementor-form .elementor-form-fields-wrapper,
.jet-popup .elementor-form .elementor-field-label,
.jet-popup .elementor-form .elementor-field-textual {
  text-align: left !important;
}

/* Fix popup container to not be square */
.jet-popup__container {
  max-width: 550px !important;
  width: 90vw !important;
  border-radius: 16px !important;
}

/* Ensure popup content has proper padding */
.jet-popup__container-inner {
  padding: 30px !important;
}

/* Form field styling in popup */
.jet-popup .elementor-field-textual {
  border-radius: 8px !important;
  padding: 12px 16px !important;
  text-align: left !important;
}

/* Form title left-align */
.jet-popup .elementor-heading-title {
  text-align: left !important;
}

/* --- Fix Elementor carousel/slider navigation arrows after update --- */
.elementor-swiper {
  position: relative !important;
}
.elementor-slides-wrapper.swiper-container,
.elementor-main-swiper.swiper-container {
  position: relative !important;
  overflow: hidden !important;
}
.elementor-swiper-button {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 10 !important;
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  background: rgba(255,255,255,0.8) !important;
  border-radius: 50% !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}
.elementor-swiper-button-prev {
  left: 10px !important;
}
.elementor-swiper-button-next {
  right: 10px !important;
}
.elementor-swiper-button svg {
  width: 20px !important;
  height: 20px !important;
  fill: #333 !important;
}

/* --- File Upload field styling in popup form --- */
.elementor-field-type-upload {
  width: 100% !important;
}
.elementor-field-type-upload .elementor-field-label {
  display: none !important;
}
.elementor-field-type-upload input[type="file"] {
  width: 100% !important;
  padding: 14px 20px !important;
  background: #f5f5f5 !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 50px !important;
  font-size: 14px !important;
  font-family: 'Raleway', sans-serif !important;
  color: #999 !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: border-color 0.3s ease !important;
}
.elementor-field-type-upload input[type="file"]:hover {
  border-color: #4ecdc4 !important;
}
.elementor-field-type-upload input[type="file"]::file-selector-button {
  background: #4ecdc4 !important;
  color: #fff !important;
  border: none !important;
  padding: 8px 20px !important;
  border-radius: 50px !important;
  font-size: 14px !important;
  font-family: 'Raleway', sans-serif !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  margin-right: 12px !important;
  transition: background 0.3s ease !important;
}
.elementor-field-type-upload input[type="file"]::file-selector-button:hover {
  background: #6b6e71 !important;
}

/* --- ISSUE 5: File upload button grey #818285 --- */
.elementor-field-type-upload input[type="file"]::file-selector-button {
  background: #818285 !important;
}

/* --- ISSUES 2, 7: Select "Оберіть місто" border like other fields --- */
.jet-popup select.elementor-field-textual,
.jet-popup .elementor-select-wrapper select {
  border: 1px solid #e0e0e0 !important;
  border-radius: 50px !important;
  padding: 12px 20px !important;
  background-color: #fff !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.jet-popup .elementor-select-wrapper::before {
  display: none !important;
}
.jet-popup .elementor-select-wrapper .select-caret-down-wrapper {
  right: 16px !important;
}
.jet-popup .elementor-select-wrapper .select-caret-down-wrapper svg {
  width: 14px !important;
  height: 14px !important;
  fill: #555 !important;
}

/* --- ISSUES 4, 6: Close X button - move inside popup --- */
.jet-popup.jet-popup--front-mode .jet-popup__close-button {
  right: 30px !important;
  transform: none !important;
}

/* --- ISSUE 3: Popup form — scrollable overlay (mobile-friendly) --- */
.jet-popup.jet-popup--show-state {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.jet-popup.jet-popup--show-state::-webkit-scrollbar {
  display: none !important;
}
.jet-popup__container {
  max-height: none !important;
}
.jet-popup__container-inner {
  overflow: visible !important;
  max-height: none !important;
}
.jet-popup .elementor-form .elementor-field-group {
  margin-bottom: 10px !important;
}

/* --- ISSUE 8: Left-align all form text in all popups --- */
.jet-popup .elementor-widget-container,
.jet-popup .elementor-text-editor,
.jet-popup .elementor-form .elementor-field-label {
  text-align: left !important;
}

/* --- Align popup heading with form fields (match form widget-container padding) --- */
#jet-popup-559 .elementor-element-89a0261 {
  padding-left: 26px !important;
  padding-right: 26px !important;
}

/* --- Fix: Hero banner icon-list text color (dark on dark background) --- */
/* Widget 45917e3 = shared template (4 service pages), 7678031 = obslugovuvannya-opalennya */
.elementor-element-45917e3 .elementor-icon-list-text,
.elementor-element-7678031 .elementor-icon-list-text {
  color: #f8f8f8 !important;
}

/* --- Fix: ALL case carousels (main + internal pages) — equal height, no gap --- */
/* Target .jet-carousel universally — works on any page that uses JetElements carousel */
.jet-carousel .slick-track {
  display: flex !important;
}
.jet-carousel .slick-slide {
  height: auto !important;
  display: flex !important;
}
.jet-carousel .jet-carousel__item-inner,
.jet-carousel .jet-carousel__content,
.jet-carousel .jet-carousel__content > .elementor,
.jet-carousel .jet-carousel__content .e-con.e-parent,
.jet-carousel .jet-carousel__content .e-con.e-parent > .e-con-inner,
.jet-carousel .jet-carousel__content .e-con-inner > .e-con.e-child {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
}
/* Remove Elementor min-height that inflates card height */
.jet-carousel .elementor-element-7cae650 {
  min-height: auto !important;
}
/* Consistent image height across all case cards (templates use different image sizes) */
.jet-carousel .elementor-element-343a94f {
  max-height: 227px;
  overflow: hidden;
}
.jet-carousel .elementor-element-343a94f img {
  width: 100%;
  height: 227px;
  object-fit: cover;
}

/* --- Fix: Elementor overlay missing background (gradient type without colors) --- */
/* Fallback black bg for container overlays. Per-page CSS overrides if specific color is set (higher specificity). */
.elementor-element.e-con::before {
  background-color: #000;
}

/* --- Fix: Hide gray lazy loading placeholder for banner logo (RU version, wp-image-7969) --- */
img.wp-image-7969[data-lazyloaded="1"]:not(.litespeed-loaded) {
  opacity: 0 !important;
}
img.wp-image-7969.litespeed-loaded {
  opacity: 1 !important;
  transition: opacity 0.3s ease !important;
}
