/* Checkout — Woo-style flow */

.cb-checkout-page {
	max-width: 1180px;
	margin: 8px auto 48px;
	padding: 0 16px;
	box-sizing: border-box;
	--cb-ck-ink: #1a1a1a;
	--cb-ck-muted: #6b7280;
	--cb-ck-line: #e8e4de;
	--cb-ck-wash: #f7f5f2;
}

.cb-checkout-wrapper {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
	gap: 28px;
	align-items: start;
}

.cb-checkout-panel {
	background: #fff;
	border: 1px solid var(--cb-ck-line);
	border-radius: 4px;
	padding: 22px 20px;
	margin-bottom: 20px;
}

.cb-checkout-panel h2,
.cb-address-header h2,
.cb-order-summary h3,
.cb-payment-methods h3 {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 700;
	color: var(--cb-ck-ink);
}

.cb-address-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-bottom: 4px;
}

.cb-address-header h2 {
	margin: 0;
}

.cb-address-btn,
.cb-empty-address .cb-btn {
	border: 0;
	outline: none;
	background: var(--cb-primary, #1f4b7a);
	color: #fff;
	padding: 10px 16px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.cb-address-btn:hover,
.cb-empty-address .cb-btn:hover {
	filter: brightness(0.94);
}

.cb-checkout-address {
	margin-top: 14px;
}

.cb-address-card {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	border: 1px solid var(--cb-ck-line);
	border-radius: 4px;
	padding: 16px;
	margin-bottom: 12px;
	cursor: pointer;
	background: #fff;
	transition: 0.2s ease;
}

.cb-address-card:hover,
.cb-address-card:has(input:checked) {
	border-color: var(--cb-primary, #1f4b7a);
	box-shadow: 0 0 0 1px var(--cb-primary, #1f4b7a);
}

.cb-address-content {
	flex: 1;
	min-width: 0;
}

.cb-address-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.cb-address-card p {
	margin: 4px 0;
	color: #4b5563;
	font-size: 14px;
	line-height: 1.55;
}

.cb-edit-address {
	background: #f0f0f0;
	color: #333;
	border: 1px solid #ccc;
	padding: 6px 12px;
	cursor: pointer;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.cb-edit-address:hover {
	background: #4a4a4a;
	color: #fff;
	border-color: #333;
}

.cb-empty-address {
	padding: 18px;
	border: 1px dashed var(--cb-ck-line);
	border-radius: 4px;
	text-align: center;
	color: var(--cb-ck-muted);
}

.cb-checkout-store-name {
	margin: 0 0 12px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--cb-ck-muted);
}

.cb-product-card {
	display: flex;
	gap: 14px;
	border: 1px solid var(--cb-ck-line);
	padding: 14px;
	margin-bottom: 12px;
	border-radius: 4px;
	background: #fff;
}

.cb-product-card img,
.cb-product-card .cb-cart-image-placeholder {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid var(--cb-ck-line);
	flex-shrink: 0;
	background: var(--cb-ck-wash);
}

.cb-product-info {
	flex: 1;
	min-width: 0;
}

.cb-product-info h4 {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--cb-ck-ink);
}

.cb-price {
	font-size: 15px;
	font-weight: 700;
	margin-bottom: 10px;
}

.cb-checkout-page .cb-cart-qty {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.cb-checkout-page .cb-cart-qty button {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 32px;
	height: 32px;
	padding: 0 !important;
	margin: 0;
	border: 1px solid var(--cb-ck-line);
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	font-size: 16px;
	line-height: 1 !important;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
}

.cb-checkout-page .cb-cart-qty span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 32px;
	padding: 0;
	text-align: center;
	font-weight: 700;
	line-height: 1;
}

.cb-checkout-right {
	position: sticky;
	top: 96px;
}

.cb-order-summary,
.cb-payment-methods {
	border: 1px solid var(--cb-ck-line);
	border-radius: 4px;
	padding: 20px;
	margin-bottom: 16px;
	background: #fff;
}

.cb-summary-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
	font-size: 14px;
	color: var(--cb-ck-ink);
}

.cb-summary-discount span:last-child {
	color: #15803d;
	font-weight: 700;
}

.cb-order-summary hr {
	border: 0;
	border-top: 1px solid var(--cb-ck-line);
	margin: 8px 0 14px;
}

.cb-summary-total {
	display: flex;
	justify-content: space-between;
	font-size: 17px;
}

.cb-payment-methods label {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	font-size: 14px;
	cursor: pointer;
}

#cb-partial-box {
	margin-bottom: 16px;
	padding: 14px;
	border: 1px solid var(--cb-ck-line);
	border-radius: 4px;
	background: #fff;
}

#cb-partial-box label {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
}

#cb-partial-box input,
#cb-address-form input,
#cb-address-form textarea {
	width: 100%;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	padding: 12px 14px;
	font-size: 15px;
	outline: none;
	box-sizing: border-box;
	background: #fff;
}

#cb-pay-now {
	width: 100%;
	min-height: 48px;
	padding: 0 18px;
	border: 0;
	border-radius: 4px;
	background: var(--cb-primary, #1f4b7a);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
}

#cb-pay-now:hover {
	filter: brightness(0.94);
}

#cb-pay-now.loading {
	opacity: 0.7;
	cursor: not-allowed;
}

.cb-checkout-note {
	margin: 14px 0 0;
	text-align: center;
	font-size: 14px;
}

.cb-checkout-note a {
	color: var(--cb-primary, #1f4b7a) !important;
	text-decoration: none !important;
	font-weight: 600;
}

.cb-popup {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.55);
	z-index: 999999;
	display: none;
	justify-content: center;
	align-items: center;
	padding: 20px;
}

.cb-popup.show {
	display: flex;
}

.cb-popup-content {
	width: 100%;
	max-width: 550px;
	background: #fff;
	border-radius: 8px;
	padding: 28px;
	position: relative;
	max-height: 90vh;
	overflow-y: auto;
}

.cb-close-popup {
	position: absolute;
	right: 18px;
	top: 15px;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	color: #666;
}

#popup-title {
	margin: 0 0 20px;
	font-size: 22px;
	font-weight: 700;
	color: var(--cb-ck-ink);
}

#cb-address-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

#cb-address-form textarea {
	min-height: 100px;
	resize: vertical;
}

#cb-address-form button {
	border: none;
	background: var(--cb-primary, #1f4b7a);
	color: #fff;
	padding: 14px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
}

@media (max-width: 900px) {
	.cb-checkout-wrapper {
		grid-template-columns: 1fr;
	}

	.cb-checkout-right {
		position: static;
	}
}

@media (max-width: 768px) {
	.cb-address-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.cb-address-btn {
		width: 100%;
	}

	.cb-address-card {
		flex-direction: column;
	}

	.cb-edit-address {
		width: 100%;
	}
}
