/* Richkid Quick Buy — catalog buttons + Buy Now popup */

:root {
	--rkqb-accent: #e83330;
	--rkqb-accent-dark: #c92826;
	--rkqb-accent-soft: rgba(232, 51, 48, 0.09);
	--rkqb-ink: #16181d;
	--rkqb-muted: #6b7280;
	--rkqb-muted-soft: #9ca3af;
	--rkqb-border: #e7e8ec;
	--rkqb-bg: #ffffff;
	--rkqb-bg-soft: #f6f6f8;
	--rkqb-bg-field: #f8f8fa;
	--rkqb-radius: 18px;
	--rkqb-radius-sm: 11px;
	--rkqb-shadow: 0 24px 70px -12px rgba(17, 17, 20, 0.35), 0 4px 16px rgba(17, 17, 20, 0.08);
	--rkqb-control-h: 46px;
}

/* ── Catalog buttons ─────────────────────────────────────────── */

.rkqb-buttons {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	width: 100%;
}

.rkqb-buttons--unavailable {
	max-width: 220px;
}

.rkqb-btn {
	flex: 1 1 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1.5px solid var(--rkqb-ink);
	cursor: pointer;
	transition: all 0.15s ease;
	text-decoration: none !important;
	white-space: nowrap;
}

.rkqb-btn--details {
	background: var(--rkqb-bg);
	color: var(--rkqb-ink);
}

.rkqb-btn--details:hover {
	background: var(--rkqb-ink);
	color: #fff;
}

.rkqb-btn--buy {
	background: var(--rkqb-accent);
	border-color: var(--rkqb-accent);
	color: #fff;
	box-shadow: 0 4px 12px rgba(232, 51, 48, 0.28);
}

.rkqb-btn--buy:hover {
	background: var(--rkqb-accent-dark);
	border-color: var(--rkqb-accent-dark);
	box-shadow: 0 6px 16px rgba(232, 51, 48, 0.34);
	transform: translateY(-1px);
}

.rkqb-btn--buy:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

/* ── Overlay + modal shell ───────────────────────────────────── */

.rkqb-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 16, 20, 0.6);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.rkqb-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

body.rkqb-noscroll {
	overflow: hidden;
}

.rkqb-modal {
	background: var(--rkqb-bg);
	border-radius: var(--rkqb-radius);
	box-shadow: var(--rkqb-shadow);
	width: 100%;
	max-width: 440px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: translateY(16px) scale(0.97);
	transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.rkqb-overlay.is-open .rkqb-modal {
	transform: translateY(0) scale(1);
}

.rkqb-modal--wide {
	max-width: 560px;
}

.rkqb-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	border-bottom: 1px solid var(--rkqb-border);
	flex-shrink: 0;
}

.rkqb-modal-title {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--rkqb-ink);
	margin: 0;
}

.rkqb-modal-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	background: var(--rkqb-bg-soft);
	border: none;
	font-size: 18px;
	line-height: 1;
	color: var(--rkqb-muted);
	cursor: pointer;
	border-radius: 50%;
	transition: background 0.15s ease, color 0.15s ease;
}

.rkqb-modal-close:hover {
	background: var(--rkqb-ink);
	color: #fff;
}

.rkqb-modal-body {
	padding: 20px;
	overflow-y: auto;
	flex: 1 1 auto;
}

/* ── Step 1: product summary + size picker ──────────────────── */

.rkqb-product-summary {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-bottom: 18px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--rkqb-border);
}

.rkqb-product-summary img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: var(--rkqb-radius-sm);
	border: 1px solid var(--rkqb-border);
	flex-shrink: 0;
}

.rkqb-product-summary-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--rkqb-ink);
	margin: 0 0 4px;
}

.rkqb-product-summary-price {
	font-size: 17px;
	font-weight: 700;
	color: var(--rkqb-accent);
}

.rkqb-field-label {
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--rkqb-muted-soft);
	margin: 0 0 10px;
}

.rkqb-chip-group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.rkqb-chip {
	min-width: 48px;
	padding: 10px 14px;
	border-radius: 999px;
	border: 1.5px solid var(--rkqb-border);
	background: var(--rkqb-bg-field);
	color: var(--rkqb-ink);
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	cursor: pointer;
	transition: all 0.14s ease;
}

.rkqb-chip:hover {
	border-color: var(--rkqb-ink);
}

.rkqb-chip.is-selected {
	background: var(--rkqb-ink);
	border-color: var(--rkqb-ink);
	color: #fff;
	box-shadow: 0 4px 10px rgba(22, 24, 29, 0.22);
}

.rkqb-chip.is-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	text-decoration: line-through;
}

.rkqb-inline-note {
	font-size: 12px;
	color: var(--rkqb-muted);
	margin: -10px 0 16px;
	min-height: 16px;
}

.rkqb-inline-note.is-error {
	color: var(--rkqb-accent-dark);
	font-weight: 600;
}

/* ── Buttons inside modal body ───────────────────────────────── */

.rkqb-modal-actions {
	margin-top: 4px;
}

.rkqb-btn-primary {
	display: block;
	width: 100%;
	height: 48px;
	padding: 0 16px;
	border-radius: var(--rkqb-radius-sm);
	border: none;
	background: var(--rkqb-accent);
	color: #fff;
	font-size: 14.5px;
	font-weight: 700;
	letter-spacing: 0.01em;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(232, 51, 48, 0.28);
	transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.rkqb-btn-primary:hover {
	background: var(--rkqb-accent-dark);
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(232, 51, 48, 0.34);
}

.rkqb-btn-primary:active {
	transform: translateY(0);
}

.rkqb-btn-primary:disabled {
	background: var(--rkqb-border);
	color: var(--rkqb-muted-soft);
	cursor: not-allowed;
	box-shadow: none;
	transform: none;
}

/* ── Step 2: cart summary + custom order form ────────────────── */

.rkqb-checkout-summary {
	background: var(--rkqb-bg-soft);
	border: 1px solid var(--rkqb-border);
	border-radius: var(--rkqb-radius-sm);
	padding: 6px 14px;
	margin-bottom: 20px;
}

.rkqb-checkout-summary-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--rkqb-border);
}

