/**
 * Single product styling — ported from the old RicoDeco theme's
 * shop-product-hero component (buttons, quantity stepper, price, tile calculator).
 * Enqueued only on is_product() — see functions.php.
 */

:root {
	--rd-dark: #1c1c1c;
	--rd-white: #fff;
	--rd-black: #000;
	--rd-grey: #7c7c7c;
	--rd-light-grey: #ebf0f1;
	--rd-warm-white: #f5f3ee;
	--rd-border: #cdcdcd;
}

/* ---------- Price ---------- */
.rd-product-price {
	font-size: 1.4rem;
	line-height: 1.4rem;
	letter-spacing: -0.0175rem;
	margin: 0.3rem 0 1.5rem;
	font-family: inherit;
	display: flex;
	flex-direction: column;
}

.rd-product-price .rd-price-old {
	text-decoration: line-through;
	margin-bottom: 5px;
	font-size: 70%;
	color: var(--rd-grey);
}

.rd-product-price .rd-price-persqm {
	font-size: 1.4rem;
	line-height: 120%;
	background: #f1f1f1;
	margin-right: auto;
	width: auto;
	padding: 5px 15px;
	margin-bottom: 16px;
	border-radius: 8px;
	font-weight: bold;
}

.rd-product-price .rd-price-breaker {
	width: 100%;
	background: #f1f1f1;
	margin: 4px 0 20px 0;
	height: 1px;
}

.rd-product-price .rd-price-current {
	color: var(--rd-grey);
}

.rd-product-price .rd-price-sale {
	color: #ff4141;
}

/* ---------- Buttons ---------- */
.rd-add-to-cart-buttons {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin: 2.5rem 0;
}

.rd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
	min-width: 13.9rem;
	width: 100%;
	padding: 1rem;
	border-radius: 3.2rem;
	border: 1px solid transparent;
	text-transform: uppercase;
	text-align: center;
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.125rem;
	letter-spacing: -0.0175rem;
	cursor: pointer;
	transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

.rd-btn:disabled,
.rd-btn[aria-disabled="true"] {
	pointer-events: none;
	opacity: 0.6;
}

.rd-btn__wrapper {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.rd-btn__text {
	position: relative;
	z-index: 2;
	transition: transform 0.4s ease;
	white-space: nowrap;
}

.rd-btn__text:nth-of-type(2) {
	position: absolute;
	left: 0;
	transform: translateY(200%);
}

.rd-btn:hover .rd-btn__text {
	transform: translateY(-200%);
}

.rd-btn:hover .rd-btn__text:nth-of-type(2) {
	transform: translateY(0);
}

.rd-btn--dark {
	background: var(--rd-dark);
	color: var(--rd-white);
}

.rd-btn--dark:hover {
	background: var(--rd-white);
	border-color: var(--rd-border);
	color: var(--rd-dark);
}

.rd-btn--outline {
	background: transparent;
	border-color: var(--rd-border);
	color: var(--rd-dark);
}

.rd-btn--outline:hover {
	background: var(--rd-dark);
	border-color: var(--rd-dark);
	color: var(--rd-white);
}

/* ---------- Simple product quantity stepper ---------- */
.rd-qty-wrapper {
	margin-bottom: 1rem;
}

.rd-caption-dot {
	text-transform: uppercase;
	font-size: 0.8rem;
	letter-spacing: 0.05em;
	color: var(--rd-grey);
	margin-bottom: 0.75rem;
}

.rd-quantity {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 0;
	border-top: 1px solid rgba(28, 28, 28, 0.2);
	border-bottom: 1px solid rgba(28, 28, 28, 0.2);
}

.rd-quantity__minus,
.rd-quantity__plus {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	min-width: 32px;
	border-radius: 100px;
	background: #ffffff00;
	color: var(--rd-white);
	border: none;
	cursor: pointer;
}

.rd-quantity__minus svg,
.rd-quantity__plus svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
	stroke: none;
}

.rd-quantity__minus svg path,
.rd-quantity__plus svg path {
	fill: #000000;
}

.rd-quantity__count {
	margin: 0;
	min-width: 2rem;
	text-align: center;
	font-size: 1.1rem;
}

/* ---------- Tile (box / m²) calculator ---------- */
.rd-qty-instructions {
	margin-bottom: 1rem;
	background: #f1f1f1;
	padding: 1rem;
	border-radius: 8px;
}

.rd-qty-instructions ul {
	margin: 0 0 0 1.25rem;
	padding: 0;
}

.rd-qty-instructions li {
	font-size: 1rem;
	line-height: 1.3rem;
	font-weight: 500;
	list-style: disc;
	padding-bottom: 0.6rem;
}

.rd-qty-instructions li:last-child {
	padding-bottom: 0;
}

