/*
  IONTMAX notifications – cart-first toast styles
  v4 – delší zobrazení toastu (6 s)
*/

:root {
  --im-notify-text: #ffffff;
  --im-notify-bg: #089455;
  --im-notify-radius: 12px;
  --im-notify-duration: 6s;
  --im-notify-gap: 12px;
}

html {
  --im-notify-right: calc(
    (100% - min(calc(100% - var(--im-pad, clamp(20px, 4vw, 72px)) * 2), var(--im-max, 1800px))) / 2
  );
}

#messages,
.messages,
.messages-wrapper,
.ajax-message,
.msg-wrapper {
  position: fixed !important;
  top: calc(var(--im-header-offset, 120px) + var(--im-notify-gap) + env(safe-area-inset-top, 0px)) !important;
  right: var(--im-notify-right) !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: min(430px, calc(100vw - var(--im-notify-right) - 12px)) !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  z-index: 210 !important;
  pointer-events: none !important;
}

#messages .msg,
.messages .msg,
.messages-wrapper .msg,
.ajax-message .msg,
.msg-wrapper .msg,
.msg[role="alert"][data-testid="notifierMessage"] {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 13px 14px !important;
  border: 0 !important;
  border-radius: var(--im-notify-radius) !important;
  background: var(--im-notify-bg) !important;
  color: var(--im-notify-text) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  text-align: left !important;
  box-shadow: none !important;
  pointer-events: auto !important;
  animation: im-notify-fade var(--im-notify-duration) ease forwards !important;
}

#messages .msg-success,
.messages .msg-success,
#messages .msg-error,
.messages .msg-error,
#messages .msg-warning,
.messages .msg-warning,
#messages .msg-info,
.messages .msg-info,
.msg.msg-success,
.msg.msg-error,
.msg.msg-warning,
.msg.msg-info {
  background: var(--im-notify-bg) !important;
  color: var(--im-notify-text) !important;
}

.im-notify-cart-copy {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  gap: 2px !important;
}

.im-notify-cart-title {
  display: block !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
}

.im-notify-cart-detail {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  opacity: 0.92 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

#messages .msg a.im-notify-cart-link,
.messages .msg a.im-notify-cart-link,
.messages-wrapper .msg a.im-notify-cart-link,
.ajax-message .msg a.im-notify-cart-link,
.msg-wrapper .msg a.im-notify-cart-link {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 13px !important;
  border-radius: 9px !important;
  background: #ffffff !important;
  color: #066f40 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  pointer-events: auto !important;
}

#messages .msg .close,
.messages .msg .close,
.messages-wrapper .msg .close,
.ajax-message .msg .close,
.msg-wrapper .msg .close {
  color: rgba(255, 255, 255, 0.9) !important;
}

@keyframes im-notify-fade {
  0%,
  82% {
    opacity: 1;
    visibility: visible;
  }

  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@media (max-width: 767px) {
  #messages,
  .messages,
  .messages-wrapper,
  .ajax-message,
  .msg-wrapper {
    top: auto !important;
    right: 12px !important;
    left: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
  }

  #messages .msg,
  .messages .msg,
  .messages-wrapper .msg,
  .ajax-message .msg,
  .msg-wrapper .msg,
  .msg[role="alert"][data-testid="notifierMessage"] {
    gap: 10px !important;
    padding: 11px 12px !important;
    border-radius: 10px !important;
    font-size: 14px !important;
  }

  .im-notify-cart-title {
    font-size: 14px !important;
  }

  .im-notify-cart-detail {
    font-size: 12px !important;
  }

  #messages .msg a.im-notify-cart-link,
  .messages .msg a.im-notify-cart-link,
  .messages-wrapper .msg a.im-notify-cart-link,
  .ajax-message .msg a.im-notify-cart-link,
  .msg-wrapper .msg a.im-notify-cart-link {
    min-height: 32px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
  }
}
