/*!
 * Tech Royal Smart Checkout — Frontend Styles
 * Premium Apple/Samsung-inspired button design.
 */

:root {
	--trsc-black: #0d0d0d;
	--trsc-dark-gray: #1c1c1e;
	--trsc-gold: #c9a227;
	--trsc-orange: #ff7a1a;
	--trsc-radius: 10px;
	--trsc-speed: 300ms;
}

.trsc-buttons-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin: 20px 0;
	width: 100%;
}

.trsc-btn {
	position: relative;
	flex: 1 1 auto;
	min-width: 200px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px 28px;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.3px;
	border: none;
	cursor: pointer;
	border-radius: var(--trsc-radius);
	transition: transform var(--trsc-speed) ease,
		box-shadow var(--trsc-speed) ease,
		opacity var(--trsc-speed) ease,
		background var(--trsc-speed) ease;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	text-transform: uppercase;
	overflow: hidden;
	text-decoration: none !important;
}

.trsc-btn:focus-visible {
	outline: 2px solid var(--trsc-orange);
	outline-offset: 2px;
}

.trsc-btn:disabled,
.trsc-btn[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none !important;
	box-shadow: none !important;
}

/* Buy Now — the visually stronger, primary action */
.trsc-btn-buy-now {
	background: linear-gradient(135deg, var(--trsc-gold), var(--trsc-orange));
	color: var(--trsc-black);
	flex: 1.3 1 auto;
}

.trsc-btn-buy-now:not(:disabled):hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(201, 162, 39, 0.45);
}

.trsc-btn-buy-now:not(:disabled):active {
	transform: translateY(0);
}

/* Add to Cart — secondary action */
.trsc-btn-add-cart {
	background: var(--trsc-dark-gray);
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.trsc-btn-add-cart:not(:disabled):hover {
	transform: translateY(-2px);
	background: var(--trsc-black);
	box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.trsc-btn-add-cart:not(:disabled):active {
	transform: translateY(0);
}

/* Loading state */
.trsc-btn-spinner {
	display: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	animation: trsc-spin 0.7s linear infinite;
}

.trsc-btn.trsc-loading .trsc-btn-label {
	opacity: 0.6;
}

.trsc-btn.trsc-loading .trsc-btn-spinner {
	display: inline-block;
}

@keyframes trsc-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.trsc-variation-notice {
	flex-basis: 100%;
	margin: 6px 0 0;
	padding: 10px 14px;
	border-radius: calc(var(--trsc-radius) / 2);
	background: rgba(255, 122, 26, 0.12);
	border: 1px solid rgba(255, 122, 26, 0.35);
	color: var(--trsc-orange);
	font-size: 13px;
	font-weight: 600;
}

/* Mobile: full width, stacked */
@media (max-width: 599px) {
	.trsc-buttons-wrap {
		flex-direction: column;
	}

	.trsc-btn {
		width: 100%;
		flex: 1 1 100%;
	}
}

/* Desktop: side by side */
@media (min-width: 600px) {
	.trsc-buttons-wrap {
		flex-wrap: nowrap;
	}
}

/* RTL support */
html[dir="rtl"] .trsc-btn {
	direction: rtl;
}

/* UPDATE 1.1.0: Shop & Archive product card buttons — compact variant.
   UPDATE 1.2.0: same compact variant is now also used for Variable
   product cards on Shop, Archive, Homepage, Related, Upsell and
   Cross-sell — buttons are plain links (.trsc-btn-link) but share the
   exact same premium look as the AJAX buttons; no visual differences. */
/* UPDATE 1.2.1: Shop & Archive product card buttons — always stacked
   full-width (image → title → price → Add to Cart → Buy Now), with a
   premium hover "shine sweep" glow, regardless of screen size. */
.trsc-buttons-archive.trsc-buttons-wrap {
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	gap: 10px;
	margin: 12px 0 0;
}

.trsc-buttons-archive .trsc-btn {
	width: 100%;
	min-width: 0;
	flex: 1 1 100% !important;
	padding: 12px 16px;
	font-size: 13px;
	letter-spacing: 0.2px;
}

/* Hover glow / light-sweep effect */
.trsc-buttons-archive .trsc-btn::after {
	content: '';
	position: absolute;
	top: 0;
	left: -75%;
	width: 45%;
	height: 100%;
	background: linear-gradient(
		120deg,
		transparent,
		rgba(255, 255, 255, 0.45),
		transparent
	);
	transform: skewX(-20deg);
	transition: left 0.6s ease;
	pointer-events: none;
}

.trsc-buttons-archive .trsc-btn:not(:disabled):hover::after {
	left: 130%;
}

.trsc-buttons-archive .trsc-btn:not(:disabled):hover {
	transform: translateY(-2px);
}

/* Admin settings page */
.trsc-settings-wrap .form-table th {
	width: 280px;
}

.trsc-settings-wrap input[type="number"] {
	width: 100px;
}
