/* WINE4YOU – systémové hlášky Shoptetu ?v=1
   Jen flash notifikace (.message.fixed-message) a serverové hlášky
   v kontejneru .messages. Nezasahuje do hlášek u polí pokladny
   ani do „Záznamy nebyly nalezeny…“ ve výpisu. */

.message.fixed-message {
  --hl-ink: var(--w4y-ink, #3a2a26);
  --hl-font: var(--w4y-font, "PT Sans", sans-serif);
  --hl-radius: var(--w4y-r-md, 12px);
  --hl-shadow: var(--w4y-shadow-drop, 0 6px 16px rgba(42, 22, 18, .14));
  --hl-icon: 1.35em;
  --hl-accent: var(--w4y-stock, #1f6b2a);
  --hl-bg: var(--w4y-stock-bg, #e9f5ea);
  --hl-border: rgba(31, 107, 42, .22);
  --hl-mask: var(--hl-mask-check);

  box-sizing: border-box !important;
  position: fixed !important;
  top: var(--w4y-hlaska-top, 3.25rem) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  width: min(28rem, calc(100vw - 1.5rem)) !important;
  max-width: calc(100vw - 1.5rem) !important;
  margin: 0 !important;
  padding: .85rem 1.15rem .85rem .95rem !important;
  z-index: 10001;
  display: flex !important;
  align-items: flex-start;
  gap: .7em;
  border: 1px solid var(--hl-border) !important;
  border-left-width: 3px !important;
  border-left-color: var(--hl-accent) !important;
  border-radius: var(--hl-radius) !important;
  background: var(--hl-bg) !important;
  color: var(--hl-ink) !important;
  font-family: var(--hl-font) !important;
  font-size: .9375rem !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  box-shadow: var(--hl-shadow);
  transform: translateX(-50%);
  pointer-events: auto;
}

.message.fixed-message *,
.message.fixed-message *::before,
.message.fixed-message *::after {
  box-sizing: border-box;
}

.message.fixed-message::before {
  content: "" !important;
  flex: 0 0 var(--hl-icon);
  width: var(--hl-icon);
  height: var(--hl-icon);
  margin-top: .08em;
  background-color: var(--hl-accent) !important;
  background-image: none !important;
  -webkit-mask: var(--hl-mask) center / contain no-repeat;
  mask: var(--hl-mask) center / contain no-repeat;
}

.message.fixed-message > span,
.message.fixed-message span {
  display: block !important;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  font: inherit !important;
  background: none !important;
  border: 0 !important;
}

.message.fixed-message a {
  color: var(--hl-accent) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* úspěch */
.message.fixed-message.success-message {
  --hl-accent: var(--w4y-stock, #1f6b2a);
  --hl-bg: var(--w4y-stock-bg, #e9f5ea);
  --hl-border: rgba(31, 107, 42, .22);
  --hl-mask: var(--hl-mask-check);
}

/* info / notice */
.message.fixed-message.notice-message,
.message.fixed-message.info-message {
  --hl-accent: var(--w4y-red, #6a1315);
  --hl-bg: var(--w4y-cream, #fffaf6);
  --hl-border: rgba(106, 19, 21, .16);
  --hl-mask: var(--hl-mask-info);
}

/* upozornění */
.message.fixed-message.warning-message {
  --hl-accent: var(--w4y-warn, #c46a12);
  --hl-bg: var(--w4y-gold-bg, #fffdf7);
  --hl-border: rgba(201, 162, 74, .45);
  --hl-mask: var(--hl-mask-warn);
}

/* chyba */
.message.fixed-message.error-message {
  --hl-accent: var(--w4y-alert, #8a2a2a);
  --hl-bg: #faf0ee;
  --hl-border: rgba(138, 42, 42, .22);
  --hl-mask: var(--hl-mask-error);
}

/* ikony 24×24 */
.message.fixed-message {
  --hl-mask-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M12 2.5a9.5 9.5 0 1 0 0 19 9.5 9.5 0 0 0 0-19zm-1.1 13.4-3.7-3.7 1.4-1.4 2.3 2.3 4.9-4.9 1.4 1.4-6.3 6.3z'/%3E%3C/svg%3E");
  --hl-mask-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M12 2.5a9.5 9.5 0 1 0 0 19 9.5 9.5 0 0 0 0-19zM11 10h2v7h-2v-7zm0-3.5h2V8.5h-2V6.5z'/%3E%3C/svg%3E");
  --hl-mask-warn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M12 2.5a9.5 9.5 0 1 0 0 19 9.5 9.5 0 0 0 0-19zM11 7h2v7h-2V7zm0 8.5h2V18h-2v-2.5z'/%3E%3C/svg%3E");
  --hl-mask-error: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M12 2.5a9.5 9.5 0 1 0 0 19 9.5 9.5 0 0 0 0-19zM11 7h2v7h-2V7zm0 8.5h2V18h-2v-2.5z'/%3E%3C/svg%3E");
}

/* serverová hláška v .messages (po obnovení stránky) — stejný vzhled, v toku stránky */
.messages > .message:not(.fixed-message) {
  --hl-ink: var(--w4y-ink, #3a2a26);
  --hl-font: var(--w4y-font, "PT Sans", sans-serif);
  --hl-radius: var(--w4y-r-md, 12px);
  --hl-icon: 1.35em;
  --hl-accent: var(--w4y-stock, #1f6b2a);
  --hl-bg: var(--w4y-stock-bg, #e9f5ea);
  --hl-border: rgba(31, 107, 42, .22);
  --hl-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M12 2.5a9.5 9.5 0 1 0 0 19 9.5 9.5 0 0 0 0-19zm-1.1 13.4-3.7-3.7 1.4-1.4 2.3 2.3 4.9-4.9 1.4 1.4-6.3 6.3z'/%3E%3C/svg%3E");
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  gap: .7em;
  width: min(40rem, 100%);
  max-width: 100%;
  margin: 1rem auto !important;
  padding: .85rem 1.15rem .85rem .95rem !important;
  border: 1px solid var(--hl-border) !important;
  border-left-width: 3px !important;
  border-left-color: var(--hl-accent) !important;
  border-radius: var(--hl-radius) !important;
  background: var(--hl-bg) !important;
  color: var(--hl-ink) !important;
  font-family: var(--hl-font) !important;
  font-size: .9375rem !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  box-shadow: var(--w4y-shadow-sm, 0 1px 3px rgba(58, 42, 38, .06));
}
.messages > .message:not(.fixed-message)::before {
  content: "";
  flex: 0 0 var(--hl-icon);
  width: var(--hl-icon);
  height: var(--hl-icon);
  margin-top: .08em;
  background-color: var(--hl-accent);
  -webkit-mask: var(--hl-mask) center / contain no-repeat;
  mask: var(--hl-mask) center / contain no-repeat;
}
.messages > .message.success-message:not(.fixed-message) {
  --hl-accent: var(--w4y-stock, #1f6b2a);
  --hl-bg: var(--w4y-stock-bg, #e9f5ea);
  --hl-border: rgba(31, 107, 42, .22);
}
.messages > .message.notice-message:not(.fixed-message),
.messages > .message.info-message:not(.fixed-message) {
  --hl-accent: var(--w4y-red, #6a1315);
  --hl-bg: var(--w4y-cream, #fffaf6);
  --hl-border: rgba(106, 19, 21, .16);
  --hl-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M12 2.5a9.5 9.5 0 1 0 0 19 9.5 9.5 0 0 0 0-19zM11 10h2v7h-2v-7zm0-3.5h2V8.5h-2V6.5z'/%3E%3C/svg%3E");
}
.messages > .message.warning-message:not(.fixed-message) {
  --hl-accent: var(--w4y-warn, #c46a12);
  --hl-bg: var(--w4y-gold-bg, #fffdf7);
  --hl-border: rgba(201, 162, 74, .45);
  --hl-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M12 2.5a9.5 9.5 0 1 0 0 19 9.5 9.5 0 0 0 0-19zM11 7h2v7h-2V7zm0 8.5h2V18h-2v-2.5z'/%3E%3C/svg%3E");
}
.messages > .message.error-message:not(.fixed-message) {
  --hl-accent: var(--w4y-alert, #8a2a2a);
  --hl-bg: #faf0ee;
  --hl-border: rgba(138, 42, 42, .22);
  --hl-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M12 2.5a9.5 9.5 0 1 0 0 19 9.5 9.5 0 0 0 0-19zM11 7h2v7h-2V7zm0 8.5h2V18h-2v-2.5z'/%3E%3C/svg%3E");
}
.messages > .message:not(.fixed-message) > span,
.messages > .message:not(.fixed-message) > p {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  font: inherit !important;
}

/* hlídání skladu: nechat nativní absolutní umístění v kontejneru */
.watchdog-messages .fixed-message {
  position: absolute !important;
  left: 0 !important;
  right: auto !important;
  top: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  transform: none !important;
}

@media (max-width: 639px) {
  .message.fixed-message,
  .messages > .message:not(.fixed-message) {
    font-size: .9rem !important;
    padding: .8rem 1rem .8rem .85rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .message.fixed-message {
    transition: none;
  }
}

@media print {
  .message.fixed-message {
    display: none !important;
  }
}
