/* ---------- Page head ---------- */
.checkout-page { padding: 30px 24px 70px; }
.checkout-back { display: inline-flex; align-items: center; gap: 6px; color: var(--color-muted); font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }
.checkout-back:hover { color: var(--color-primary); }
.checkout-page__title { font-size: 34px; margin: 0 0 12px; }
.checkout-location-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--color-muted); margin: 0 0 24px; }
.checkout-location-note .lntm-icon { color: var(--color-primary); flex-shrink: 0; }
.checkout-location-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px dashed var(--color-border); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 12.5px; color: var(--color-muted); cursor: pointer; }
.checkout-location-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.checkout-location-btn.is-done { border-style: solid; border-color: #16a34a; color: #16a34a; }

/* ---------- Grid layout: details (top-left) / payment (bottom-left) / summary (right, spans both rows) ---------- */
.checkout-layout {
	display: grid; grid-template-columns: 1fr 380px; column-gap: 28px; row-gap: 0; align-items: start;
	grid-template-areas: "details summary" "payment summary";
}
#order_review { display: contents; }
.checkout-review-wrap { display: contents; }
.checkout-card--details { grid-area: details; margin-bottom: 24px; }
.checkout-card--payment { grid-area: payment; }
.checkout-card--summary { grid-area: summary; position: sticky; top: 90px; }

.checkout-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 28px; }
.checkout-card h2 { font-size: 19px; margin: 0 0 20px; }
/* WooCommerce's own "Billing details" sub-heading — redundant since our
   card is already titled "Delivery Details". */
.checkout-fields-grid .woocommerce-billing-fields h3,
.checkout-fields-grid > h3 { display: none; }

/* ---------- Delivery details form ---------- */
.checkout-fields-grid .form-row { margin-bottom: 16px; }
.checkout-fields-grid .form-row-first, .checkout-fields-grid .form-row-last { width: calc(50% - 8px); display: inline-block; vertical-align: top; }
.checkout-fields-grid .form-row-first { margin-right: 16px; }
.checkout-fields-grid .form-row-wide { width: 100%; clear: both; }
.checkout-fields-grid label {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden;
	padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
} /* visually hidden but still read by screen readers — placeholders carry the visual label, per the reference design */
.checkout-fields-grid label.woocommerce-form__label-for-checkbox { position: static !important; clip: auto; clip-path: none; width: auto; height: auto; margin: 0; display: inline-flex; }
.checkout-fields-grid .required { display: none; }
.checkout-fields-grid input[type="text"],
.checkout-fields-grid input[type="email"],
.checkout-fields-grid input[type="tel"],
.checkout-fields-grid input[type="password"],
.checkout-fields-grid input[type="number"],
.checkout-fields-grid input[type="url"],
.checkout-fields-grid textarea,
.checkout-fields-grid select {
	width: 100%; padding: 14px 16px; border: 1px solid var(--color-border); border-radius: 12px;
	font-family: var(--font-body); font-size: 14.5px; background: #fff; transition: border-color var(--speed-fast);
}
.checkout-fields-grid input:focus, .checkout-fields-grid textarea:focus, .checkout-fields-grid select:focus { outline: none; border-color: var(--color-primary); }
.checkout-fields-grid textarea { min-height: 96px; resize: vertical; }
.checkout-fields-grid select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239CA3AF' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }
.checkout-fields-grid .woocommerce-input-wrapper { display: block; }
.checkout-fields-grid .woocommerce-invalid input, .checkout-fields-grid .woocommerce-invalid select { border-color: var(--color-sale); }
#order_comments_field { margin-top: 4px; }

/* ---------- Order Summary card ---------- */
.checkout-summary__items { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--color-bg-soft); }
.checkout-summary__item { display: flex; align-items: center; gap: 12px; }
.checkout-summary__thumb { width: 52px; height: 52px; border-radius: var(--radius-sm); background: var(--color-bg-soft); overflow: hidden; flex-shrink: 0; }
.checkout-summary__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.checkout-summary__item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.checkout-summary__item-body strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checkout-summary__item-body span { font-size: 12px; color: var(--color-muted); }
.checkout-summary__item-price { font-size: 13.5px; font-weight: 700; white-space: nowrap; }

.checkout-summary__row { display: flex; justify-content: space-between; align-items: flex-start; font-size: 14px; color: var(--color-text); padding: 7px 0; }
.checkout-summary__row span { color: var(--color-muted); flex-shrink: 0; padding-top: 2px; }
.checkout-summary__row .woocommerce-Price-amount { font-weight: 700; }

