/* SCARLETT.CZ – SYSTÉMOVÉ HLÁŠKY SHOPTETU V1
 * („Položka košíku byla odebrána.“, „Produkt byl přidán do košíku“, chyby formulářů …)
 * Místo široké zelené lišty přes celou šířku: moderní plovoucí karta
 * – PC: vpravo nahoře, mobil: dole nad spodní lištou.
 * Struktura Shoptetu: .messages > .msg.msg-{success|error|warning|info} > .container > span
 */

.messages {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  width: auto !important;
  max-width: min(420px, calc(100vw - 40px)) !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  z-index: 100001 !important;
  pointer-events: none;
  display: flex !important;
  flex-direction: column;
  gap: 10px;
}

.messages .msg {
  pointer-events: auto;
  position: relative !important;
  display: block !important;
  width: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 14px 18px 14px 58px !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: #FFFFFF !important;
  color: #2A2A2A !important;
  box-shadow: 0 14px 38px rgba(30, 40, 35, .18), 0 2px 6px rgba(30, 40, 35, .08) !important;
  font-family: var(--sc-font-body, "Nunito Sans", Arial, sans-serif) !important;
  font-size: 14.5px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  text-align: left !important;
  overflow: hidden;
  animation: scMsgIn .45s cubic-bezier(.2, .9, .25, 1.05) both;
  --sc-msg-c: var(--sc-green, #4E6352);
  --sc-msg-bg: rgba(78, 99, 82, .12);
}

/* barevný proužek vlevo */
.messages .msg::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--sc-msg-c);
}

/* ikona v kroužku */
.messages .msg::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border-radius: 50%;
  background-color: var(--sc-msg-bg);
  background-image: var(--sc-msg-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

.messages .msg .container {
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.messages .msg span { color: inherit !important; }

/* odkaz „Zpět“ (vrácení akce) */
.messages .msg .cancel-action {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--sc-msg-bg);
  color: var(--sc-msg-c) !important;
  font-weight: 800;
  font-size: 13px;
  text-decoration: none !important;
  white-space: nowrap;
}
.messages .msg .cancel-action:hover { filter: brightness(.95); text-decoration: underline !important; }
.messages .msg a:not(.cancel-action) { color: var(--sc-msg-c) !important; text-decoration: underline !important; }

/* ---------- typy ---------- */
.messages .msg-success {
  --sc-msg-c: var(--sc-green, #4E6352);
  --sc-msg-bg: rgba(78, 99, 82, .13);
  --sc-msg-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234E6352' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.messages .msg-error,
.messages .msg-danger {
  --sc-msg-c: var(--sc-red, #C8232B);
  --sc-msg-bg: rgba(200, 35, 43, .11);
  --sc-msg-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C8232B' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E");
}
.messages .msg-warning,
.messages .msg-alert {
  --sc-msg-c: #B7791F;
  --sc-msg-bg: rgba(214, 158, 46, .16);
  --sc-msg-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B7791F' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 6v8M12 18.5v.5'/%3E%3C/svg%3E");
}
.messages .msg-info,
.messages .msg-notice {
  --sc-msg-c: #3B6E8F;
  --sc-msg-bg: rgba(59, 110, 143, .12);
  --sc-msg-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233B6E8F' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 11v7M12 6v.5'/%3E%3C/svg%3E");
}

@keyframes scMsgIn {
  from { opacity: 0; transform: translateX(24px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ---------- mobil: dole, přes celou šířku s okraji ---------- */
@media (max-width: 767px) {
  .messages {
    top: auto !important;
    bottom: 16px !important;
    left: 12px !important;
    right: 12px !important;
    max-width: none !important;
  }
  /* na detailu produktu je dole lišta s cenou a tlačítkem → hláška nad ní */
  body.sc-has-detail-bar .messages { bottom: 92px !important; }
  .messages .msg {
    padding: 13px 14px 13px 54px !important;
    font-size: 14px !important;
    border-radius: 14px !important;
  }
  .messages .msg::before { left: 13px; }
  @keyframes scMsgIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .messages .msg { animation: none; }
}
