.qo-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 20px;
}
.qo-overlay.active { display: flex; }

.qo-modal {
	background: #111;
	color: #fff;
	width: 100%;
	max-width: 480px;
	max-height: 90vh;
	overflow-y: auto;
	border-radius: 14px;
	position: relative;
	border: 1px solid #2a2a2a;
	box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.qo-close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: none;
	border: none;
	color: #fff;
	font-size: 28px;
	cursor: pointer;
	line-height: 1;
	z-index: 2;
}

.qo-body { padding: 24px; }

.qo-product { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.qo-product img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; background: #eee; }
.qo-product h3,
#qo-title {
	margin: 0 0 4px;
	font-size: 16px;
	color: #fff !important;
}
.qo-price { color: #e63946; font-weight: 600; }

.qo-field { margin-bottom: 14px; }
.qo-field label { display: block; font-size: 13px; margin-bottom: 6px; color: #ccc; }

/* !important on every property here because this theme's own global form-field
   CSS (input/select/textarea white-bg defaults) was overriding our dark
   styling outright — same root cause as the earlier button issue. */
.qo-field input[type=text],
.qo-field input[type=tel],
.qo-field textarea,
.qo-field select {
	width: 100% !important;
	padding: 10px 12px !important;
	border-radius: 8px !important;
	border: 1px solid #333 !important;
	background-color: #1a1a1a !important;
	background-image: none !important;
	color: #fff !important;
	font-size: 14px !important;
	font-family: inherit !important;
	box-sizing: border-box !important;
	box-shadow: none !important;
	margin: 0 !important;
}
.qo-field input[type=text]::placeholder,
.qo-field input[type=tel]::placeholder,
.qo-field textarea::placeholder {
	color: #888 !important;
}
.qo-field textarea { min-height: 70px !important; resize: vertical !important; }

/* Variation dropdowns (Size/Color/etc.) get their own visible arrow since
   appearance is reset — otherwise they look like plain, non-interactive
   text boxes with no hint that they're selectable. */
.qo-field select.qo-variation-select {
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	background-color: #1a1a1a !important;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 12px center !important;
	background-size: 16px !important;
	padding-right: 36px !important;
	cursor: pointer !important;
}
.qo-field select.qo-variation-select option {
	background: #1a1a1a;
	color: #fff;
}
/* Dim the text while the placeholder ("Choose Size") is still selected, so
   it visually reads as "not picked yet" instead of looking pre-filled. */
.qo-field select.qo-variation-select.qo-empty {
	color: #888 !important;
}

.qo-qty { display: flex; align-items: center; gap: 10px; }
.qo-qty button {
	width: 34px !important; height: 34px !important; border-radius: 6px !important;
	border: 1px solid #333 !important; background-color: #1a1a1a !important; color: #fff !important;
	font-size: 18px !important; cursor: pointer !important; box-shadow: none !important;
}
.qo-qty input {
	width: 60px !important; text-align: center !important; padding: 8px !important;
	border-radius: 6px !important; border: 1px solid #333 !important;
	background-color: #1a1a1a !important; color: #fff !important; box-shadow: none !important;
}

.qo-radio-group { display: flex; gap: 18px; font-size: 14px; color: #ddd; }
.qo-radio-group label { display: flex; align-items: center; gap: 6px; }

.qo-summary { border-top: 1px solid #333; padding-top: 12px; margin: 16px 0; }
.qo-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; color: #ccc; }
.qo-row.qo-total { font-size: 16px; font-weight: 700; color: #fff; border-top: 1px solid #333; margin-top: 6px; padding-top: 10px; }

.qo-message { min-height: 20px; font-size: 13px; margin-bottom: 10px; }
.qo-message.qo-error { color: #ff6b6b; }
.qo-message.qo-success { color: #4caf50; }

/* The Confirm Order button inside the popup keeps its own explicit style
   (it's not on the shop grid, so there's no "Add To Cart" to match here). */
.qo-submit-btn,
button.qo-submit-btn {
	width: 100% !important;
	display: block !important;
	background-color: #e63946 !important;
	background-image: none !important;
	color: #fff !important;
	border: none !important;
	padding: 14px !important;
	border-radius: 30px !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	transition: background-color 0.2s ease, transform 0.05s ease !important;
}
.qo-submit-btn:hover,
button.qo-submit-btn:hover,
.qo-submit-btn:focus,
button.qo-submit-btn:focus {
	background-color: #d62839 !important;
	color: #fff !important;
}
.qo-submit-btn:active,
button.qo-submit-btn:active {
	background-color: #c11f2f !important;
	transform: scale(0.98);
}
.qo-submit-btn:disabled,
button.qo-submit-btn:disabled {
	background-color: #e63946 !important;
	opacity: 0.6 !important;
	cursor: not-allowed !important;
}

/* Quick Order trigger button keeps the theme's "button" class for identical
   font/padding/border-radius, plus a brand color on top. width/flex overrides
   below stop WoodMart's flex-column card layout from stretching it full-width
   (which is the default "align-items: stretch" behavior for flex children,
   and is why it was rendering much bigger than Add To Cart). */
.qo-open-btn {
	cursor: pointer;
	display: block !important;
	width: auto !important;
	max-width: none !important;
	flex: 0 0 auto !important;
	align-self: center !important;
	margin: 8px auto 0 auto !important;
	background-color: #a9070a !important;
	background-image: none !important;
	border-color: #a9070a !important;
	color: #fff !important;
}
.qo-open-btn:hover,
.qo-open-btn:focus {
	background-color: #8c0608 !important;
	border-color: #8c0608 !important;
	color: #fff !important;
}
.qo-open-btn:active {
	background-color: #740508 !important;
	border-color: #740508 !important;
	color: #fff !important;
}

@media (max-width: 480px) {
	.qo-overlay { align-items: flex-end; padding: 0; }
	.qo-modal {
		max-width: 100%;
		border-radius: 14px 14px 0 0;
		max-height: 92vh;
	}
}