.rkqb-checkout-summary-row:last-of-type {
	border-bottom: none;
}

.rkqb-checkout-summary-thumb img {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 9px;
	border: 1px solid var(--rkqb-border);
	display: block;
}

.rkqb-checkout-summary-info {
	flex: 1 1 auto;
	min-width: 0;
}

.rkqb-checkout-summary-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--rkqb-ink);
	margin: 0 0 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rkqb-checkout-summary-variation,
.rkqb-checkout-summary-qty {
	font-size: 11.5px;
	color: var(--rkqb-muted);
	margin: 0;
}

.rkqb-checkout-summary-price {
	font-size: 13px;
	font-weight: 700;
	color: var(--rkqb-ink);
	white-space: nowrap;
}

.rkqb-checkout-summary-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-top: 1.5px solid var(--rkqb-ink);
	font-size: 13.5px;
}

.rkqb-checkout-summary-total strong {
	color: var(--rkqb-accent);
	font-size: 17px;
}

.rkqb-form-field {
	margin-bottom: 12px;
}

.rkqb-form-field label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--rkqb-muted-soft);
	margin-bottom: 6px;
}

.rkqb-form-field input,
.rkqb-form-field textarea {
	display: block;
	width: 100%;
	height: var(--rkqb-control-h);
	padding: 0 14px;
	border: 1.5px solid var(--rkqb-border);
	border-radius: var(--rkqb-radius-sm);
	font-size: 14px;
	line-height: var(--rkqb-control-h);
	font-family: inherit;
	color: var(--rkqb-ink);
	background: var(--rkqb-bg-field);
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.rkqb-form-field textarea {
	height: var(--rkqb-control-h);
	min-height: var(--rkqb-control-h);
	max-height: 90px;
	padding-top: 12px;
	padding-bottom: 12px;
	line-height: 1.4;
	resize: none;
	overflow-y: auto;
}

.rkqb-form-field input:focus,
.rkqb-form-field textarea:focus {
	outline: none;
	border-color: var(--rkqb-accent);
	background: var(--rkqb-bg);
	box-shadow: 0 0 0 4px var(--rkqb-accent-soft);
}

.rkqb-form-field input::placeholder,
.rkqb-form-field textarea::placeholder {
	color: var(--rkqb-muted-soft);
}

/* ── OTP step ─────────────────────────────────────────────────── */

.rkqb-otp-step {
	text-align: center;
}

.rkqb-otp-note {
	font-size: 13px;
	color: var(--rkqb-muted);
	margin: 0 0 18px;
}

.rkqb-otp-input {
	width: 100%;
	max-width: 200px;
	height: var(--rkqb-control-h);
	margin: 0 auto 16px;
	display: block;
	text-align: center;
	letter-spacing: 0.5em;
	text-indent: 0.5em;
	font-size: 20px;
	font-weight: 700;
	padding: 0 14px;
	border: 1.5px solid var(--rkqb-border);
	border-radius: var(--rkqb-radius-sm);
	background: var(--rkqb-bg-field);
	box-sizing: border-box;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.rkqb-otp-input:focus {
	outline: none;
	border-color: var(--rkqb-accent);
	background: var(--rkqb-bg);
	box-shadow: 0 0 0 4px var(--rkqb-accent-soft);
}

.rkqb-link-btn {
	display: block;
	margin: 16px auto 0;
	background: none;
	border: none;
	color: var(--rkqb-accent);
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ── Loading state ───────────────────────────────────────────── */

.rkqb-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 64px 20px;
	text-align: center;
}

.rkqb-spinner {
	width: 30px;
	height: 30px;
	border: 3px solid var(--rkqb-border);
	border-top-color: var(--rkqb-accent);
	border-radius: 50%;
	animation: rkqb-spin 0.7s linear infinite;
}

@keyframes rkqb-spin {
	to { transform: rotate(360deg); }
}

.rkqb-loading p {
	color: var(--rkqb-muted);
	font-size: 13px;
	margin: 0;
}

/* ── Success state ───────────────────────────────────────────── */

.rkqb-success {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 44px 20px 24px;
	gap: 10px;
}

.rkqb-success-icon {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #16a34a;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	margin-bottom: 6px;
	box-shadow: 0 8px 20px rgba(22, 163, 74, 0.3);
	animation: rkqb-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes rkqb-pop {
	from { transform: scale(0.6); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}

.rkqb-success h3 {
	font-size: 18px;
	margin: 0;
	color: var(--rkqb-ink);
	letter-spacing: -0.01em;
}

.rkqb-success p {
	font-size: 13px;
	color: var(--rkqb-muted);
	margin: 0 0 14px;
}

.rkqb-success .rkqb-modal-actions {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.rkqb-btn-secondary {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 46px;
	border-radius: var(--rkqb-radius-sm);
	border: 1.5px solid var(--rkqb-border);
	background: var(--rkqb-bg);
	color: var(--rkqb-ink);
	font-size: 13.5px;
	font-weight: 600;
	text-align: center;
	text-decoration: none !important;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.rkqb-btn-secondary:hover {
	border-color: var(--rkqb-ink);
	background: var(--rkqb-bg-soft);
}

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