.rd-section-heading {
	width: 100%;
	margin-bottom: 1.5rem;
}

.rd-tile-calculator__main {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.rd-qty-btn {
	background: var(--rd-black);
	width: 32px;
	min-width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	border: none;
	border-radius: 100px;
	cursor: pointer;
	flex-shrink: 0;
}

.rd-qty-btn svg {
	fill: currentColor;
	stroke: none;
}

.rd-qty-btn svg path {
	fill: currentColor;
}

.rd-qty-field {
	display: flex;
	flex-direction: column;
	border: 1px solid #f1f1f1;
	width: 100%;
	max-width: 9rem;
}

.rd-qty-field input {
	margin: 0;
	padding: 10px 10px 5px;
	text-align: center;
	font-size: 1.1rem;
	line-height: 1.25rem;
	border: none;
	background: transparent;
}

.rd-qty-field input:focus {
	outline: none;
}

.rd-qty-field label {
	padding: 8px 10px;
	font-size: 0.875rem;
	line-height: 1.1rem;
	text-align: center;
	font-weight: 600;
	border-top: 1px solid #f1f1f1;
	white-space: nowrap;
}

.rd-pricing-wrapper {
	width: 100%;
	max-width: 23rem;
	padding: 0.75rem 0;
	margin-top: 1rem;
}

.rd-total-price {
	padding: 10px 25px;
	border-radius: 8px;
	font-size: 1.2rem;
	font-weight: 500;
	color: #fff;
	background: var(--rd-black);
	width: 100%;
	text-align: center;
}

/* ---------- Area calculator modal ---------- */
.rd-area-calculator {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.7);
	padding: 1.5rem;
}

.rd-area-calculator.is-open {
	display: flex;
}

.rd-area-calculator__panel {
	background: #fff;
	max-width: 32rem;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 2rem;
	border-radius: 8px;
	position: relative;
}

.rd-area-calculator__nav {
	display: flex;
	justify-content: space-between;
	font-size: 0.8rem;
	color: var(--rd-grey);
	margin-bottom: 0.5rem;
}

.rd-area-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.rd-area-item input {
	width: 100%;
	padding: 0.6rem;
	border: 1px solid #e0e0e0;
	text-align: center;
}

.rd-area-item .rd-area-result {
	min-width: 4rem;
	text-align: right;
	font-weight: 600;
}

.rd-area-calculator__results {
	display: none;
	margin: 1rem 0;
	padding: 1rem;
	background: #f6f6f6;
	border-radius: 6px;
	font-size: 0.9rem;
}

.rd-area-calculator__results.active {
	display: block;
}

.rd-area-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1rem;
}

.rd-area-buttons .rd-btn {
	width: auto;
	flex: 1 1 auto;
	min-width: 0;
}

.rd-btn--auto {
	width: auto;
	min-width: 0;
	padding: 0.75rem 1.25rem;
}

/* These buttons only render a single .rd-btn__text (no duplicate for the
 * slide-swap animation), so cancel the transform — otherwise the text
 * slides up and out on hover with nothing behind it to slide in. */
.rd-btn.rd-btn--auto .rd-btn__text,
.rd-btn.rd-btn--auto:hover .rd-btn__text {
	transform: none;
}

.rd-area-cuts {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
	margin: 1rem 0;
	cursor: pointer;
}

.rd-area-items {
	max-height: 14rem;
	overflow-y: auto;
	margin-bottom: 0.5rem;
}

.rd-area-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: transparent;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

@media (min-width: 576px) {
	.rd-add-to-cart-buttons {
		flex-direction: row;
	}
}

/* ---------- Variable products ----------
 * These templates aren't overridden (WooCommerce's own variation AJAX
 * handles them), so give the native markup the same look instead. */
.single-product form.cart .button,
.single-product .woocommerce-variation-add-to-cart .button,
.single-product .single_add_to_cart_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 13.9rem;
	width: 100%;
	padding: 1rem;
	border-radius: 3.2rem;
	border: 1px solid transparent;
	background: var(--rd-dark);
	color: var(--rd-white);
	text-transform: uppercase;
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: -0.0175rem;
	transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

.single-product form.cart .button:hover,
.single-product .woocommerce-variation-add-to-cart .button:hover,
.single-product .single_add_to_cart_button:hover {
	background: var(--rd-white);
	border-color: var(--rd-border);
	color: var(--rd-dark);
}

.single-product form.cart .quantity {
	display: flex;
	align-items: center;
	margin-bottom: 1rem;
}

.single-product form.cart .quantity .qty {
	width: 4rem;
	padding: 0.6rem;
	text-align: center;
	border: 1px solid rgba(28, 28, 28, 0.2);
}

.single-product .variations select {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 1px solid rgba(28, 28, 28, 0.2);
	background: var(--rd-white);
}
