/**
 * WooCommerce + Med-Rent layout bridges (auth shell, account, cart, checkout).
 */

/* Hide main chrome on standalone auth pages (design parity with static templates). */
body.med-rent-auth-shell #site-header,
body.med-rent-auth-shell #site-footer {
	display: none !important;
}

body.med-rent-auth-shell {
	padding-top: 0;
}

.auth-logo-img {
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: var(--y-radius-s, 8px);
}

/* Woo forms inside auth card */
.med-rent-wc-auth-card .woocommerce {
	margin: 0;
}

.med-rent-wc-auth-card .woocommerce-form-login,
.med-rent-wc-auth-card .woocommerce-form-register,
.med-rent-wc-auth-card .woocommerce-ResetPassword,
.med-rent-wc-auth-card form.lost_reset_password {
	border: none;
	padding: 0;
	margin: 0;
}

.med-rent-wc-auth-card .woocommerce-form-login .form-row,
.med-rent-wc-auth-card .woocommerce-form-register .form-row,
.med-rent-wc-auth-card .woocommerce-form-row {
	margin-bottom: 1rem;
}

.med-rent-wc-auth-card label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	color: var(--y-color-text, #1a2332);
}

.med-rent-wc-auth-card input.input-text,
.med-rent-wc-auth-card input.form-input,
.med-rent-wc-auth-card textarea,
.med-rent-wc-auth-card select {
	width: 100%;
	padding: 0.65rem 0.85rem;
	border-radius: var(--y-radius-m, 10px);
	border: 1px solid var(--y-color-border, #e2e8f0);
	background: var(--y-color-bg-subtle, #f8fafc);
	font-size: var(--y-font-m, 1rem);
	color: var(--y-color-text, #1a2332);
	font-family: inherit;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.med-rent-wc-auth-card input.form-input:focus {
	box-shadow: 0 0 0 3px var(--y-color-primary-subtle, rgba(13, 148, 136, 0.1));
	border-color: var(--y-color-primary, #0d9488);
	outline: none;
}

.med-rent-wc-auth-card .woocommerce-button,
.med-rent-wc-auth-card button.button,
.med-rent-wc-auth-card .woocommerce-Button {
	width: 100%;
	padding: 0.75rem 1rem !important;
	border-radius: var(--y-radius-m, 10px) !important;
	background: var(--y-color-primary, #0d9488) !important;
	color: #fff !important;
	border: none !important;
	font-weight: 600;
	cursor: pointer;
	margin-top: 0.25rem;
}

.med-rent-wc-auth-card .woocommerce-LostPassword,
.med-rent-wc-auth-card .woocommerce-privacy-policy-text {
	font-size: var(--y-font-s, 0.875rem);
	color: var(--y-color-text-muted, #64748b);
	margin-top: 0.75rem;
}

.med-rent-wc-auth-card .woocommerce-LostPassword a {
	color: var(--y-color-primary, #0d9488);
	font-weight: 600;
}

.med-rent-wc-auth-card .woocommerce-error,
.med-rent-wc-auth-card .woocommerce-message,
.med-rent-wc-auth-card .woocommerce-info {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-radius: var(--y-radius-m, 10px);
	font-size: var(--y-font-s, 0.875rem);
}

.med-rent-wc-auth-card .woocommerce-error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.med-rent-wc-auth-card .woocommerce-message {
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #a7f3d0;
}

/* Custom auth forms inside auth card (tabs, OTP, etc.) */
.med-rent-wc-auth-card .auth-tabs {
	margin-bottom: 1.5rem;
}

.med-rent-wc-auth-card .form-group {
	margin-bottom: 1.25rem;
}

.med-rent-wc-auth-card .form-group > label {
	display: block;
	font-size: var(--y-font-s, 0.875rem);
	margin-bottom: var(--y-space-s, 0.5rem);
	color: var(--y-color-text, #1a2332);
	font-weight: var(--y-weight-medium, 500);
}

.med-rent-wc-auth-card .input-wrapper {
	position: relative;
}

.med-rent-wc-auth-card .form-input-icon {
	padding-inline-end: 2.5rem;
}

.med-rent-wc-auth-card .form-input-icon-left {
	padding-inline-start: 2.5rem;
}

.med-rent-wc-auth-card .input-wrapper .icon-right {
	position: absolute;
	inset-inline-start: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--y-color-text-muted, #64748b);
	pointer-events: none;
}

.med-rent-wc-auth-card .input-wrapper .icon-left {
	position: absolute;
	inset-inline-end: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--y-color-text-muted, #64748b);
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* My account (logged in) â€” tabs replace WC nav */
.med-rent-wc-account-wrap .woocommerce {
	margin: 0;
}

a.tab-btn {
	text-decoration: none;
}

.med-rent-wc-account-wrap .woocommerce-MyAccount-navigation {
	display: none;
}

.med-rent-wc-account-wrap .woocommerce-MyAccount-content {
	background: transparent;
	border: none;
	border-radius: 0;
	padding: 0;
	box-shadow: none;
}

.med-rent-wc-account-wrap .woocommerce-MyAccount-content .woocommerce-EditAccountForm .card {
	margin-bottom: 1.5rem;
}

.med-rent-wc-account-wrap .woocommerce-error,
.med-rent-wc-account-wrap .woocommerce-message,
.med-rent-wc-account-wrap .woocommerce-info {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-radius: var(--y-radius-m, 10px);
	font-size: var(--y-font-s, 0.875rem);
}

.med-rent-wc-account-wrap .woocommerce-error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.med-rent-wc-account-wrap .woocommerce-message {
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #a7f3d0;
}

.med-rent-wc-account-wrap .woocommerce-MyAccount-content input.input-text,
.med-rent-wc-account-wrap .woocommerce-MyAccount-content textarea,
.med-rent-wc-account-wrap .woocommerce-MyAccount-content select {
	width: 100%;
	padding: 0.65rem 0.85rem;
	border-radius: var(--y-radius-m, 10px);
	border: 1px solid var(--y-color-border, #e2e8f0);
	background: var(--y-color-white, #fff);
	font-size: var(--y-font-m, 1rem);
}

.med-rent-wc-account-wrap .woocommerce-MyAccount-content label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	color: var(--y-color-text-muted, #64748b);
}

.med-rent-wc-account-wrap .woocommerce-MyAccount-content .form-row {
	margin-bottom: 1rem;
}

.med-rent-wc-account-wrap .woocommerce-MyAccount-content .button,
.med-rent-wc-account-wrap .woocommerce-MyAccount-content button[type="submit"],
.med-rent-wc-account-wrap .woocommerce-MyAccount-content .woocommerce-Button {
	background: var(--y-color-primary, #0d9488) !important;
	color: #fff !important;
	border: none !important;
	border-radius: var(--y-radius-m, 10px) !important;
	padding: 0.65rem 1.25rem !important;
	font-weight: 600;
	cursor: pointer;
}

/* Reset WC default product list layout */
.woocommerce ul.products {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.woocommerce ul.products li.product {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
	display: none !important;
}

/* Cart & checkout tables */
.med-rent-cart-shell .woocommerce table.shop_table,
.med-rent-checkout-shell .woocommerce table.shop_table {
	border-radius: var(--y-radius-l, 14px);
	overflow: hidden;
	border: 1px solid var(--y-color-border, #e2e8f0);
}

.med-rent-thankyou-shell .woocommerce-order {
	max-width: 42rem;
	margin: 0 auto;
}

.med-rent-thankyou-shell .woocommerce-order-overview {
	list-style: none;
	padding: 0;
	margin: 1rem 0 0;
}

.med-rent-thankyou-shell .woocommerce-order-overview li {
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--y-color-border, #e2e8f0);
}

/* WC pagination */
.woocommerce-pagination {
	text-align: center;
	margin-top: var(--y-space-xl, 2rem);
}

.woocommerce-pagination ul.page-numbers {
	display: inline-flex;
	gap: 0.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.woocommerce-pagination .page-numbers li a,
.woocommerce-pagination .page-numbers li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.5rem;
	border-radius: var(--y-radius-s, 8px);
	border: 1px solid var(--y-color-border, #e2e8f0);
	text-decoration: none;
	color: var(--y-color-text, #1a2332);
	font-size: 0.875rem;
}

.woocommerce-pagination .page-numbers li span.current {
	background: var(--y-color-primary, #0d9488);
	color: #fff;
	border-color: var(--y-color-primary, #0d9488);
}

.woocommerce-pagination .page-numbers li a:hover {
	background: var(--y-color-secondary, #f1f5f9);
}

/* WC notices */
.woocommerce-error,
.woocommerce-message,
.woocommerce-info {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
	border-radius: var(--y-radius-m, 10px);
	font-size: 0.875rem;
}

.woocommerce-error {
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

.woocommerce-message {
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #a7f3d0;
}

.woocommerce-info {
	background: #eff6ff;
	color: #1e40af;
	border: 1px solid #bfdbfe;
}

/* WC button */
.woocommerce .button,
.woocommerce button.button {
	background: var(--y-color-primary, #0d9488);
	color: #fff;
	border: none;
	border-radius: var(--y-radius-m, 10px);
	padding: 0.6rem 1.2rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
}

.woocommerce .button:hover {
	opacity: 0.9;
}

/* WC product images - ensure proper sizing */
.woocommerce ul.products li.product img,
.eq-card .eq-img-wrap img {
	width: 100%;
	height: 224px;
	object-fit: cover;
}

/* Hide "View Cart" link in WC notices */
.woocommerce-message .button.wc-forward {
	display: none !important;
}

/* Filter pills as links */
a.filter-pill {
	text-decoration: none;
	color: inherit;
}
a.filter-pill:hover {
	color: var(--y-color-primary, #0d9488);
}
a.filter-pill.active {
	color: #fff;
}

/* Checkout form fields within card */
.checkout-form .card .woocommerce-billing-fields__field-wrapper .form-row {
	margin-bottom: 1rem;
}
.checkout-form .card .woocommerce-billing-fields__field-wrapper label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	color: var(--y-color-text-muted, #64748b);
}
.checkout-form .card .woocommerce-billing-fields__field-wrapper input.input-text,
.checkout-form .card .woocommerce-billing-fields__field-wrapper select,
.checkout-form .card .woocommerce-billing-fields__field-wrapper textarea {
	width: 100%;
	padding: 0.65rem 0.85rem;
	border-radius: var(--y-radius-m, 10px);
	border: 1px solid var(--y-color-border, #e2e8f0);
	background: var(--y-color-white, #fff);
	font-size: var(--y-font-m, 1rem);
}
.checkout-form .card .woocommerce-billing-fields__field-wrapper .select2-container .select2-selection--single {
	height: auto;
	padding: 0.65rem 0.85rem;
	border-radius: var(--y-radius-m, 10px);
	border: 1px solid var(--y-color-border, #e2e8f0);
}

/* Order summary — custom review (matches static design) */
.order-summary .summary-product {
	display: flex;
	gap: 1rem;
	margin-bottom: 1.25rem;
}
.order-summary .summary-product img {
	width: 80px;
	height: 80px;
	border-radius: var(--y-radius-m, 10px);
	object-fit: cover;
}
.order-summary .sp-name {
	font-weight: 600;
	margin: 0;
}
.order-summary .sp-cat {
	font-size: 0.85rem;
	color: var(--y-color-text-muted, #64748b);
	margin: 0;
}
.order-summary .summary-rows {
	border-top: 1px solid var(--y-color-border, #e2e8f0);
	padding-top: 1rem;
}
.order-summary .summary-row {
	display: flex;
	justify-content: space-between;
	font-size: 0.9rem;
	margin-bottom: 0.75rem;
}
.order-summary .sr-label {
	color: var(--y-color-text-muted, #64748b);
}
.order-summary .sr-val {
	font-weight: 500;
}
.order-summary .sr-free {
	color: #059669;
	font-weight: 600;
}
.order-summary .summary-total {
	border-top: 1px solid var(--y-color-border, #e2e8f0);
	padding-top: 1rem;
	margin-top: 1rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.order-summary .st-label {
	font-weight: 700;
}
.order-summary .st-val {
	color: var(--y-color-primary, #0d9488);
	font-size: 1.5rem;
	font-weight: 800;
}

/* Summary actions (confirm + back link in sidebar) */
.order-summary .summary-actions {
	margin-top: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	align-items: center;
}
.order-summary .summary-actions .btn-text-link {
	margin-top: 0;
}

/* Address field rendered by WC (guest) — use design-system .form-input for logged-in */
.med-rent-address-field textarea {
	width: 100%;
	padding: 0.75rem var(--y-space-m, 1rem);
	border-radius: var(--y-radius-m, 10px);
	border: 1px solid var(--y-color-border, #e2e8f0);
	background: var(--y-color-bg-subtle, #f8fafc);
	font-size: 0.95rem;
	font-family: inherit;
	resize: none;
	min-height: 100px;
	color: var(--y-color-text, #1a2332);
}
.med-rent-address-field textarea:focus {
	box-shadow: 0 0 0 3px var(--y-color-primary-subtle, rgba(13, 148, 136, 0.1));
	border-color: var(--y-color-primary, #0d9488);
	outline: none;
}

/* Fallback: WC default review table */
.order-summary .woocommerce-checkout-review-order-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1rem;
}
.order-summary .woocommerce-checkout-review-order-table th,
.order-summary .woocommerce-checkout-review-order-table td {
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--y-color-border, #e2e8f0);
	font-size: 0.9rem;
}
.order-summary .woocommerce-checkout-review-order-table .order-total th,
.order-summary .woocommerce-checkout-review-order-table .order-total td {
	font-weight: 700;
	color: var(--y-color-primary, #0d9488);
	font-size: 1.1rem;
}

/* Payment section (now inside form column) */
.med-rent-payment {
	background: transparent;
}
.med-rent-payment .payment-option {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem;
	border-radius: var(--y-radius-m, 10px);
	border: 1px solid var(--y-color-border, #e2e8f0);
	cursor: pointer;
	transition: all 0.2s;
	margin-bottom: 0.75rem;
}
.med-rent-payment .payment-option:hover {
	border-color: rgba(13, 148, 136, 0.4);
}
.med-rent-payment .payment-option.selected {
	border-color: var(--y-color-primary, #0d9488);
	background: rgba(13, 148, 136, 0.04);
}
.med-rent-payment .payment-icon {
	width: 40px;
	height: 40px;
	background: rgba(13, 148, 136, 0.08);
	border-radius: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--y-color-primary, #0d9488);
	flex-shrink: 0;
}
.med-rent-payment .payment-info {
	flex: 1;
	min-width: 0;
}
.med-rent-payment .pi-name {
	font-weight: 600;
	display: block;
}
.med-rent-payment .pi-desc {
	font-size: 0.85rem;
	color: var(--y-color-text-muted, #64748b);
	display: block;
}
.med-rent-payment .payment_box {
	background: var(--y-color-bg-subtle, #f8fafc);
	padding: 1rem;
	border-radius: var(--y-radius-m, 10px);
	margin-bottom: 0.75rem;
	font-size: 0.875rem;
}
.med-rent-payment .place-order {
	margin-top: 1.5rem;
}
.med-rent-payment #place_order {
	width: 100%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}
.med-rent-payment-wrap .woocommerce-terms-and-conditions-wrapper {
	font-size: 0.85rem;
	margin-bottom: 0.75rem;
}

/* Legacy sidebar payment fallback */
.order-summary #payment .payment_methods {
	list-style: none;
	margin: 0;
	padding: 0;
}
.order-summary #place_order {
	width: 100%;
	padding: 0.75rem 1rem;
	margin-top: 1rem;
	border-radius: var(--y-radius-m, 10px);
	background: var(--y-color-primary, #0d9488);
	color: #fff;
	border: none;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
}
.order-summary #place_order:hover {
	opacity: 0.9;
}

/* Hide WC default "your order" heading */
.woocommerce-checkout #order_review_heading {
	display: none;
}

/* user-info-display styling is in pages.css — no override needed */

/* ── Checkout password card ── */
.checkout-password-card .field-desc {
	font-size: 0.875rem;
	color: var(--y-color-text-muted, #64748b);
	margin-bottom: 1rem;
}

.checkout-password-card .form-row label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	color: var(--y-color-text-muted, #64748b);
}

.checkout-password-card .form-row .input-text {
	width: 100%;
	padding: 0.65rem 0.85rem;
	border-radius: var(--y-radius-m, 10px);
	border: 1px solid var(--y-color-border, #e2e8f0);
	background: var(--y-color-white, #fff);
	font-size: var(--y-font-m, 1rem);
}

.checkout-password-card .form-row .input-text:focus {
	border-color: var(--y-color-primary, #0d9488);
	box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
	outline: none;
}

/* ── Checkout OTP overlay ── */
.checkout-otp-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	padding: 1rem;
}

.checkout-otp-modal {
	background: var(--y-color-white, #fff);
	border-radius: var(--y-radius-l, 14px);
	padding: 2rem;
	width: 100%;
	max-width: 24rem;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
	text-align: center;
}

.checkout-otp-modal .btn-text-link {
	margin: 1rem auto 0;
}

@media (max-width: 480px) {
	.checkout-otp-modal {
		padding: 1.5rem;
		max-width: 100%;
	}
}