/**
 * Single product buy box — purchase card in #product-sidebar.
 */

.ddw-buybox {
	--ddw-wine: #702028;
	--ddw-gold: #C08E46;
	--ddw-muted: #888888;
	--ddw-border: #E8E4DF;
	--ddw-qty-bg: #F7F2EC;

	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 18px 16px;
	background: #fff;
	border: 1px solid var(--ddw-border);
	border-radius: 10px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Label + compact quantity on one row; cart buttons full width below */
.ddw-buybox__qty-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 12px;
}

.ddw-buybox__label {
	flex: 0 0 auto;
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: #000000;
	line-height: 1.3;
	white-space: nowrap;
}

.ddw-buybox__qty-wrap form.cart {
	display: contents;
	margin: 0;
	width: auto;
	gap: 0;
}

.ddw-buybox__qty-wrap .variations,
.ddw-buybox__qty-wrap .single_variation_wrap,
.ddw-buybox__qty-wrap .woocommerce-variation-add-to-cart {
	flex: 1 1 100%;
	width: 100%;
}

.ddw-buybox .quantity,
.ddw-buybox .ux-quantity {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: stretch;
	float: none;
	width: auto;
	max-width: 100%;
	margin: 0;
	padding: 0;
	border: 1px solid var(--ddw-border);
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
	vertical-align: middle;
}

/* Woo / Flatsome leftovers */
.ddw-buybox .quantity.buttons_added::before,
.ddw-buybox .quantity.buttons_added::after,
.ddw-buybox .ux-quantity.buttons_added::before,
.ddw-buybox .ux-quantity.buttons_added::after {
	display: none;
	content: none;
}

.ddw-buybox .quantity .screen-reader-text,
.ddw-buybox .ux-quantity .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.ddw-buybox .quantity input.qty,
.ddw-buybox .ux-quantity input.qty {
	flex: 0 0 56px;
	float: none;
	width: 56px !important;
	min-width: 56px;
	max-width: 56px;
	height: 44px;
	margin: 0;
	padding: 0 4px;
	border: 0 !important;
	border-left: 1px solid var(--ddw-border) !important;
	border-right: 1px solid var(--ddw-border) !important;
	border-radius: 0;
	background: #fff;
	box-shadow: none;
	text-align: center;
	font-size: 16px;
	font-weight: 700;
	line-height: 44px;
	color: #1a1a1a;
	-moz-appearance: textfield;
	appearance: textfield;
}

.ddw-buybox .quantity input.qty::-webkit-outer-spin-button,
.ddw-buybox .quantity input.qty::-webkit-inner-spin-button,
.ddw-buybox .ux-quantity input.qty::-webkit-outer-spin-button,
.ddw-buybox .ux-quantity input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ddw-buybox .ux-quantity__button,
.ddw-buybox .quantity .minus,
.ddw-buybox .quantity .plus,
.ddw-buybox .quantity .button.minus,
.ddw-buybox .quantity .button.plus {
	flex: 0 0 42px;
	float: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px !important;
	min-width: 42px;
	height: 44px !important;
	min-height: 44px;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: var(--ddw-qty-bg) !important;
	color: #555 !important;
	font-size: 18px;
	font-weight: 500;
	line-height: 1;
	text-align: center;
	text-shadow: none;
	cursor: pointer;
	box-shadow: none !important;
}

.ddw-buybox .ux-quantity__button:hover,
.ddw-buybox .quantity .minus:hover,
.ddw-buybox .quantity .plus:hover,
.ddw-buybox .quantity .button.minus:hover,
.ddw-buybox .quantity .button.plus:hover {
	background: #ebe4db !important;
	color: var(--ddw-wine) !important;
}

/* Add to cart */
.ddw-buybox .single_add_to_cart_button {
	flex: 1 1 100%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 13px 16px;
	border: 0;
	border-radius: 6px;
	background: var(--ddw-wine) !important;
	color: #fff !important;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-transform: uppercase;
	box-shadow: none;
}

.ddw-buybox .single_add_to_cart_button:hover {
	filter: brightness(1.08);
	color: #fff !important;
}

.ddw-buybox__cart-icon {
	flex: none;
}

/* Buy now */
.ddw-buybox .ux-buy-now-button {
	flex: 1 1 100%;
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin: 0 !important;
	padding: 12px 16px;
	border: 0;
	border-radius: 6px;
	background: var(--ddw-gold) !important;
	color: #fff !important;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-transform: uppercase;
	box-shadow: none;
}

.ddw-buybox .ux-buy-now-button:hover {
	filter: brightness(0.95);
	color: #fff !important;
}

.ddw-buybox__buy-now-icon {
	flex: none;
}

/* Consult */
.ddw-buybox__consult {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--ddw-gold);
	border-radius: 6px;
	background: #fff;
	color: var(--ddw-wine);
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: background 0.2s ease, color 0.2s ease;
}

.ddw-buybox__consult:hover,
.ddw-buybox__consult:focus {
	background: #FBF6EE;
	color: var(--ddw-wine);
	text-decoration: none;
}

.ddw-buybox__consult-icon {
	display: inline-flex;
	flex: none;
	color: var(--ddw-wine);
}

/* Meta */
.ddw-buybox__meta {
	margin-top: 4px;
	padding-top: 14px;
	border-top: 1px solid var(--ddw-border);
	font-size: 13px;
	line-height: 1.55;
	color: var(--ddw-muted);
}

.ddw-buybox__meta .product_meta {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: inherit;
	border: 0;
	padding: 0;
	margin: 0;
}

.ddw-buybox__meta .product_meta > span {
	display: block;
}

/* Mockup shows SKU / category / brand only */
.ddw-buybox__meta .tagged_as {
	display: none;
}

.ddw-buybox__meta .product_meta a,
.ddw-buybox__meta .sku {
	color: var(--ddw-wine);
}

.ddw-buybox__meta .product_meta a:hover {
	text-decoration: underline;
}

/* Sidebar column */
#product-sidebar.product-sidebar-small .ddw-buybox,
#product-sidebar .ddw-buybox {
	position: sticky;
	top: 100px;
}

/* Hide default stock line inside buy box form if duplicated awkwardly */
.ddw-buybox > p.stock {
	margin: 0;
	font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
	.ddw-buybox__consult,
	.ddw-buybox .single_add_to_cart_button,
	.ddw-buybox .ux-buy-now-button {
		transition: none;
	}
}
