.rc-qo-open-btn {
	pointer-events: auto !important;
	opacity: 1 !important;
	cursor: pointer !important;
	box-shadow: none !important;
}

.rc-qo-root[hidden] { display: none !important; }

.rc-qo-root {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.rc-qo-backdrop {
	position: absolute;
	inset: 0;
	background: rgb(16 24 32 / 52%);
}

.rc-qo-dialog {
	position: relative;
	z-index: 1;
	width: min(480px, 100%);
	max-height: min(92dvh, 100%);
	overflow: auto;
	background: #fff;
	color: var(--rc-text, #17212b);
	border-radius: 16px;
	box-shadow: 0 4px 18px rgb(16 24 32 / 6%), 0 16px 40px rgb(16 24 32 / 16%);
	padding: 16px;
	font-family: var(--rc-font, Inter, system-ui, sans-serif);
}

@media (min-width: 720px) {
	.rc-qo-dialog { padding: 24px; }
	.rc-qo-root { padding: 24px; }
}

.rc-qo-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}

.rc-qo-title {
	margin: 0;
	font-family: var(--rc-font-display, Inter, system-ui, sans-serif);
	font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.1;
	color: var(--rc-dark, #101820);
}

.rc-qo-close {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	margin: -8px -8px 0 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--rc-muted, #526170);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.rc-qo-close:hover { color: var(--rc-dark, #101820); background: var(--rc-bg, #f5f7fa); }

.rc-qo-form { display: grid; gap: 16px; }

.rc-qo-field { display: flex; flex-direction: column; gap: 6px; }
.rc-qo-field label {
	font-size: var(--rc-fs-small, 0.9rem);
	font-weight: 600;
	color: var(--rc-dark, #101820);
}

.rc-qo-field input,
.rc-qo-field textarea {
	box-sizing: border-box;
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--rc-control-border, #82909e);
	border-radius: 12px;
	background: #fff;
	color: var(--rc-text, #17212b);
	font: inherit;
	font-size: 16px;
}

.rc-qo-field textarea { min-height: 88px; resize: vertical; }

.rc-qo-field input:focus,
.rc-qo-field textarea:focus,
.rc-qo-consent input:focus-visible {
	outline: 3px solid var(--rc-accent, #b83a1b);
	outline-offset: 2px;
	border-color: var(--rc-accent, #b83a1b);
}

.rc-qo-field.is-error input,
.rc-qo-field.is-error textarea {
	border-color: var(--rc-error, #b42318);
}

.rc-qo-error {
	margin: 0;
	color: var(--rc-error, #b42318);
	font-size: var(--rc-fs-small, 0.875rem);
}

.rc-qo-consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: var(--rc-fs-small, 0.9rem);
	color: var(--rc-text, #17212b);
	line-height: 1.45;
}
.rc-qo-consent input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--rc-accent, #b83a1b); }
.rc-qo-consent a { color: var(--rc-accent, #b83a1b); }

.rc-qo-submit,
.rc-qo-social {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	padding: 12px 22px;
	border: 1px solid transparent;
	border-radius: 12px;
	background: var(--rc-accent, #b83a1b);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.rc-qo-submit:hover,
.rc-qo-social:hover { background: var(--rc-accent-hover, #962d16); color: #fff; text-decoration: none; }

.rc-qo-submit:disabled,
.rc-qo-submit.is-disabled {
	background: #fff;
	color: var(--rc-muted, #526170);
	border-color: var(--rc-border, #d5dde5);
	cursor: not-allowed;
}

.rc-qo-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.rc-qo-closed,
.rc-qo-success { text-align: left; }
.rc-qo-closed p,
.rc-qo-success p { margin: 0 0 16px; color: var(--rc-text, #17212b); line-height: 1.5; }

.rc-qo-number {
	margin: 0 0 16px;
	font-family: var(--rc-font-display, Inter, system-ui, sans-serif);
	font-size: clamp(1.75rem, 1.2rem + 2vw, 2.4rem);
	font-weight: 800;
	letter-spacing: 0.02em;
	line-height: 1.1;
	color: var(--rc-dark, #101820);
}

.rc-qo-links { display: grid; gap: 8px; margin-top: 8px; }
.rc-qo-social--vk { background: #0077ff; }
.rc-qo-social--vk:hover { background: #0066dd; }
.rc-qo-social--max { background: #101820; }
.rc-qo-social--max:hover { background: #17293a; }
.rc-qo-social--tg { background: #229ed9; }
.rc-qo-social--tg:hover { background: #1b8dc3; }

body.rc-qo-lock { overflow: hidden; }

@media (max-width: 480px) {
	.rc-qo-dialog { max-height: 96dvh; }
}

/* Прячем дубликат «Оформить заказ». Нашу кнопку не трогаем, даже если
   плагин закрытых заказов снова вешает класс rc-orders-closed-locked. */
html body .woocommerce .wc-proceed-to-checkout a.checkout-button:not(.rc-qo-open-btn),
.wc-proceed-to-checkout .checkout-button.rc-qo-ignore,
.wc-proceed-to-checkout a.checkout-button.rc-orders-closed-locked:not(.rc-qo-open-btn) {
	display: none !important;
}


/* Кнопка «Заказать» всегда видна в блоке итогов корзины. */
html body.woocommerce-cart .woocommerce .wc-proceed-to-checkout,
html body.woocommerce-page .woocommerce .wc-proceed-to-checkout {
	display: block !important;
	padding-top: 16px;
}
html body .woocommerce .wc-proceed-to-checkout a.checkout-button.button.rc-qo-open-btn,
a.checkout-button.rc-qo-open-btn:not(.rc-qo-ignore),
button.rc-qo-open-btn:not(.rc-qo-ignore),
.rc-qo-open-btn.checkout-button:not(.rc-qo-ignore) {
	display: flex !important;
	align-items: center;
	justify-content: center;
	visibility: visible !important;
	opacity: 1 !important;
	pointer-events: auto !important;
	width: 100%;
	min-height: 48px;
	margin: 0;
	background: var(--rc-accent, #b83a1b) !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 8px;
	text-decoration: none !important;
	font-weight: 600;
	box-shadow: none !important;
	cursor: pointer !important;
}
html body .woocommerce .wc-proceed-to-checkout a.checkout-button.button.rc-qo-open-btn:hover,
a.checkout-button.rc-qo-open-btn:hover {
	background: var(--rc-accent-hover, #962d16) !important;
	color: #fff !important;
}
