/* ==========================================================
   Brand COD Checkout
   ব্র্যান্ড বদলাতে সাধারণত শুধু নিচের variable-গুলো বদলালেই হয়।
   যেমন: .rcod.brand-kasemi { --rcod-primary:#7c2d12; --rcod-radius:6px; }
   ========================================================== */
.rcod {
	--rcod-primary: #0f6b43;
	--rcod-primary-text: #ffffff;
	--rcod-accent: #f97316;
	--rcod-bg: #ffffff;
	--rcod-surface: color-mix(in srgb, var(--rcod-primary) 6%, #ffffff);
	--rcod-border: color-mix(in srgb, var(--rcod-primary) 18%, #e5e7eb);
	--rcod-text: #1f2937;
	--rcod-muted: #6b7280;
	--rcod-error: #dc2626;
	--rcod-note-bg: #fffbeb;
	--rcod-note-border: #fcd34d;
	--rcod-note-text: #b45309;
	--rcod-radius: 14px;
	--rcod-font: inherit;
	--rcod-gap: 20px;
	--rcod-summary-width: 380px;

	font-family: var(--rcod-font);
	color: var(--rcod-text);
	max-width: 1100px;
	margin: 0 auto;
	box-sizing: border-box;
	scroll-margin-top: 80px;
	container-type: inline-size; /* লেআউট ঠিক হয় ফর্মের নিজের চওড়া দেখে, স্ক্রিন না */
}
.rcod *, .rcod *::before, .rcod *::after { box-sizing: border-box; }

.rcod-title {
	text-align: center;
	font-size: clamp(20px, 3vw, 28px);
	font-weight: 700;
	margin: 0 0 var(--rcod-gap);
	padding-bottom: 14px;
	border-bottom: 2px solid var(--rcod-primary);
	color: var(--rcod-text);
}

/* ---------- লেআউট ---------- */
.rcod-form { display: grid; gap: var(--rcod-gap); align-items: start; }
@container (min-width: 820px) {
	.rcod-layout-two-column .rcod-form { grid-template-columns: minmax(0, 1fr) var(--rcod-summary-width); }
	.rcod-layout-two-column .rcod-summary { position: sticky; top: 24px; }
}
.rcod-main { display: grid; gap: var(--rcod-gap); min-width: 0; }

/* ---------- প্রোডাক্ট কার্ড ---------- */
.rcod-products { display: grid; gap: 12px; }
.rcod-product {
	display: flex; align-items: center; gap: 12px;
	padding: 14px 16px;
	background: var(--rcod-bg);
	border: 2px solid var(--rcod-border);
	border-radius: var(--rcod-radius);
	transition: border-color .15s, background .15s, box-shadow .15s;
}
.rcod-product.is-selected { border-color: var(--rcod-primary); background: var(--rcod-surface); box-shadow: 0 4px 14px color-mix(in srgb, var(--rcod-primary) 12%, transparent); }
.rcod-product.is-out { opacity: .55; }
.rcod-product-select { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; margin: 0; }
.rcod-product-input, .rcod-zone input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rcod-check {
	flex: 0 0 22px; width: 22px; height: 22px;
	border: 2px solid var(--rcod-border); border-radius: 6px;
	background: #fff; position: relative; transition: all .15s;
}
.rcod-product-input[type="radio"] + .rcod-check, .rcod-zone .rcod-check { border-radius: 50%; }
.rcod-product-input:checked + .rcod-check, .rcod-zone input:checked + .rcod-check { border-color: var(--rcod-primary); background: var(--rcod-primary); }
.rcod-product-input:checked + .rcod-check::after, .rcod-zone input:checked + .rcod-check::after {
	content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px;
	border: solid var(--rcod-primary-text); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.rcod-product-input:focus-visible + .rcod-check, .rcod-zone input:focus-visible + .rcod-check { outline: 2px solid var(--rcod-primary); outline-offset: 2px; }
.rcod-product-img { width: 72px; height: 72px; object-fit: cover; border-radius: calc(var(--rcod-radius) * .6); flex: 0 0 72px; }
.rcod-product-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rcod-product-name { font-weight: 600; font-size: 16px; line-height: 1.35; }
.rcod-product-price { font-weight: 700; font-size: 18px; color: var(--rcod-primary); }
.rcod-product-price del { color: var(--rcod-muted); font-weight: 400; font-size: 14px; margin-right: 6px; }
.rcod-stock-out { font-size: 13px; color: var(--rcod-error); }
.rcod-products.is-single .rcod-check { display: none; }

/* ---------- Quantity ---------- */
.rcod-qty { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.rcod-qty-btn {
	width: 32px; height: 32px; padding: 0; border: 0; cursor: pointer;
	border-radius: 8px; background: var(--rcod-accent); color: #fff;
	font-size: 18px; line-height: 1; font-weight: 700;
}
.rcod-qty-btn:hover { filter: brightness(.95); }
.rcod-qty-input {
	width: 42px; height: 32px; text-align: center; border: 0; background: transparent;
	font-weight: 700; font-size: 16px; color: var(--rcod-text); -moz-appearance: textfield; padding: 0;
}
.rcod-qty-input::-webkit-outer-spin-button, .rcod-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- ইনপুট ফিল্ড ---------- */
.rcod-fields { display: grid; gap: 16px; }
.rcod-field label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.rcod-req { color: var(--rcod-error); }
.rcod-field input, .rcod-field textarea {
	width: 100%; padding: 12px 14px; font: inherit; font-size: 16px; /* 16px — মোবাইলে zoom হবে না */
	color: var(--rcod-text); background: #fff;
	border: 1.5px solid var(--rcod-border); border-radius: calc(var(--rcod-radius) * .7);
	transition: border-color .15s, box-shadow .15s; margin: 0;
}
.rcod-field textarea { resize: vertical; min-height: 90px; }
.rcod-field input:focus, .rcod-field textarea:focus { outline: none; border-color: var(--rcod-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rcod-primary) 18%, transparent); }
.rcod-error { display: none; color: var(--rcod-error); font-size: 13px; margin-top: 6px; }
.has-error .rcod-error { display: block; }
.has-error input, .has-error textarea { border-color: var(--rcod-error); }

/* ---------- ডেলিভারি ---------- */
.rcod-zones { display: grid; gap: 10px; }
.rcod-section-label { font-weight: 700; color: var(--rcod-primary); }
.rcod-zone {
	display: flex; align-items: center; gap: 12px; margin: 0; cursor: pointer;
	padding: 14px 16px; background: var(--rcod-bg);
	border: 2px solid var(--rcod-border); border-radius: var(--rcod-radius);
}
.rcod-zone.is-selected { border-color: var(--rcod-primary); background: var(--rcod-surface); }
.rcod-zone-label { flex: 1; font-weight: 600; }
.rcod-zone-cost { font-weight: 700; }

.rcod-hp { position: absolute !important; left: -9999px !important; height: 0; overflow: hidden; }

/* ---------- সামারি ---------- */
.rcod-summary { display: grid; gap: 14px; min-width: 0; }
.rcod-summary-head {
	background: var(--rcod-primary); color: var(--rcod-primary-text);
	padding: 14px 20px; font-weight: 700; font-size: 16px;
	border-radius: var(--rcod-radius) var(--rcod-radius) 0 0;
}
.rcod-summary-body {
	background: var(--rcod-bg); border: 1px solid var(--rcod-border); border-top: 0;
	border-radius: 0 0 var(--rcod-radius) var(--rcod-radius); overflow: hidden;
}
.rcod-summary > .rcod-summary-head + .rcod-summary-body { margin-top: -14px; }
.rcod-item { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rcod-border); }
.rcod-item-img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; flex: 0 0 48px; }
.rcod-item-name { flex: 1; font-size: 14px; font-weight: 600; min-width: 0; }
.rcod-item-qty { color: var(--rcod-muted); font-weight: 400; white-space: nowrap; }
.rcod-item-price { font-weight: 700; white-space: nowrap; }
.rcod-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; font-size: 15px; color: var(--rcod-muted); }
.rcod-row span:last-child { color: var(--rcod-text); font-weight: 600; }
.rcod-row-total { background: var(--rcod-surface); border-top: 2px solid var(--rcod-primary); padding: 16px; font-size: 18px; font-weight: 700; color: var(--rcod-text); }
.rcod-row-total span:last-child { color: var(--rcod-primary); font-size: 22px; }

