/*
 * Yeldam Add to Cart widget.
 *
 * Styles both the button and the "Added to Cart" link WooCommerce inserts
 * after it once added (yeldam-woo-ui.js then hides the button and gives
 * that link the theme's .gotur-btn classes — whose padding, hover sweep
 * pseudo-elements and colours are overridden here so the two look like one
 * button changing state). Colours come from custom properties so the
 * widget's Style controls apply to both.
 */
.ypw-atc {
	--ypw-atc-color: #fff;
	--ypw-atc-bg: var(--gotur-base, #63AB45);
	--ypw-atc-color-hover: #fff;
	--ypw-atc-bg-hover: color-mix(in srgb, var(--ypw-atc-bg) 88%, #000);
	--ypw-atc-width: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
}

.ypw-atc .ypw-atc__button,
.ypw-atc .added_to_cart.wc-forward {
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
	width: var(--ypw-atc-width);
	min-height: 48px;
	margin: 0 !important;
	padding: 12px 28px !important;
	border: none;
	border-radius: 999px !important;
	background: var(--ypw-atc-bg) !important;
	color: var(--ypw-atc-color) !important;
	font-family: var(--gotur-font, "Plus Jakarta Sans", sans-serif);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}
/* Shown as flex unless the add-to-cart JS has hidden it (inline display:none). */
.ypw-atc .ypw-atc__button:not([style*="display: none"]),
.ypw-atc .added_to_cart.wc-forward:not([style*="display: none"]) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.ypw-atc .ypw-atc__button:hover,
.ypw-atc .ypw-atc__button:focus-visible,
.ypw-atc .added_to_cart.wc-forward:hover,
.ypw-atc .added_to_cart.wc-forward:focus-visible {
	background: var(--ypw-atc-bg-hover) !important;
	color: var(--ypw-atc-color-hover) !important;
}
.ypw-atc .ypw-atc__button:focus-visible,
.ypw-atc .added_to_cart.wc-forward:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--ypw-atc-bg) 45%, transparent);
	outline-offset: 2px;
}

/* No theme hover sweep on the inserted link. */
.ypw-atc .added_to_cart.wc-forward::after {
	content: none !important;
	display: none !important;
}

/* Cart icon (same icon as the product cards), on the button and on the
   "Added to Cart" link that replaces it. */
.ypw-atc .ypw-atc__button--icon::before,
.ypw-atc .ypw-atc__button--icon ~ .added_to_cart::before {
	content: "" !important;
	position: static !important;
	flex: none;
	width: 20px !important;
	height: 20px !important;
	margin: 0 !important;
	background: currentColor !important;
	transform: none !important;
	transition: none !important;
	opacity: 1 !important;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2l2.4 10.2a1 1 0 0 0 1 .8h8.9a1 1 0 0 0 1-.8L20 7H6'/%3E%3Ccircle cx='9' cy='19' r='1.4'/%3E%3Ccircle cx='17' cy='19' r='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2l2.4 10.2a1 1 0 0 0 1 .8h8.9a1 1 0 0 0 1-.8L20 7H6'/%3E%3Ccircle cx='9' cy='19' r='1.4'/%3E%3Ccircle cx='17' cy='19' r='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ypw-atc .added_to_cart.wc-forward:not(.ypw-atc__button--icon ~ .added_to_cart)::before {
	content: none !important;
	display: none !important;
}

.ypw-atc .ypw-atc__price {
	font-weight: 600;
	opacity: 0.95;
	white-space: nowrap;
}

/* WooCommerce's "adding" state. */
.ypw-atc .ypw-atc__button.loading {
	opacity: 0.7;
	pointer-events: none;
}
/* Core's own tick icon after adding — not used (the link replaces it). */
.ypw-atc .ypw-atc__button.added::after,
.ypw-atc .ypw-atc__button.loading::after {
	content: none !important;
	display: none !important;
}

.ypw-atc .ypw-atc__button.is-disabled {
	opacity: 0.55;
	cursor: not-allowed;
	pointer-events: none;
}
