/* ToneTrade Woo notice toasts — Therioderm woo-notice-tooltips port */

/* Hide native WC notices in toast mode as soon as body class is present
   (server-rendered) — do not wait for html.tt-n-ready or notices flash
   under the sticky header before JS harvests them into toasts.
   Checkout / account keep native layout (no .tt-n-toast-mode). */
body.tt-n-toast-mode .woocommerce-notices-wrapper,
body.tt-n-toast-mode .woocommerce-notices-wrapper .woocommerce-message,
body.tt-n-toast-mode .woocommerce-notices-wrapper .woocommerce-info,
body.tt-n-toast-mode .woocommerce-notices-wrapper .woocommerce-error,
body.tt-n-toast-mode .elementor-widget-woocommerce-notices .woocommerce-message,
body.tt-n-toast-mode .elementor-widget-woocommerce-notices .woocommerce-info,
body.tt-n-toast-mode .elementor-widget-woocommerce-notices .woocommerce-error,
body.tt-n-toast-mode .wc-block-store-notices .wc-block-components-notice-banner,
body.tt-n-toast-mode .woocommerce-store-notices .wc-block-components-notice-banner {
  display: none !important;
}

.tt-n-toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10050;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  max-width: min(340px, calc(100vw - 24px));
}

.tt-n-toast {
  background: #fff;
  color: #1b1b1b;
  font-size: 13px;
  line-height: 1.4;
  padding: 12px 14px 12px 14px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(24px) scale(0.94);
  animation: ttNFadeIn 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  font-family: inherit;
  word-break: break-word;
  max-width: min(340px, calc(100vw - 24px));
  border-left: 3px solid #4caf50;
}

.tt-n-toast-product {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding-right: 22px;
}

.tt-n-toast-thumb {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex: 0 0 28px;
}

.tt-n-toast-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: #1b1b1b;
}

.tt-n-toast-text {
  display: block;
  margin: 0 0 8px;
  padding-right: 18px;
  color: #334155;
  font-size: 13px;
}

.tt-n-toast-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.tt-n-toast a.tt-n-pill,
.tt-n-toast .tt-n-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 24px !important;
  min-height: 24px !important;
  padding: 0 11px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #1b1b1b !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  opacity: 1 !important;
}

.tt-n-toast a.tt-n-pill:hover,
.tt-n-toast .tt-n-pill:hover {
  border-color: var(--tt-chrome-secondary, #ff5a00) !important;
  text-decoration: none !important;
}

.tt-n-toast a.tt-n-pill--primary,
.tt-n-toast .tt-n-pill--primary {
  background: var(--tt-chrome-secondary, #ff5a00) !important;
  border-color: var(--tt-chrome-secondary, #ff5a00) !important;
  color: #1b1b1b !important;
}

.tt-n-toast.tt-n-error {
  border-left-color: #f44336;
}

.tt-n-toast.tt-n-info {
  border-left-color: #2196f3;
}

.tt-n-toast.tt-n-fade-out {
  animation: ttNFadeOut 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

/* Beat Elementor kit `button { background: primary }` — icon-only X, no slab */
html body .tt-n-toast .tt-n-close,
html body .tt-n-toast button.tt-n-close {
  all: unset;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  float: right !important;
  margin: -2px 0 0 10px !important;
  padding: 2px !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  color: #8a8a8a !important;
  font-family: inherit !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  opacity: 0.85;
  vertical-align: top;
}

html body .tt-n-toast .tt-n-close:hover,
html body .tt-n-toast button.tt-n-close:hover,
html body .tt-n-toast .tt-n-close:focus-visible,
html body .tt-n-toast button.tt-n-close:focus-visible {
  color: var(--e-global-color-primary, #1b1b1b) !important;
  background: transparent !important;
  background-color: color-mix(in srgb, var(--e-global-color-primary, #1b1b1b) 6%, transparent) !important;
  opacity: 1;
  outline: none !important;
}

html body .tt-n-toast .tt-n-close:focus:not(:focus-visible),
html body .tt-n-toast button.tt-n-close:focus:not(:focus-visible) {
  outline: none !important;
}

.tt-n-toast a {
  color: var(--tt-chrome-secondary, #ff5a00);
  text-decoration: none;
  font-weight: 600;
  margin-left: 0;
  font-size: 12px;
  opacity: 0.9;
}

.tt-n-toast a:hover {
  opacity: 1;
  text-decoration: underline;
}

@media (max-width: 480px) {
  .tt-n-toast-wrap {
    left: 12px;
    right: 12px;
    bottom: 16px;
    max-width: none;
  }
  .tt-n-toast {
    max-width: none;
  }
}

@keyframes ttNFadeIn {
  from {
    opacity: 0;
    transform: translateX(24px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes ttNFadeOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(24px) scale(0.94);
  }
}

/* Checkout field tooltips — additive only; native notices stay visible */
body.tt-n-checkout-tooltips.woocommerce-checkout .form-row.woocommerce-invalid .input-text,
body.tt-n-checkout-tooltips.woocommerce-checkout .form-row.woocommerce-invalid select,
body.tt-n-checkout-tooltips.woocommerce-checkout .form-row.woocommerce-invalid .select2-container--default .select2-selection--single {
  border-color: #f44336 !important;
  box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.15) !important;
}

.tt-n-field-tooltip {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #f44336;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  padding: 6px 12px;
  border-radius: 6px;
  z-index: 100;
  opacity: 0;
  transform: translateY(-4px);
  animation: ttNTooltipIn 0.25s ease forwards;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
  pointer-events: none;
  max-width: 280px;
  white-space: normal;
}

.tt-n-field-tooltip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 16px;
  border: 5px solid transparent;
  border-bottom-color: #f44336;
}

@keyframes ttNTooltipIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.tt-n-checkout-tooltips.woocommerce-checkout .form-row {
  position: relative;
}

body.tt-n-checkout-tooltips.woocommerce-checkout .form-row.tt-n-shake {
  animation: ttNShake 0.4s ease;
}

@keyframes ttNShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-4px);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

/* Clear sticky footer + safe area */
@media (max-width: 1024px) {
  body.tt-has-mobile-sticky .tt-n-toast-wrap {
    bottom: calc(var(--tt-chrome-sticky-h, 64px) + 16px + env(safe-area-inset-bottom, 0px));
    right: 20px;
  }
}

@media (max-width: 767px) {
  .tt-n-toast-wrap {
    bottom: 65px;
    right: 12px;
    left: auto;
    max-width: min(320px, calc(100vw - 24px));
  }
  body.tt-has-mobile-sticky .tt-n-toast-wrap {
    bottom: calc(var(--tt-chrome-sticky-h, 64px) + 12px + env(safe-area-inset-bottom, 0px));
  }
  .tt-n-toast {
    font-size: 12px;
    padding: 8px 12px;
    max-width: min(320px, calc(100vw - 24px));
  }
  .tt-n-toast-thumb {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }
  .tt-n-field-tooltip {
    font-size: 11px;
    max-width: 220px;
  }
}
