/* =========================================================
   WooCommerce Toast Notices — CSS  (v2)
   Auto-hide 7s · pause σε hover/focus · κουμπί κλεισίματος (×)
   Καλύπτει classic (.woocommerce-*) & block (.wc-block-*) notices

   Τοποθέτηση: Elementor -> Site Settings -> Custom CSS
   Παραμετροποίηση: άλλαξε μόνο τις μεταβλητές στο :root
   ========================================================= */

:root {
  --wc-toast-yellow:  #F5C518;   /* κίτρινο brand (info) */
  --wc-toast-green:   #14C24A;   /* πράσινο (success / add to cart) */
  --wc-toast-red:     #E5342A;   /* errors / warnings */
  --wc-toast-ink:     #121212;   /* μαύρο κείμενο / border */
  --wc-toast-surface: #FFFFFF;   /* φόντο toast */

  --wc-toast-radius:  5px;
  --wc-toast-border:  0px;
  --wc-toast-gap:     10px;      /* απόσταση μεταξύ πολλών toasts */
  --wc-toast-width:   380px;
  --wc-toast-offset:  20px;      /* απόσταση από τις άκρες της οθόνης */
  --wc-toast-shadow:  6px 6px 0 rgba(18, 18, 18, .12);
}

/* 1. Σταθερό container — τα toasts «επιπλέουν» πάνω δεξιά, σταθερό πλάτος, σωστό stacking */
#wc-toast-container {
  position: fixed;
  bottom: var(--wc-toast-offset);
  right: var(--wc-toast-offset);
  z-index: 99999;
  width: min(var(--wc-toast-width), calc(100vw - 2 * var(--wc-toast-offset)));
  display: flex;
  flex-direction: column;
  align-items: stretch;          /* -> κάθε toast παίρνει όλο το πλάτος */
  gap: var(--wc-toast-gap);
  margin: 0;
  padding: 0;
  pointer-events: none;          /* τα clicks περνούν, εκτός από τα ίδια τα toasts */
}
#wc-toast-container .wc-toast { pointer-events: auto; }

/* 2. Βασικό look του toast (floating & inline) */
.wc-toast {
  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 18px 46px 22px 22px !important;   /* δεξιά χώρος για το × */
  background: var(--wc-toast-surface) !important;
  color: var(--wc-toast-ink) !important;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  list-style: none !important;
  border: var(--wc-toast-border) solid var(--wc-toast-ink) !important;
  border-left-width: 8px !important;         /* χρωματιστό accent αριστερά */
  border-radius: var(--wc-toast-radius) !important;
  box-shadow: none;
  transition: opacity .35s ease, transform .35s ease;
  animation: wc-toast-in .35s cubic-bezier(.16, 1, .3, 1) both;
}

.wc-toast::before { display: none !important; } /* κρύβει το classic check icon */
.wc-toast > svg   { display: none !important; } /* κρύβει το default block SVG icon */

/* Χρώμα accent ανά τύπο */
.woocommerce-message.wc-toast,
.wc-block-components-notice-banner.is-success.wc-toast { border-left-color: var(--wc-toast-green)  !important; }
.woocommerce-info.wc-toast,
.wc-block-components-notice-banner.is-info.wc-toast    { border-left-color: var(--wc-toast-yellow) !important; }
.woocommerce-error.wc-toast,
.wc-block-components-notice-banner.is-error.wc-toast,
.wc-block-components-notice-banner.is-warning.wc-toast { border-left-color: var(--wc-toast-red)    !important; }

/* Κείμενο block μηνύματος */
.wc-toast .wc-block-components-notice-banner__content { margin: 0; font-weight: 600; }

/* 3. «View cart» link (.wc-forward) σαν mini μαύρο κουμπί */
.wc-toast a.wc-forward,
.wc-toast a.button.wc-forward {
  display: inline-block;
  margin-top: 12px;
  padding: 9px 16px !important;
  background: var(--wc-toast-ink) !important;
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  border: none !important;
  border-radius: 10px !important;
  transition: transform .15s ease, opacity .15s ease;
}
.wc-toast a.wc-forward:hover { transform: translateY(-1px); opacity: .9; }

/* 4. Κουμπί κλεισίματος (×) — hardened ώστε να ΜΗΝ το «σβήνει» το theme */
.wc-toast__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 30px !important;
  height: 30px !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  margin: 0 !important;
  color: var(--wc-toast-ink) !important;   /* <- το χρώμα του × (ήταν λευκό λόγω theme) */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 8px !important;
  line-height: 0 !important;
  cursor: pointer;
  transition: background .15s ease;
}
.wc-toast__close:hover { background: rgba(18, 18, 18, .08) !important; }
.wc-toast__close:focus-visible { outline: 2px solid var(--wc-toast-ink); outline-offset: 2px; }
.wc-toast__close svg { display: block !important; width: 20px; height: 20px; }
.wc-toast__close svg path { stroke: currentColor; }

/* 5. Progress bar (μετρά τα 7'') — full width από την αρχή */
.wc-toast__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: 5px;
  transform-origin: left center;
  background: var(--wc-toast-yellow);
  animation: wc-toast-progress var(--wc-toast-duration, 7000ms) linear forwards;
}
.wc-toast.is-paused .wc-toast__bar { animation-play-state: paused; } /* pause σε hover/focus */

.woocommerce-message.wc-toast .wc-toast__bar,
.wc-block-components-notice-banner.is-success.wc-toast .wc-toast__bar { background: var(--wc-toast-green); }

/* 6. Έξοδος (fade-out) — animation:none για να δουλέψει το transition */
.wc-toast.is-auto-hiding {
  opacity: 0;
  transform: translateX(16px);
  pointer-events: none;
  animation: none !important;
}

.woocommerce a.button {
    background: #000;
    color: #F2F0EF;
}

.woocommerce a.button:hover {
    background: #14C24A;
    color: #000;
}

/* 7. Animations */
@keyframes wc-toast-in {
  from { opacity: 0; transform: translateX(16px) scale(.98); }
  to   { opacity: 1; transform: translateX(0)     scale(1); }
}
@keyframes wc-toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* 8. Mobile — full width κάτω */
@media (max-width: 600px) {
  #wc-toast-container {
    top: auto;
    bottom: var(--wc-toast-offset);
    left: var(--wc-toast-offset);
    right: var(--wc-toast-offset);
    width: auto;
  }
}

/* 9. Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .wc-toast,
  .wc-toast__bar,
  .wc-toast a.wc-forward {
    animation: none !important;
    transition: none !important;
  }
}</style>
