/* Checkout — theo demo pcsaaam.netlify.app/saam_checkout
 * Flatsome's own stylesheet (flatsome-main/shop/style.css) loads AFTER this
 * file, so several base rules (buttons, inputs, selects) win ties on equal
 * specificity — key visual properties below use !important to stay on top
 * of that regardless of theme CSS load order.
 */

:root {
	--saam-teal: #0fe6d2;
	--saam-teal-check: #14c9b6;
	--saam-pink: #e6126f;
	--saam-ink: #111111;
	--saam-grey: #6b7280;
	--saam-border: #e7e9e9;
	--saam-bg: #f3f4f4;
}

body.woocommerce-checkout {
	background: var(--saam-bg);
}

.woocommerce-checkout #content.content-area {
	background: var(--saam-bg);
	padding-bottom: 0;
}

.saam-checkout-form,
.saam-checkout-form *,
.saam-checkout-steps {
	box-sizing: border-box;
}

/* Step indicator */
.saam-checkout-steps {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 28px 20px 8px;
}

.saam-checkout-step {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
	font-size: 15px;
}

.saam-checkout-step.is-active {
	background: var(--saam-teal) !important;
	color: #ffffff !important;
	padding: 10px 22px 10px 10px;
	border-radius: 999px;
}

.saam-checkout-step.is-disabled {
	background: #e3e6e6 !important;
	color: #9aa1a1 !important;
	padding: 10px 22px 10px 10px;
	border-radius: 999px;
}

.saam-checkout-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #ffffff !important;
	color: var(--saam-teal) !important;
	font-size: 13px;
}

.saam-checkout-step.is-disabled .saam-checkout-step-num {
	color: #9aa1a1 !important;
}

.saam-checkout-step-line {
	width: 60px;
	height: 1px;
	background: #cfd3d3;
}

/* Layout */
.saam-checkout-form {
	max-width: 1200px;
	margin: 0 auto;
}

.saam-checkout-grid {
	display: grid;
	grid-template-columns: 1.55fr 1fr;
	gap: 32px;
	align-items: start;
}

.saam-checkout-heading {
	font-size: 22px;
	font-weight: 800;
	color: var(--saam-ink);
	margin: 0 0 16px;
}

.saam-checkout-sidebar {
	display: flex;
	flex-direction: column;
}

.woocommerce-checkout-review-order {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Card base */
.saam-card {
	background: #ffffff !important;
	border-radius: 14px;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
	padding: 24px;
}

.saam-card h3 {
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 800;
	color: var(--saam-ink);
}

.saam-divider {
	border: none;
	border-top: 1px solid var(--saam-border);
	margin: 0 0 18px;
}

/* Billing fields */
.saam-checkout-billing-card .woocommerce-billing-fields__field-wrapper {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.saam-checkout-billing-card .form-row {
	margin: 0;
	padding: 0;
	width: 100%;
	order: 0;
}

/* Một số rule mặc định của theme gán "order" theo loại field (select field
 * xem là "wide" khác với text field) khiến field bị đảo vị trí dù DOM đã
 * đúng thứ tự — ghim cứng lại đúng thứ tự mong muốn. */
#billing_first_name_field {
	order: 1 !important;
}

#billing_phone_field {
	order: 2 !important;
}

#billing_address_1_field {
	order: 3 !important;
}

#billing_country_field {
	order: 4 !important;
}

.saam-checkout-billing-card label {
	display: block;
	font-weight: 700;
	font-size: 14px;
	color: var(--saam-ink);
	margin-bottom: 8px;
}

.saam-checkout-billing-card label .required {
	color: var(--saam-pink);
	text-decoration: none;
}

.saam-checkout-billing-card .woocommerce-input-wrapper {
	display: block;
	width: 100%;
}

.saam-checkout-billing-card input.input-text,
.saam-checkout-billing-card select,
.saam-checkout-billing-card .select2-selection {
	width: 100% !important;
	height: 48px !important;
	border: 1px solid var(--saam-border) !important;
	border-radius: 8px !important;
	padding: 0 16px !important;
	font-size: 14px;
	background: #ffffff !important;
	color: var(--saam-ink) !important;
	box-shadow: none !important;
}

.saam-checkout-billing-card .select2-selection {
	display: flex;
	align-items: center;
}

.saam-checkout-billing-card .select2-selection__rendered {
	padding: 0 !important;
	line-height: normal !important;
}

.saam-checkout-billing-card .select2-selection__arrow {
	height: 46px !important;
}

