:root {
  --dp-cart-green: #a6ce39;
  --dp-cart-green-dark: #789d18;
  --dp-cart-ink: #17221b;
  --dp-cart-muted: #66736b;
  --dp-cart-white: #fff;
}

.dp-cart-toast {
  position: fixed;
  z-index: 999999;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 30px;
  width: min(680px, calc(100vw - 36px));
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(23, 34, 27, 0.12);
  border-left: 4px solid var(--dp-cart-green);
  border-radius: 14px;
  background: var(--dp-cart-white);
  box-shadow: 0 18px 48px rgba(23, 34, 27, 0.2);
  color: var(--dp-cart-ink);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, calc(100% + 48px));
  transition: opacity 180ms ease, transform 220ms ease, visibility 220ms ease;
}

.dp-cart-toast.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.dp-cart-toast__icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--dp-cart-green);
  color: var(--dp-cart-white);
}

.dp-cart-toast__icon svg {
  display: block;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dp-cart-toast__message {
  min-width: 0;
  color: var(--dp-cart-ink);
  font-weight: 700;
}

.dp-cart-toast__link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 9px;
  background: var(--dp-cart-green);
  color: var(--dp-cart-white) !important;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
}

.dp-cart-toast__link:hover,
.dp-cart-toast__link:focus-visible {
  background: var(--dp-cart-green-dark);
  color: var(--dp-cart-white) !important;
}

.dp-cart-toast__link:focus-visible,
.dp-cart-toast__close:focus-visible {
  outline: 3px solid rgba(166, 206, 57, 0.32);
  outline-offset: 2px;
}

.dp-cart-toast__close {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--dp-cart-muted);
  font: inherit;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.dp-cart-toast__close:hover {
  background: #f1f4ef;
  color: var(--dp-cart-ink);
}

.add_to_cart_button.dp-cart-feedback--pending {
  cursor: wait;
}

.dp-cart-feedback--success,
.dp-cart-feedback--success:hover,
.dp-cart-feedback--success:focus {
  border-color: var(--dp-cart-green) !important;
  background: var(--dp-cart-green) !important;
  color: var(--dp-cart-white) !important;
}

.dp-cart-feedback--success .dp-cart-feedback__success-label {
  display: inline-flex !important;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--dp-cart-white) !important;
}

.dp-cart-feedback--success .dp-cart-feedback__success-label svg {
  display: block !important;
  width: 19px !important;
  height: 19px !important;
  flex: 0 0 19px;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dp-cart-feedback--success.dp-cart-feedback--compact .dp-cart-feedback__success-text {
  display: none !important;
}

/* The toast already provides the cart action, so product cards stay compact. */
body.woocommerce ul.products li.product .image-wrap > a.added_to_cart.wc-forward,
body.woocommerce ul.products li.product a.added_to_cart.wc-forward {
  display: none !important;
}

/*
 * OceanWP hides the original loop button after WooCommerce adds `.added`.
 * Related products live inside a single-product page, so keep that primary
 * button visible while the separate native `added_to_cart` link stays hidden.
 */
body.single-product.woocommerce div.product .related.products ul.products li.product .image-wrap > a.button.add_to_cart_button,
body.single-product.woocommerce div.product .related.products ul.products li.product .image-wrap > a.button.add_to_cart_button.added,
body.single-product.woocommerce div.product .related.products ul.products li.product .image-wrap > a.button.add_to_cart_button.loading,
body.single-product.woocommerce div.product .related.products ul.products li.product .image-wrap > a.button.add_to_cart_button.dp-cart-feedback--success {
  display: flex !important;
  width: 100%;
  align-items: center;
  justify-content: center;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none;
}

/* Keep a light secondary cart link below the main single-product controls. */
body.single-product.woocommerce div.product div.summary form.cart a.added_to_cart.wc-forward,
body.single-product.woocommerce div.product div.summary a.added_to_cart.wc-forward {
  grid-column: 1 / -1;
  display: inline-flex !important;
  width: auto;
  align-items: center;
  justify-content: center;
  justify-self: start;
  gap: 7px;
  margin: 3px 0 0 !important;
  padding: 5px 1px;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  color: var(--dp-cart-green-dark) !important;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: 0;
  text-decoration: none !important;
  text-transform: none;
  box-shadow: none;
}

body.single-product.woocommerce div.product div.summary form.cart a.added_to_cart.wc-forward::after,
body.single-product.woocommerce div.product div.summary a.added_to_cart.wc-forward::after {
  content: "→";
  color: inherit;
  font-size: 17px;
  line-height: 1;
  transition: transform 150ms ease;
}

body.single-product.woocommerce div.product div.summary form.cart a.added_to_cart.wc-forward:hover,
body.single-product.woocommerce div.product div.summary form.cart a.added_to_cart.wc-forward:focus-visible,
body.single-product.woocommerce div.product div.summary a.added_to_cart.wc-forward:hover,
body.single-product.woocommerce div.product div.summary a.added_to_cart.wc-forward:focus-visible {
  border-color: transparent;
  background: transparent !important;
  color: var(--dp-cart-ink) !important;
  text-decoration: none !important;
}

body.single-product.woocommerce div.product div.summary form.cart a.added_to_cart.wc-forward:hover::after,
body.single-product.woocommerce div.product div.summary form.cart a.added_to_cart.wc-forward:focus-visible::after,
body.single-product.woocommerce div.product div.summary a.added_to_cart.wc-forward:hover::after,
body.single-product.woocommerce div.product div.summary a.added_to_cart.wc-forward:focus-visible::after {
  transform: translateX(3px);
}

body.single-product.woocommerce div.product div.summary form.cart a.added_to_cart.wc-forward:focus-visible,
body.single-product.woocommerce div.product div.summary a.added_to_cart.wc-forward:focus-visible {
  outline: 3px solid rgba(166, 206, 57, 0.28);
  outline-offset: 2px;
}

.dp-cart-count-pulse {
  animation: dp-cart-count-pulse 620ms ease-out;
}

@keyframes dp-cart-count-pulse {
  0%, 100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.14);
  }
}

@media (max-width: 767px) {
  .dp-cart-toast {
    bottom: max(12px, env(safe-area-inset-bottom));
    grid-template-columns: 30px minmax(0, 1fr) 28px;
    grid-template-areas:
      "icon message close"
      ". action action";
    width: calc(100vw - 20px);
    gap: 5px 9px;
    padding: 10px 10px 9px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.3;
  }

  .dp-cart-toast__icon {
    grid-area: icon;
    width: 30px;
    height: 30px;
  }

  .dp-cart-toast__icon svg {
    width: 17px;
    height: 17px;
  }

  .dp-cart-toast__message {
    grid-area: message;
  }

  .dp-cart-toast__link {
    grid-area: action;
    width: auto;
    min-height: 30px;
    justify-self: start;
    margin: 0;
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 12.5px;
  }

  .dp-cart-toast__close {
    grid-area: close;
    width: 28px;
    height: 28px;
    align-self: start;
    justify-self: end;
    font-size: 22px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .dp-cart-toast,
  .dp-cart-count-pulse {
    animation: none !important;
    transition: none !important;
  }
}
