/* =========================================================
   The Revera Life — Add-to-Cart Toast
   Customize via the variables below.
   ========================================================= */
:root{
  /* Colours */
  --trl-bg:#ffffff;
  --trl-text:#1c1a17;
  --trl-muted:#8a8378;
  --trl-brand:#C4622D;            /* View Cart button */
  --trl-brand-text:#ffffff;
  --trl-success:#2e9e5b;          /* success check */
  --trl-success-bg:#e8f6ee;
  --trl-error:#d6392f;            /* error icon */
  --trl-error-bg:#fdecea;
  --trl-border:rgba(28,26,23,.08);
  --trl-shadow:0 14px 38px rgba(28,26,23,.14),0 3px 10px rgba(28,26,23,.05);

  /* Shape & spacing */
  --trl-radius:16px;
  --trl-pad:16px;
  --trl-width:360px;

  /* Position (desktop) */
  --trl-top:96px;
  --trl-gap:22px;

  /* Type */
  --trl-title-size:14px;
  --trl-name-size:15px;
  --trl-meta-size:13px;

  /* Motion */
  --trl-speed:.45s;

  --trl-z:99999;
}

.trl-toast-wrap{
  position:fixed;top:var(--trl-top);right:var(--trl-gap);
  z-index:var(--trl-z);display:flex;flex-direction:column;gap:12px;
  pointer-events:none;max-width:calc(100vw - (var(--trl-gap) * 2));
}

.trl-toast{
  pointer-events:auto;box-sizing:border-box;
  width:var(--trl-width);max-width:100%;
  background:var(--trl-bg);color:var(--trl-text);
  border:1px solid var(--trl-border);border-radius:var(--trl-radius);
  box-shadow:var(--trl-shadow);padding:var(--trl-pad);position:relative;
  opacity:0;transform:translateX(28px);
  transition:opacity var(--trl-speed) ease,
             transform var(--trl-speed) cubic-bezier(.22,.61,.36,1);
  font-family:inherit;
}
.trl-toast.is-visible{opacity:1;transform:translateX(0);}
.trl-toast.is-leaving{opacity:0;transform:translateX(28px);}

.trl-toast__head{display:flex;align-items:center;gap:10px;}
.trl-toast__icon{
  flex:0 0 auto;width:24px;height:24px;border-radius:50%;
  background:var(--trl-success-bg);color:var(--trl-success);
  display:flex;align-items:center;justify-content:center;
}
.trl-toast__icon svg{width:14px;height:14px;display:block;}
.trl-toast__icon.is-error{background:var(--trl-error-bg);color:var(--trl-error);}

.trl-toast__title{
  flex:1 1 auto;font-size:var(--trl-title-size);font-weight:600;
  letter-spacing:.01em;line-height:1.2;
}
.trl-toast__close{
  flex:0 0 auto;appearance:none;-webkit-appearance:none;background:transparent;
  border:0;cursor:pointer;width:26px;height:26px;margin:-4px -4px -4px 0;
  border-radius:8px;color:var(--trl-muted);font-size:20px;line-height:1;
  display:flex;align-items:center;justify-content:center;
  transition:background .2s ease,color .2s ease;
}
.trl-toast__close:hover{background:rgba(28,26,23,.06);color:var(--trl-text);}

.trl-toast__name{
  margin-top:8px;font-size:var(--trl-name-size);font-weight:600;line-height:1.3;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.trl-toast__meta{margin-top:3px;font-size:var(--trl-meta-size);color:var(--trl-muted);line-height:1.4;}
.trl-toast__meta .trl-amount,
.trl-toast__meta .woocommerce-Price-amount{color:var(--trl-text);font-weight:600;}

.trl-toast__cta{
  display:inline-flex;align-items:center;gap:6px;margin-top:14px;
  padding:9px 16px;border-radius:10px;line-height:1;
  background:var(--trl-brand);color:var(--trl-brand-text)!important;
  text-decoration:none!important;font-size:13px;font-weight:600;
  transition:transform .15s ease,filter .2s ease;
}
.trl-toast__cta:hover{filter:brightness(1.06);transform:translateY(-1px);color:var(--trl-brand-text)!important;}
.trl-toast__cta:active{transform:translateY(0);}
.trl-toast__cta svg{width:14px;height:14px;}

@keyframes trl-bump{0%{transform:scale(1);}30%{transform:scale(1.03);}100%{transform:scale(1);}}
.trl-toast.is-bumped{animation:trl-bump .4s ease;}

/* Mobile: full-width floating card at the bottom */
@media (max-width:600px){
  .trl-toast-wrap{top:auto;bottom:16px;left:12px;right:12px;max-width:none;align-items:stretch;}
  .trl-toast{width:100%;transform:translateY(28px);}
  .trl-toast.is-visible{transform:translateY(0);}
  .trl-toast.is-leaving{transform:translateY(28px);}
  @keyframes trl-bump{0%{transform:translateY(0) scale(1);}30%{transform:translateY(0) scale(1.02);}100%{transform:translateY(0) scale(1);}}
}

@media (prefers-reduced-motion:reduce){
  .trl-toast,.trl-toast.is-visible,.trl-toast.is-leaving{transition:opacity .2s ease;transform:none;}
  .trl-toast.is-bumped{animation:none;}
}

/* Hide default WooCommerce "added to cart" success + cart-related error notices
   (both carry a View-cart link). JS reads their text first, then shows the toast. */
body:not(.woocommerce-cart):not(.woocommerce-checkout) .woocommerce-message:has(a.wc-forward),
body:not(.woocommerce-cart):not(.woocommerce-checkout) .woocommerce-error:has(a.wc-forward){
  display:none!important;
}