/* ════════════════════════════════════════════════════════
   QUICK ORDER POPUP — Single-click checkout for BD COD
   ════════════════════════════════════════════════════════ */

/* ─── Trigger button on product page ─── */
.olb-qo-trigger {
	background: linear-gradient(135deg, #f59e0b, #ea580c);
	color: white;
	border: none;
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 800;
	border-radius: 12px;
	cursor: pointer;
	margin-left: 8px;
	box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
	transition: all 0.2s;
	font-family: inherit;
	display: inline-block;
	vertical-align: middle;
}
.olb-qo-trigger:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
	background: linear-gradient(135deg, #ea580c, #c2410c);
}
.olb-qo-trigger:active { transform: translateY(0); }

@media (max-width: 600px) {
	.olb-qo-trigger {
		display: block;
		width: 100%;
		margin: 12px 0 0;
	}
}

/* ─── Modal overlay ─── */
.olb-qo-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.olb-qo-modal.is-open { display: flex; }
.olb-qo-modal[aria-hidden="true"] { display: none; }
.olb-qo-modal.is-open[aria-hidden="false"] { display: flex; }

.olb-qo-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.7);
	backdrop-filter: blur(4px);
	animation: olbQoFadeIn 0.25s ease;
}
.olb-qo-dialog {
	position: relative;
	background: white;
	border-radius: 18px;
	max-width: 940px;
	width: 100%;
	max-height: 92vh;
	overflow-y: auto;
	box-shadow: 0 20px 50px rgba(0,0,0,0.4);
	animation: olbQoSlideUp 0.3s cubic-bezier(.22,.61,.36,1);
	-webkit-overflow-scrolling: touch;
}
@keyframes olbQoFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}
@keyframes olbQoSlideUp {
	from { transform: translateY(30px); opacity: 0; }
	to   { transform: translateY(0); opacity: 1; }
}