/* Real WooCommerce shipping method list — styled as clean selectable rows
   instead of the raw default bulleted list, whether there's one flat rate
   or several methods (e.g. Free Shipping vs Flat Rate) to choose from. */
.checkout-summary__row:has(#shipping_method) { flex-direction: column; align-items: stretch; }
.checkout-summary__row:has(#shipping_method) > span:first-child { margin-bottom: 8px; }
#shipping_method { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#shipping_method li { font-size: 13.5px; }
#shipping_method li > p.woocommerce-shipping-fields__shipping-method-label,
#shipping_method > li > strong:first-child { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--color-muted); font-weight: 700; margin-bottom: 6px; }
#shipping_method label {
	display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer;
	border: 1.5px solid var(--color-border); border-radius: 10px; padding: 10px 14px; font-weight: 600; transition: border-color var(--speed-fast), background var(--speed-fast);
}
#shipping_method input[type="radio"] { accent-color: var(--color-primary); margin-right: 8px; flex-shrink: 0; }
#shipping_method input[type="radio"]:checked + label,
#shipping_method li:has(input[type="radio"]:checked) label { border-color: var(--color-primary); background: rgba(11,95,255,.05); }
#shipping_method .woocommerce-help-tip { margin-left: 6px; }
.checkout-summary__row--coupon strong { color: var(--color-green); }
.checkout-summary__total { display: flex; justify-content: space-between; align-items: center; padding: 16px 0 4px; margin-top: 8px; border-top: 1px solid var(--color-border); }
.checkout-summary__total span { font-size: 15px; font-weight: 700; }
.checkout-summary__total strong { font-size: 24px; color: var(--color-primary); font-family: var(--font-heading); }
.checkout-summary__note { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 12.5px; color: var(--color-muted); margin: 16px 0 0; }
.checkout-summary__note .lntm-icon { color: var(--color-primary); }

/* ---------- Payment method cards (real WooCommerce gateways) ---------- */
.checkout-payment__methods { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.checkout-payment__methods .wc_payment_method { position: relative; }
.checkout-payment__methods input.input-radio { position: absolute; top: 18px; left: 18px; width: 18px; height: 18px; accent-color: var(--color-primary); z-index: 2; }
.checkout-payment__methods label {
	display: block; border: 1.5px solid var(--color-border); border-radius: var(--radius); padding: 18px 18px 18px 44px;
	cursor: pointer; transition: border-color var(--speed-fast), background var(--speed-fast); font-weight: 700; font-size: 14.5px;
}
.checkout-payment__methods input.input-radio:checked ~ label,
.checkout-payment__methods li:has(input.input-radio:checked) label { border-color: var(--color-primary); background: rgba(11,95,255,.05); }
.checkout-payment__methods .payment_box { grid-column: 1 / -1; margin-top: -4px; padding: 14px 16px; background: var(--color-bg-soft); border-radius: 0 0 var(--radius-sm) var(--radius-sm); font-size: 13px; color: var(--color-muted); }
.checkout-payment__methods .payment_box p { margin: 0; }

/* COD advance-payment trust notice — only shown while Cash on Delivery
   is the selected method; editable/removable at Customize > Checkout Page. */
.cod-notice { display: none; align-items: flex-start; gap: 12px; background: #FFF7E6; border: 1px solid #F5D48A; border-radius: var(--radius-sm); padding: 16px 18px; margin: -6px 0 20px; }
.checkout-payment:has(#payment_method_cod:checked) .cod-notice { display: flex; }
.cod-notice__icon { color: #B7791F; font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.cod-notice p { margin: 0; font-size: 13.5px; color: #7A5300; line-height: 1.6; }
.cod-notice__en { font-weight: 600; margin-bottom: 4px !important; }
.cod-notice__ur { font-size: 14.5px !important; font-weight: 600; }

/* WooCommerce's own "Have a coupon?" toggle + form on checkout — restyled
   to match the site instead of the default plain WooCommerce look. */
.checkout-page .woocommerce-form-coupon-toggle { margin-bottom: 20px; }
.checkout-page .woocommerce-form-coupon-toggle .woocommerce-info {
	background: #E8F8EE; color: #146C43; border: none; border-radius: 12px; padding: 14px 18px; font-size: 13.5px; font-weight: 600; list-style: none; margin: 0;
}
.checkout-page .showcoupon { color: #146C43; text-decoration: underline; }
.checkout-page .woocommerce-form-coupon { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; max-width: 480px; }
.checkout-page .woocommerce-form-coupon p { margin: 0 0 12px; }
.checkout-page .woocommerce-form-coupon input#coupon_code { width: 100%; padding: 12px 16px; border: 1px solid var(--color-border); border-radius: 999px; font-family: var(--font-body); font-size: 14px; }
.checkout-page .woocommerce-form-coupon button[name="apply_coupon"] { background: var(--color-dark); color: #fff; border: none; border-radius: 999px; padding: 11px 24px; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.checkout-page .woocommerce-form-coupon button[name="apply_coupon"]:hover { filter: brightness(1.2); }

.place-order { margin-top: 6px; }
.wc-terms-and-conditions-wrapper { margin-bottom: 16px; font-size: 13px; color: var(--color-muted); }
.checkout-place-order { width: 100%; padding: 16px; font-size: 15.5px; justify-content: center; }
.checkout-place-order.disabled, .checkout-place-order:disabled { opacity: .6; pointer-events: none; }

/* WooCommerce's own inline validation / error notices */
.woocommerce-NoticeGroup, .woocommerce-error, .woocommerce-message, .woocommerce-info { list-style: none; margin: 0 0 20px; padding: 14px 18px; border-radius: 10px; font-size: 13.5px; grid-column: 1 / -1; }
.woocommerce-error { background: #FDECEC; color: #B42318; }
.woocommerce-message, .woocommerce-info { background: #E8F8EE; color: #146C43; }

/* Google Places autocomplete dropdown polish */
.pac-container { border-radius: 12px; margin-top: 4px; border: 1px solid var(--color-border); box-shadow: var(--shadow-lg); font-family: var(--font-body); }
.pac-item { padding: 8px 12px; font-size: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.checkout-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "details" "summary" "payment"; }
	.checkout-layout > *, .checkout-card { min-width: 0; }
	.checkout-card--summary { position: static; margin-bottom: 24px; }
}
@media (max-width: 600px) {
	.checkout-page { padding: 20px 16px 50px; }
	.checkout-page__title { font-size: 26px; }
	.checkout-card { padding: 20px; }
	.checkout-fields-grid .form-row-first, .checkout-fields-grid .form-row-last { width: 100%; margin-right: 0; }
	.checkout-payment__methods { grid-template-columns: 1fr; }
}

/* Province (select2 / selectWoo) — match the other checkout fields (v5.40.0) */
.checkout-fields-grid .select2-container { width: 100% !important; }
.checkout-fields-grid .select2-container--default .select2-selection--single { height: auto; min-height: 50px; display: flex; align-items: center; padding: 0 40px 0 16px; border: 1px solid var(--color-border); border-radius: 12px; background: #fff; transition: border-color var(--speed-fast); }
.checkout-fields-grid .select2-container--default .select2-selection--single .select2-selection__rendered { padding: 0; line-height: 1.4; font-family: var(--font-body); font-size: 14.5px; color: var(--color-text); }
.checkout-fields-grid .select2-container--default .select2-selection--single .select2-selection__placeholder { color: #9CA3AF; }
.checkout-fields-grid .select2-container--default .select2-selection--single .select2-selection__arrow { height: 100%; top: 0; right: 14px; width: 14px; }
.checkout-fields-grid .select2-container--default .select2-selection--single .select2-selection__arrow b { border: 0; width: 12px; height: 8px; margin: -4px 0 0 -6px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239CA3AF' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E") no-repeat center; transition: transform .2s; }
.checkout-fields-grid .select2-container--open .select2-selection--single { border-color: var(--color-primary) !important; }
.checkout-fields-grid .select2-container--open .select2-selection__arrow b { transform: rotate(180deg); }
.checkout-fields-grid .woocommerce-invalid .select2-selection--single { border-color: var(--color-sale); }
.select2-dropdown { border: 1px solid var(--color-border) !important; border-radius: 12px !important; overflow: hidden; box-shadow: 0 14px 34px rgba(11, 27, 63, .14); margin-top: 4px; }
.select2-container--open .select2-dropdown--above { margin-top: -4px; }
.select2-search--dropdown { padding: 8px !important; }
.select2-search--dropdown .select2-search__field { border: 1px solid var(--color-border) !important; border-radius: 8px; padding: 9px 12px !important; font-size: 14px; outline: none; }
.select2-results__option { padding: 10px 16px !important; font-size: 14.5px; }
.select2-container--default .select2-results__option--highlighted[aria-selected], .select2-container--default .select2-results__option--highlighted[data-selected] { background: var(--color-primary) !important; color: #fff !important; }
.select2-container--default .select2-results__option[aria-selected="true"], .select2-container--default .select2-results__option[data-selected="true"] { background: var(--color-primary-soft, #EAF1FF); color: var(--color-primary); }