.rcod-cod-note {
	text-align: center; padding: 12px 14px; font-weight: 600; font-size: 14px;
	background: var(--rcod-note-bg); border: 1.5px solid var(--rcod-note-border);
	color: var(--rcod-note-text); border-radius: calc(var(--rcod-radius) * .7);
}

.rcod-submit {
	width: 100%; padding: 16px 20px; border: 0; cursor: pointer;
	background: var(--rcod-primary); color: var(--rcod-primary-text);
	font: inherit; font-size: 18px; font-weight: 700;
	border-radius: var(--rcod-radius);
	box-shadow: 0 6px 18px color-mix(in srgb, var(--rcod-primary) 30%, transparent);
	transition: transform .1s, filter .15s;
}
.rcod-submit:hover { filter: brightness(1.07); }
.rcod-submit:active { transform: scale(.99); }
.rcod-submit:disabled { background: #9ca3af; box-shadow: none; cursor: not-allowed; }
.is-loading .rcod-submit { opacity: .8; cursor: wait; }
.is-loading .rcod-submit-total { display: none; }
.rcod-message:empty { display: none; }
.rcod-message { text-align: center; font-size: 14px; padding: 10px; border-radius: 8px; }
.rcod-message.is-error { color: var(--rcod-error); background: color-mix(in srgb, var(--rcod-error) 8%, #fff); }

/* মোবাইল */
@container (max-width: 560px) {
	.rcod-form, .rcod-main { gap: 16px; }
	.rcod-product { flex-wrap: wrap; padding: 12px; }
	.rcod-product-img { width: 60px; height: 60px; flex-basis: 60px; }
	.rcod-qty { margin-left: auto; }
}

/* ==========================================================
   থ্যাংক ইউ পেজ
   ========================================================== */
.rcod-ty { max-width: 720px; display: grid; gap: var(--rcod-gap); }
.rcod-ty-hero { text-align: center; padding: 32px 20px; background: var(--rcod-surface); border-radius: var(--rcod-radius); }
.rcod-ty-icon {
	width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%;
	display: grid; place-items: center;
	background: var(--rcod-primary); color: var(--rcod-primary-text);
	box-shadow: 0 0 0 10px color-mix(in srgb, var(--rcod-primary) 15%, transparent);
	animation: rcod-pop .45s ease-out;
}
@keyframes rcod-pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rcod-ty-icon { animation: none; } }
.rcod-ty-heading { font-size: clamp(20px, 3vw, 26px); margin: 0 0 10px; color: var(--rcod-primary); }
.rcod-ty-message { margin: 0; font-size: 16px; line-height: 1.7; color: var(--rcod-text); }
.rcod-ty-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.rcod-ty-meta > div, .rcod-ty-customer > div { display: flex; flex-direction: column; gap: 4px; }
.rcod-ty-meta > div { padding: 14px; border: 1px dashed var(--rcod-border); border-radius: calc(var(--rcod-radius) * .7); background: var(--rcod-bg); }
.rcod-ty-meta span, .rcod-ty-customer span { font-size: 13px; color: var(--rcod-muted); }
.rcod-ty-meta strong { font-size: 16px; }
.rcod-ty-customer { display: grid; gap: 12px; padding: 16px; }
.rcod-ty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.rcod-btn {
	display: inline-block; padding: 12px 22px; text-decoration: none !important;
	background: var(--rcod-primary); color: var(--rcod-primary-text) !important;
	border: 2px solid var(--rcod-primary); border-radius: var(--rcod-radius); font-weight: 700;
}
.rcod-btn-outline { background: transparent; color: var(--rcod-primary) !important; }
.rcod-ty-empty { text-align: center; padding: 24px; color: var(--rcod-muted); }