.saam-checkout-billing-card input.input-text:focus,
.saam-checkout-billing-card select:focus {
	outline: none;
	border-color: var(--saam-teal-check) !important;
}

.saam-checkout-billing-card input.input-text::placeholder {
	color: #a3a8a8;
}

/* Order information card */
.saam-order-items {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 16px;
}

.saam-order-item {
	display: flex;
	gap: 12px;
}

.saam-order-item-thumb {
	width: 64px;
	height: 64px;
	flex: 0 0 64px;
	border-radius: 8px;
	overflow: hidden;
	background: #f3f4f4;
}

.saam-order-item-thumb img {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	margin: 0 !important;
}

.saam-order-item-info {
	flex: 1;
	min-width: 0;
}

.saam-order-item-name {
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 700;
	color: var(--saam-ink);
	line-height: 1.35;
}

.saam-order-item-meta {
	margin: 0 0 4px;
	font-size: 12px;
	color: var(--saam-grey);
	font-style: italic;
	display: flex;
	gap: 12px;
}

.saam-order-item-meta strong {
	font-style: normal;
	color: #4b5252;
}

.saam-order-item-price {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: var(--saam-ink);
}

.saam-order-subtotal-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
}

.saam-order-subtotal-row strong {
	font-size: 18px;
}

/* Coupon card */
form.checkout_coupon.saam-coupon-form {
	display: flex !important;
	align-items: stretch;
	gap: 10px;
	margin: 0 !important;
	border: none !important;
	padding: 0 !important;
	background: none !important;
}

.saam-coupon-form #coupon_code {
	flex: 1;
	height: 48px !important;
	border: 1px solid var(--saam-border) !important;
	border-radius: 8px !important;
	padding: 0 16px !important;
	background: var(--saam-bg) !important;
	color: var(--saam-ink) !important;
	font-size: 14px;
	box-shadow: none !important;
}

button.saam-coupon-apply-btn {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 auto;
	height: 48px;
	padding: 0 26px;
	background: var(--saam-ink) !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 8px;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: pointer;
}

button.saam-coupon-apply-btn:hover {
	background: #000000 !important;
}

/* Checkbox-style rows (shipping / payment method) */
.saam-checkbox-row {
	display: flex;
	align-items: center;
	gap: 12px;
	position: relative;
	padding: 6px 0;
}

.saam-checkbox-input {
	position: absolute;
	opacity: 0;
	width: 26px;
	height: 26px;
	margin: 0;
	cursor: pointer;
}

.saam-checkbox-icon {
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	border-radius: 7px;
	border: 1.5px solid var(--saam-border);
	background: #ffffff !important;
	position: relative;
}

.saam-checkbox-row.is-checked .saam-checkbox-icon {
	background: var(--saam-teal-check) !important;
	border-color: var(--saam-teal-check);
}

.saam-checkbox-row.is-checked .saam-checkbox-icon::after {
	content: "";
	position: absolute;
	left: 8px;
	top: 3px;
	width: 6px;
	height: 12px;
	border: solid #ffffff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.saam-checkbox-row label,
.saam-payment-desc-text {
	font-size: 14px;
	font-style: italic;
	color: #4b5252;
	margin: 0;
}

.saam-checkbox-row--static {
	opacity: 0.9;
}

.saam-shipping-method-list,
.saam-payment-methods {
	list-style: none;
	margin: 0;
	padding: 0;
}

.saam-payment-methods li {
	margin-bottom: 4px;
}

/* Total row */
.saam-checkout-total-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--saam-bg) !important;
	margin: 18px -24px;
	padding: 16px 24px;
	font-size: 15px;
	font-weight: 800;
	color: var(--saam-ink);
}

.saam-checkout-total-row strong {
	font-size: 20px;
	color: var(--saam-pink) !important;
}

.saam-checkout-payment-card h3:not(:first-child) {
	margin-top: 22px;
}

/* Place order */
.saam-checkout-payment-card .form-row.place-order {
	margin: 22px 0 0;
	padding: 0;
}

button.saam-place-order-btn {
	appearance: none;
	-webkit-appearance: none;
	display: block;
	width: 100%;
	height: 54px;
	background: var(--saam-pink) !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: pointer;
}

button.saam-place-order-btn:hover {
	background: #c60f5f !important;
}

/* Responsive */
@media (max-width: 900px) {
	.saam-checkout-grid {
		grid-template-columns: 1fr;
	}

	.saam-checkout-steps {
		gap: 8px;
	}

	.saam-checkout-step-line {
		width: 30px;
	}
}
