/**
 * Atomic Pro - Add to Cart / Buy Now / Quantity / Variations
 */

/* --- Quantity --- */
.atomicpro-atc-qty {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid #d1d5db;
	overflow: hidden;
}

.atomicpro-atc-qty-minus,
.atomicpro-atc-qty-plus {
	border: none;
	cursor: pointer;
	width: 36px;
	font-size: 16px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f2f2f2;
}

.atomicpro-atc-qty-input {
	width: 48px;
	border: none;
	border-left: 1px solid #d1d5db;
	border-right: 1px solid #d1d5db;
	text-align: center;
	-moz-appearance: textfield;
}

.atomicpro-atc-qty-input::-webkit-outer-spin-button,
.atomicpro-atc-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* --- Buttons --- */
.atomicpro-atc-add-btn,
.atomicpro-atc-buy-btn {
	border: none;
	cursor: pointer;
	padding: 10px 20px;
	font-size: 15px;
	font-weight: 600;
	color: #ffffff;
	transition: opacity 0.15s;
}

.atomicpro-atc-add-btn:hover,
.atomicpro-atc-buy-btn:hover {
	opacity: 0.9;
}

.atomicpro-atc-add-btn:disabled,
.atomicpro-atc-buy-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.atomicpro-atc-add-btn.is-loading,
.atomicpro-atc-buy-btn.is-loading {
	opacity: 0.7;
	cursor: wait;
}

/* --- Variations --- */
.atomicpro-atc-option {
	margin-bottom: 10px;
}

.atomicpro-atc-option:last-child {
	margin-bottom: 0;
}

/* Resets WooCommerce's own default spacing on this element, which we
   render but otherwise leave empty until a variation is selected. */
.atomicpro-atc-variations-wrap .single_variation_wrap,
.atomicpro-atc-variations-wrap .woocommerce-variation {
	margin: 0;
	padding: 0;
}

.atomicpro-atc-option-label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.atomicpro-atc-option-control select {
	width: 100%;
	padding: 6px 8px;
}

/* Visually hidden but still functional/accessible — used by Variation:
   Buttons to keep the real <select> WooCommerce's JS needs, while
   showing custom buttons instead. Never display:none (would still work
   for JS, but this is the standard accessible hiding technique). */
.atomicpro-atc-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.atomicpro-atc-variation-buttons-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Wrapped in :where() (zero specificity) so a custom class added via
   the widget's own "Button CSS Classes" / "Selected Button CSS Classes"
   fields always overrides these defaults, regardless of which
   stylesheet happens to load last on the page. */
:where(.atomicpro-atc-variation-btn) {
	border: 1px solid #d1d5db;
	background: #ffffff;
	color: #000000;
	padding: 8px 16px;
	cursor: pointer;
	border-radius: 4px;
	font-size: 14px;
}

:where(.atomicpro-atc-variation-btn:hover) {
	border-color: #000000;
	background: #000000;
	color: #ffffff;
}

:where(.atomicpro-atc-variation-btn.is-selected) {
	border-color: #000000;
	background: #000000;
	color: #ffffff;
}

/* --- Status message --- */
.atomicpro-atc-message {
	margin-top: 8px;
	font-size: 13px;
}

.atomicpro-atc-message.is-success {
	color: #15803d;
}

.atomicpro-atc-message.is-error {
	color: #dc2626;
}

/* --- Added-to-cart toast --- */
.atomicpro-atc-toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 999999;
	background: #15803d;
	color: #fff;
	padding: 12px 18px;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
	font-size: 14px;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 320px;
	transform: translateY(16px);
	opacity: 0;
	pointer-events: none;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.atomicpro-atc-toast.is-visible {
	transform: translateY(0);
	opacity: 1;
	pointer-events: auto;
}

.atomicpro-atc-toast__text {
	flex: 1;
}

.atomicpro-atc-toast__link {
	color: #fff;
	font-weight: 700;
	text-decoration: underline;
	white-space: nowrap;
}

.atomicpro-atc-toast__link:hover {
	text-decoration: none;
}

.atomicpro-atc-toast__close {
	background: transparent;
	border: none;
	color: #fff;
	opacity: 0.8;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	padding: 0;
}

.atomicpro-atc-toast__close:hover {
	opacity: 1;
}

@media (max-width: 480px) {
	.atomicpro-atc-toast {
		left: 16px;
		right: 16px;
		bottom: 16px;
		max-width: none;
	}
}

.atomicpro-atc-empty {
	opacity: 0.7;
	font-style: italic;
}
/* --- Product Price --- */
.atomicpro-atc-price .price {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.4em;
}

.atomicpro-atc-price del {
	opacity: 0.6;
}

.atomicpro-atc-price ins {
	text-decoration: none;
}

/* Product Price widget owns the price; hide WooCommerce's own variation price. */
.atomicpro-atc-variations .woocommerce-variation-price {
	display: none;
}