/* ─── Close button ─── */
.olb-qo-close {
	position: absolute;
	top: 12px;
	right: 16px;
	background: rgba(15, 23, 42, 0.08);
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 28px;
	line-height: 1;
	color: #475569;
	transition: all 0.2s;
	z-index: 10;
	font-family: inherit;
}
.olb-qo-close:hover { background: #fee2e2; color: #dc2626; transform: rotate(90deg); }

/* ─── Header ─── */
.olb-qo-head {
	background: linear-gradient(135deg, #16a34a, #15803d);
	color: white;
	padding: 22px 28px;
	display: flex;
	align-items: center;
	gap: 16px;
	border-radius: 18px 18px 0 0;
}
.olb-qo-head-icon {
	width: 56px;
	height: 56px;
	background: rgba(255,255,255,0.18);
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	flex-shrink: 0;
	backdrop-filter: blur(8px);
}
.olb-qo-title {
	margin: 0;
	color: white;
	font-size: 22px;
	font-weight: 800;
}
.olb-qo-sub {
	margin: 4px 0 0;
	color: rgba(255,255,255,0.9);
	font-size: 13px;
}

/* ─── Body grid: form (left) + summary (right) ─── */
.olb-qo-body {
	display: grid;
	grid-template-columns: 1.3fr 1fr;
	gap: 0;
	min-height: 480px;
}
@media (max-width: 800px) {
	.olb-qo-body { grid-template-columns: 1fr; }
}

/* ─── Form fields ─── */
.olb-qo-fields {
	padding: 24px 28px;
	border-right: 1px solid #e2e8f0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
@media (max-width: 800px) { .olb-qo-fields { border-right: none; border-bottom: 1px solid #e2e8f0; } }

.olb-qo-field { display: flex; flex-direction: column; gap: 6px; }
.olb-qo-field label {
	font-size: 13px;
	font-weight: 700;
	color: #334155;
}
.olb-qo-field label .req { color: #dc2626; }
.olb-qo-field input,
.olb-qo-field textarea,
.olb-qo-field select {
	width: 100%;
	padding: 11px 14px;
	border: 2px solid #e2e8f0;
	border-radius: 10px;
	font-size: 15px;
	font-family: inherit;
	color: #1e293b;
	background: white;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.olb-qo-field input:focus,
.olb-qo-field textarea:focus,
.olb-qo-field select:focus {
	outline: none;
	border-color: #16a34a;
	box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.1);
}
.olb-qo-field input.is-invalid,
.olb-qo-field textarea.is-invalid,
.olb-qo-field select.is-invalid {
	border-color: #dc2626;
	background: #fef2f2;
}
.olb-qo-field textarea { resize: vertical; min-height: 60px; }
.olb-qo-field select:disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }

.olb-qo-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
@media (max-width: 500px) { .olb-qo-row { grid-template-columns: 1fr; } }

.olb-qo-err {
	font-size: 12px;
	color: #dc2626;
	font-weight: 600;
	min-height: 16px;
}

/* Quantity stepper */
.olb-qo-qty {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 160px;
}
.olb-qo-qty-btn {
	width: 38px;
	height: 38px;
	border-radius: 8px;
	border: 2px solid #e2e8f0;
	background: white;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
	color: #334155;
	transition: all 0.15s;
	font-family: inherit;
}
.olb-qo-qty-btn:hover { background: #16a34a; color: white; border-color: #16a34a; }
.olb-qo-qty input {
	width: 60px;
	text-align: center;
	font-weight: 700;
}

/* ─── Order summary (right column) ─── */
.olb-qo-summary {
	background: linear-gradient(180deg, #f0fdf4, #ffffff);
	padding: 24px 28px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.olb-qo-summary-title {
	font-size: 16px;
	font-weight: 800;
	color: #15803d;
	margin: 0;
}

.olb-qo-product {
	display: flex;
	gap: 12px;
	align-items: center;
	background: white;
	padding: 12px;
	border-radius: 10px;
	border: 1px solid #d1fae5;
}
.olb-qo-product img {
	width: 60px;
	height: 60px;
	border-radius: 8px;
	object-fit: cover;
	background: #f1f5f9;
}
.olb-qo-product-name { font-weight: 700; font-size: 14px; color: #1e293b; line-height: 1.3; }
.olb-qo-product-qty { font-size: 12px; color: #64748b; margin-top: 4px; }

.olb-qo-rows {
	background: white;
	border-radius: 10px;
	padding: 14px 16px;
	border: 1px solid #d1fae5;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.olb-qo-srow {
	display: flex;
	justify-content: space-between;
	font-size: 14px;
	color: #475569;
}
.olb-qo-srow span:last-child { font-weight: 600; color: #1e293b; }
.olb-qo-total {
	padding-top: 10px;
	border-top: 2px dashed #d1fae5;
	font-size: 16px !important;
	font-weight: 800 !important;
}
.olb-qo-total span:last-child {
	color: #15803d !important;
	font-size: 22px !important;
	font-weight: 900 !important;
}

.olb-qo-cod-badge {
	background: linear-gradient(135deg, #fef3c7, #fde68a);
	color: #92400e;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	border: 1px dashed #f59e0b;
}

.olb-qo-submit {
	background: linear-gradient(135deg, #16a34a, #15803d);
	color: white;
	border: none;
	padding: 16px 24px;
	font-size: 17px;
	font-weight: 800;
	border-radius: 12px;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(22, 163, 74, 0.4);
	transition: all 0.2s;
	font-family: inherit;
	width: 100%;
}
.olb-qo-submit:hover {
	background: linear-gradient(135deg, #15803d, #166534);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(22, 163, 74, 0.5);
}
.olb-qo-submit:disabled {
	background: #94a3b8;
	cursor: wait;
	box-shadow: none;
	transform: none;
}

.olb-qo-trust {
	font-size: 11px;
	color: #64748b;
	text-align: center;
	line-height: 1.5;
}

/* ─── Loading state ─── */
.olb-qo-loading {
	position: absolute;
	inset: 0;
	background: rgba(255,255,255,0.95);
	display: none; /* hidden by default — show via .is-active class */
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border-radius: 18px;
	gap: 16px;
	z-index: 20;
}
.olb-qo-loading.is-active { display: flex; }
.olb-qo-loading[hidden] { display: none !important; }
.olb-qo-loading p { font-size: 16px; font-weight: 700; color: #15803d; }
.olb-qo-spinner {
	width: 50px;
	height: 50px;
	border: 5px solid #d1fae5;
	border-top-color: #16a34a;
	border-radius: 50%;
	animation: olbQoSpin 0.8s linear infinite;
}
@keyframes olbQoSpin { to { transform: rotate(360deg); } }

/* ─── Body scroll lock when modal open ─── */
body.olb-qo-locked { overflow: hidden; position: fixed; width: 100%; }

/* ════════════════════════════════════════════════════════
   MOBILE-PERFECT — full-screen modal, big touch targets
   ════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
	.olb-qo-modal { padding: 0; }
	.olb-qo-dialog {
		max-width: 100%;
		width: 100%;
		height: 100vh;
		height: 100dvh; /* dynamic viewport — accounts for mobile keyboard */
		max-height: 100vh;
		max-height: 100dvh;
		border-radius: 0;
		display: flex;
		flex-direction: column;
	}
	.olb-qo-overlay { display: none; } /* full-screen — no overlay needed */
	.olb-qo-head {
		border-radius: 0;
		padding: 16px 20px;
		padding-top: calc(16px + env(safe-area-inset-top));
		flex-shrink: 0;
	}
	.olb-qo-head-icon { width: 44px; height: 44px; font-size: 22px; }
	.olb-qo-title { font-size: 18px; }
	.olb-qo-sub { font-size: 12px; }
	.olb-qo-close {
		top: calc(8px + env(safe-area-inset-top));
		right: 12px;
		background: rgba(255, 255, 255, 0.25);
		color: white;
		width: 40px;
		height: 40px;
	}
	.olb-qo-close:hover { background: rgba(255, 255, 255, 0.4); color: white; }
	.olb-qo-body {
		flex: 1;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		grid-template-columns: 1fr;
	}
	.olb-qo-fields {
		padding: 18px 16px;
		gap: 14px;
		border-right: none;
		border-bottom: none;
	}
	.olb-qo-field label { font-size: 14px; }
	.olb-qo-field input,
	.olb-qo-field textarea,
	.olb-qo-field select {
		padding: 14px;
		font-size: 16px; /* prevent iOS zoom */
		border-radius: 10px;
		min-height: 50px;
	}
	.olb-qo-field textarea { min-height: 70px; }
	.olb-qo-row { grid-template-columns: 1fr 1fr; gap: 10px; }
	.olb-qo-qty-btn { width: 44px; height: 44px; font-size: 20px; }
	.olb-qo-qty input { width: 60px; min-height: 44px; }
	.olb-qo-summary {
		padding: 16px;
		border-top: 8px solid #f0fdf4;
		position: sticky;
		bottom: 0;
		background: white;
	}
	.olb-qo-submit {
		padding: 18px 24px;
		font-size: 17px;
		min-height: 56px;
	}
	.olb-qo-trust { font-size: 10px; }
}

/* Very small phones (≤380px) — extra tight */
@media (max-width: 380px) {
	.olb-qo-row { grid-template-columns: 1fr; }
	.olb-qo-stat-row { grid-template-columns: 1fr; }
}

/* Reduce confetti / animations on mobile for performance */
@media (max-width: 600px) {
	.olb-qo-dialog { animation-duration: 0.2s; }
}
