/* ==========================================================
   DG Added to Cart Popup
   ========================================================== */

/* 1. Ocultar el "Ver carrito" nativo que WooCommerce inyecta */
a.added_to_cart.wc-forward {
	display: none !important;
}

/* 2. Quitar el ícono "\e017" (check de la fuente WooCommerce) */
.woocommerce a.button.added::after,
.woocommerce button.button.added::after,
a.add_to_cart_button.added::after,
a.ajax_add_to_cart.added::after,
.elementor-button.added::after {
	content: none !important;
	display: none !important;
}

/* 3. Popup */
.dg-atc {
	--dg-atc-primary: #0d5c2c;
	--dg-atc-primary-hover: #0a4822;
	--dg-atc-accent: #5a9e58;
	--dg-atc-text: #1c2a1f;
	--dg-atc-muted: #5d6b60;
	--dg-atc-surface: #ffffff;
	--dg-atc-line: #e6ece7;
	--dg-atc-offset: 24px;
	--dg-atc-duration: 5000ms;

	position: fixed;
	z-index: 99999;
	width: min(360px, calc(100vw - 32px));
	font-family: inherit;
	color: var(--dg-atc-text);
	opacity: 0;
	transform: translateY(12px);
	transition: opacity .2s ease, transform .25s ease;
	pointer-events: none;
}
.dg-atc[hidden] { display: none; }
.dg-atc.is-open { opacity: 1; transform: none; pointer-events: auto; }

.dg-atc--bottom-left  { left: var(--dg-atc-offset);  bottom: var(--dg-atc-offset); }
.dg-atc--bottom-right { right: var(--dg-atc-offset); bottom: var(--dg-atc-offset); }
.dg-atc--top-right    { right: var(--dg-atc-offset); top: var(--dg-atc-offset); transform: translateY(-12px); }
.dg-atc--top-left     { left: var(--dg-atc-offset);  top: var(--dg-atc-offset);  transform: translateY(-12px); }

.dg-atc__card {
	position: relative;
	overflow: hidden;
	background: var(--dg-atc-surface);
	border: 1px solid var(--dg-atc-line);
	border-radius: 18px;
	box-shadow: 0 18px 40px -18px rgba(13, 92, 44, .45);
	padding: 16px 16px 18px;
}

.dg-atc__head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 32px 12px 0;
}
.dg-atc__badge {
	display: grid;
	place-items: center;
	flex: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--dg-atc-accent);
	color: #fff;
}
.dg-atc__badge svg { width: 13px; height: 13px; }
.dg-atc__title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.dg-atc__close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--dg-atc-muted);
	cursor: pointer;
}
.dg-atc__close:hover { background: #f1f4f2; color: var(--dg-atc-text); }
.dg-atc__close svg { width: 16px; height: 16px; }

.dg-atc__body {
	display: flex;
	align-items: center;
	gap: 12px;
}
.dg-atc__thumb {
	flex: none;
	width: 64px;
	height: 64px;
	border-radius: 12px;
	background: #f4f7f5;
	overflow: hidden;
}
.dg-atc__thumb[hidden] { display: none; }
.dg-atc__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dg-atc__name {
	margin: 0 0 2px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
}
.dg-atc__qty,
.dg-atc__summary {
	margin: 0;
	font-size: 13px;
	color: var(--dg-atc-muted);
	line-height: 1.4;
}
.dg-atc__summary {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--dg-atc-line);
}
.dg-atc__summary strong { color: var(--dg-atc-text); }
.dg-atc__summary:empty { display: none; }

.dg-atc__actions {
	display: flex;
	gap: 8px;
	margin-top: 14px;
}
.dg-atc__btn {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 14px;
	border-radius: 999px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}
.dg-atc__btn--ghost {
	border: 1px solid var(--dg-atc-line);
	background: transparent;
	color: var(--dg-atc-text);
}
.dg-atc__btn--ghost:hover { background: #f1f4f2; }
.dg-atc__btn--primary {
	border: 1px solid var(--dg-atc-primary);
	background: var(--dg-atc-primary);
	color: #fff !important;
}
.dg-atc__btn--primary:hover { background: var(--dg-atc-primary-hover); }

.dg-atc__close:focus-visible,
.dg-atc__btn:focus-visible {
	outline: 2px solid var(--dg-atc-primary);
	outline-offset: 2px;
}

/* Barra de tiempo: su animationend cierra el popup (JS) */
.dg-atc__progress {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	width: 100%;
	background: var(--dg-atc-accent);
	transform-origin: left center;
	transform: scaleX(0);
}
.dg-atc.is-timing .dg-atc__progress {
	animation: dg-atc-countdown var(--dg-atc-duration) linear forwards;
}
.dg-atc.is-paused .dg-atc__progress { animation-play-state: paused; }

@keyframes dg-atc-countdown {
	from { transform: scaleX(1); }
	to   { transform: scaleX(0); }
}

/* Mobile: bottom sheet */
@media (max-width: 600px) {
	.dg-atc,
	.dg-atc--bottom-left,
	.dg-atc--bottom-right,
	.dg-atc--top-left,
	.dg-atc--top-right {
		left: 0;
		right: 0;
		top: auto;
		bottom: 0;
		width: 100%;
		transform: translateY(100%);
	}
	.dg-atc.is-open { transform: none; }
	.dg-atc__card {
		border-radius: 20px 20px 0 0;
		border-bottom: 0;
		padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.dg-atc { transition: opacity .15s linear; transform: none !important; }
	/* La animación sigue corriendo (marca el tiempo) pero no se ve */
	.dg-atc__progress { opacity: 0; }
}
