/* Smartposti / Itella pickup: Omniva-like dropdown chrome (theme only) */
body#checkout #itella-ps17-extra,
body#checkout #itella-extra,
body#checkout .hl-itella-extra-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin: .35rem 0 .75rem !important;
  padding: 0 !important;
  float: none !important;
}

/* Never force-show: JS sets aria-hidden / display when another carrier is selected */
body#checkout #itella-ps17-extra[aria-hidden="true"],
body#checkout #itella-extra[aria-hidden="true"],
body#checkout .hl-itella-extra-wrap[aria-hidden="true"],
body#checkout #itella-ps17-extra[aria-hidden="true"] #itella-extra,
body#checkout #itella-ps17-extra[aria-hidden="true"] .presta_extra_content,
body#checkout #itella-ps17-extra[aria-hidden="true"] .itella-shipping-container,
body#checkout #itella-ps17-extra[aria-hidden="true"] .itella-select,
body#checkout .miu-carrier-extra-hidden,
body#checkout .delivery-option__extra.miu-carrier-extra-hidden,
body#checkout .js-carrier-extra.miu-carrier-extra-hidden,
body#checkout .select-omnivalt.miu-carrier-extra-hidden,
body#checkout .omniva-tmjs.miu-carrier-extra-hidden,
body#checkout .tmjs-container.miu-carrier-extra-hidden,
body#checkout .dpd-pudo-container.miu-carrier-extra-hidden,
body#checkout .dpd-checkout-pickup-container.miu-carrier-extra-hidden,
body#checkout .miu-dpd-street-wrap.miu-carrier-extra-hidden {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  border: 0 !important;
}

/* Only the active carrier extra stays in normal flow */
body#checkout .delivery-option__extra:not(.hl-carrier-extra-open):not([data-active]),
body#checkout .js-carrier-extra:not(.hl-carrier-extra-open):not([data-active]) {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Keep ALL carrier rows visible — never collapse siblings when Smartposti opens */
body#checkout .delivery-options__list > .delivery-option__item {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body#checkout .itella-shipping-container {
  align-items: stretch !important;
  width: 100% !important;
  font-family: Mulish, system-ui, sans-serif !important;
  font-size: 14px !important;
}

body#checkout .itella-shipping-container .itella-chosen-point {
  font-size: .9rem !important;
  color: #4b5563 !important;
  padding-bottom: .4rem !important;
}

body#checkout .itella-select {
  width: 100% !important;
  border-radius: 10px !important;
  overflow: visible !important;
  position: relative !important;
}

/* Closed trigger — same “card” feel as Omniva selector */
body#checkout .itella-select .dropdown {
  min-height: 48px !important;
  height: auto !important;
  line-height: 1.35 !important;
  display: flex !important;
  align-items: center !important;
  padding: .75rem 2.25rem .75rem 2.75rem !important;
  border: 1px solid #c9ced4 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #18191a !important;
  font-size: .95rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  position: relative !important;
}

body#checkout .itella-select .dropdown::before {
  content: "" !important;
  position: absolute !important;
  left: .9rem !important;
  top: 50% !important;
  width: 18px !important;
  height: 18px !important;
  transform: translateY(-50%) !important;
  background: no-repeat center / contain !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23D71920'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5S10.62 6.5 12 6.5s2.5 1.12 2.5 2.5S13.38 11.5 12 11.5z'/%3E%3C/svg%3E") !important;
}

body#checkout .itella-select .dropdown:after {
  right: 1rem !important;
  border-width: 6px 5px 0 5px !important;
  border-color: #6b7280 transparent transparent transparent !important;
}

body#checkout .itella-select.open .dropdown {
  border-radius: 10px 10px 0 0 !important;
  border-color: #9fa5ac !important;
}

body#checkout .itella-select.open .dropdown:after {
  border-width: 0 5px 6px 5px !important;
  border-color: transparent transparent #6b7280 transparent !important;
}

/*
 * CRITICAL: keep list in document flow (not absolute overlay).
 * Absolute dropdown was covering Omniva/Kuller so they looked "gone".
 */
body#checkout .itella-select .dropdown-inner {
  display: none;
  position: static !important;
  z-index: 1 !important;
  border: 1px solid #c9ced4 !important;
  border-top: none !important;
  border-radius: 0 0 10px 10px !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(17, 24, 39, .12) !important;
  width: 100% !important;
}

body#checkout .itella-select.open .dropdown-inner {
  display: block !important;
}

/* Search — white bar like Omniva, not orange wash */
body#checkout .itella-select .search-bar {
  background: #f8f9fa !important;
  border-bottom: 1px solid #e5e7eb !important;
  padding: .65rem .75rem !important;
}

body#checkout .itella-select .search-bar .search-input {
  border: 1px solid #c9ced4 !important;
  border-radius: 8px !important;
  background: #fff !important;
  padding: .55rem 2.25rem .55rem .75rem !important;
  font-size: .9rem !important;
  font-family: Mulish, system-ui, sans-serif !important;
}

body#checkout .itella-select .search-bar .search-input:focus {
  outline: none !important;
  border-color: #D71920 !important;
  box-shadow: 0 0 0 2px rgba(215, 25, 32, .15) !important;
}

body#checkout .itella-select .search-bar img {
  height: 16px !important;
  right: 1.1rem !important;
  opacity: .55 !important;
}

body#checkout .itella-select .search-by {
  display: none !important;
}

body#checkout .itella-select ul {
  height: min(320px, 50vh) !important;
  padding: .25rem 0 .5rem !important;
}

body#checkout .itella-select ul li.city {
  padding: .55rem .9rem .25rem !important;
  margin-top: .25rem !important;
  font-size: .72rem !important;
  font-weight: 800 !important;
  letter-spacing: .04em !important;
  text-transform: uppercase !important;
  color: #6b7280 !important;
  background: transparent !important;
}

body#checkout .itella-select ul li:not(.city) {
  padding: .55rem .9rem !important;
  line-height: 1.35 !important;
  border-bottom: 1px solid #f1f3f5 !important;
  font-size: .9rem !important;
  color: #18191a !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: .1rem !important;
}

body#checkout .itella-select ul li:not(.city):not(.active):hover {
  background: #f8f9fa !important;
}

body#checkout .itella-select ul li.active {
  background: #fff5f5 !important;
  color: #18191a !important;
  box-shadow: inset 3px 0 0 #D71920 !important;
}

/* Map modal button if map mode ever enabled */
body#checkout .itella-shipping-container .itella-modal-btn,
body#checkout .itella-card-footer .itella-btn {
  background: #D71920 !important;
  border-radius: 8px !important;
  text-transform: none !important;
  font-family: Mulish, system-ui, sans-serif !important;
  font-weight: 700 !important;
}
body#checkout .itella-shipping-container .itella-modal-btn:hover,
body#checkout .itella-card-footer .itella-btn:hover {
  background: #b9141b !important;
}
