/*
  WC Mods – Notifications
  Toast-style bottom notifications built from Woo notices.
*/

/* Disable native Woo notice output completely when this submodule is active. */
.woocommerce-notices-wrapper,
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
  display: none !important;
}

.se-wc-notify-stack {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 999999;
  pointer-events: none;
  padding: 0 16px;
}

.se-wc-notify-stack::before {
  content: "";
  display: block;
  height: env(safe-area-inset-bottom);
}

.se-wc-notify {
  --se-lg-container-radius: 18px;
  --se-lg-container-bg: #ffffff;
  --se-lg-container-border: #dbe4ea;
  --se-wc-notify-text: #12202c;
  --se-wc-notify-title: #183244;
  --se-wc-notify-progress: rgba(24, 50, 68, 0.88);
  --se-wc-notify-icon-bg: #f4f7f8;
  --se-wc-notify-icon-border: #d8e0e5;
  --se-wc-notify-icon: var(--se-wc-notify-title);

  width: min(1472px, 100%);
  margin: 0 auto;
  pointer-events: auto;

  position: relative;
  overflow: hidden;

  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 16px;

  padding: 18px 20px 16px;
  line-height: 1.35;
  color: var(--se-wc-notify-text, #2b2b2b) !important;
  outline: none;

  transform: translateY(18px);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

.se-wc-notify__progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 4px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--se-wc-notify-progress, #183244) 76%, #ffffff 24%),
    var(--se-wc-notify-progress, #183244)
  );
  transform-origin: left center;
  transform: scaleX(1);
}

.se-wc-notify.se-wc-notify--timed .se-wc-notify__progress {
  animation: se-wc-notify-countdown var(--se-wc-notify-duration, 5000ms) linear forwards;
}

.se-wc-notify + .se-wc-notify {
  margin-top: 10px;
}

.se-wc-notify.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.se-wc-notify.is-hiding {
  transform: translateY(18px);
  opacity: 0;
}

.se-wc-notify__icon {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--se-wc-notify-icon-bg, rgba(255, 255, 255, 0.34));
  border: 1px solid var(--se-wc-notify-icon-border, rgba(255, 255, 255, 0.42));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 12px 28px rgba(15, 23, 32, 0.08);
}

.se-wc-notify__icon svg {
  width: 24px;
  height: 24px;
  fill: var(--se-wc-notify-icon, rgba(0, 0, 0, 0.65));
}

.se-wc-notify__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.se-wc-notify__actions {
  display: inline-flex;
  align-items: center;
  align-self: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  justify-self: end;
}

.se-wc-notify__title {
  font-family: var(--e-global-typography-accent-font-family, inherit);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 14px;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--se-wc-notify-title, inherit);
}

.se-wc-notify__content {
  font-size: 15px;
  opacity: 0.96;
  min-width: 0;
}

.se-wc-notify__content > :first-child {
  margin-top: 0;
}

.se-wc-notify__content > :last-child {
  margin-bottom: 0;
}

.se-wc-notify__content a {
  color: inherit;
  text-decoration: underline;
}

.se-wc-notify__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  vertical-align: middle;
  margin: 0;
}

/* Make sure the label stays visible above glass overlays */
.se-wc-notify__action.glassy-btn1 > span {
  color: #0c0d0e !important;
  -webkit-text-fill-color: #0c0d0e !important;
}

.se-wc-notify__close {
  flex: 0 0 auto;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 999px !important;
  line-height: 0 !important;
  cursor: pointer;
}

.se-wc-notify__close svg {
  width: 16px;
  height: 16px;
  fill: rgba(12, 13, 14, 0.84);
}

.se-wc-notify__close:hover svg,
.se-wc-notify__close:focus-visible svg {
  fill: rgba(12, 13, 14, 1);
}

.se-wc-notify__close:focus-visible {
  outline: 2px solid rgba(12, 13, 14, 0.18) !important;
  outline-offset: 2px;
}

/* Type palettes */
.se-wc-notify[data-type="success"],
.se-wc-notify[data-type="message"] {
  --se-lg-container-bg: #eafaf1;
  --se-lg-container-border: #8dd6aa;
  --se-wc-notify-progress: #2f7a22;
  --se-wc-notify-icon-bg: #dff6e9;
  --se-wc-notify-icon-border: #a8e3bd;
  --se-wc-notify-icon: #2F7A22;
  --se-wc-notify-title: #2F7A22;
  --se-wc-notify-text: #11341a;
}

.se-wc-notify[data-type="warning"],
.se-wc-notify[data-type="notice"] {
  --se-lg-container-bg: #fff7df;
  --se-lg-container-border: #e6c86a;
  --se-wc-notify-progress: #8b6a00;
  --se-wc-notify-icon-bg: #fff0bd;
  --se-wc-notify-icon-border: #ebd581;
  --se-wc-notify-icon: #8B6A00;
  --se-wc-notify-title: #8B6A00;
  --se-wc-notify-text: #3c2f09;
}

.se-wc-notify[data-type="error"] {
  --se-lg-container-bg: #fdecea;
  --se-lg-container-border: #e9a5a0;
  --se-wc-notify-progress: #b22a2a;
  --se-wc-notify-icon-bg: #fbe0dd;
  --se-wc-notify-icon-border: #efbbb7;
  --se-wc-notify-icon: #B22A2A;
  --se-wc-notify-title: #B22A2A;
  --se-wc-notify-text: #3d1313;
}

.se-wc-notify[data-type="info"] {
  --se-lg-container-bg: #eaf2fe;
  --se-lg-container-border: #9fc4f4;
  --se-wc-notify-progress: #1c6fb8;
  --se-wc-notify-icon-bg: #deebfc;
  --se-wc-notify-icon-border: #b8d4f6;
  --se-wc-notify-icon: #1C6FB8;
  --se-wc-notify-title: #1C6FB8;
  --se-wc-notify-text: #122f51;
}

@keyframes se-wc-notify-countdown {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

/* Breakpoints observed across the plugin: 1200 / 768 / 480 */
@media (max-width: 1200px) {
  .se-wc-notify-stack { padding: 0 14px; }
}

@media (max-width: 768px) {
  .se-wc-notify-stack { bottom: 12px; padding: 0 12px; }
  .se-wc-notify {
    padding: 16px 14px 14px;
    grid-template-columns: 48px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 12px;
  }
  .se-wc-notify__icon { width: 48px; height: 48px; }
  .se-wc-notify__icon svg { width: 22px; height: 22px; }
  .se-wc-notify__actions {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .se-wc-notify { padding: 15px 12px 12px; }
  .se-wc-notify__content { font-size: 14px; }
  .se-wc-notify__action {
    width: 100%;
  }
  .se-wc-notify__close {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }
}
