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

/* Hide default WC notices only after JS init, and only in toast mode.
   Cart / checkout / account keep native layout (no .tt-n-toast-mode). */
html.tt-n-ready body.tt-n-toast-mode .woocommerce-notices-wrapper,
html.tt-n-ready body.tt-n-toast-mode .woocommerce-notices-wrapper .woocommerce-message,
html.tt-n-ready body.tt-n-toast-mode .woocommerce-notices-wrapper .woocommerce-info,
html.tt-n-ready body.tt-n-toast-mode .woocommerce-notices-wrapper .woocommerce-error,
html.tt-n-ready body.tt-n-toast-mode .elementor-widget-woocommerce-notices .woocommerce-message,
html.tt-n-ready body.tt-n-toast-mode .elementor-widget-woocommerce-notices .woocommerce-info,
html.tt-n-ready body.tt-n-toast-mode .elementor-widget-woocommerce-notices .woocommerce-error,
html.tt-n-ready body.tt-n-toast-mode .wc-block-store-notices .wc-block-components-notice-banner,
html.tt-n-ready 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: 320px;
}

.tt-n-toast {
  background: #fff;
  color: #1b1b1b;
  font-size: 13px;
  line-height: 1.4;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  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: 320px;
  border-left: 3px solid #4caf50;
}

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

.tt-n-toast-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  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.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;
}

.tt-n-close {
  background: none;
  border: none;
  color: #999;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 10px;
  margin-left: auto;
  float: right;
}

.tt-n-close:hover {
  color: #333;
}

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

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

@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;
  }
}
