/**
 * Polar WooCommerce storefront — simple, conversion-focused styles.
 * Does not override theme layout columns; only polishes spacing and readability.
 */

/* ── Product page ────────────────────────────────────────────── */
.single-product form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.single-product form.cart .quantity {
	margin-right: 0;
}

.single-product form.cart .single_add_to_cart_button,
.single-product form.cart .polar-wc-buy-now {
	min-height: 48px;
	padding: 0.85em 1.6em;
	border-radius: 999px;
	font-weight: 600;
	line-height: 1.2;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.single-product form.cart .single_add_to_cart_button {
	box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}

.single-product form.cart .polar-wc-buy-now {
	background: #111827 !important;
	color: #fff !important;
	border: none;
	box-shadow: 0 8px 20px rgba(17, 24, 39, 0.18);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.single-product form.cart .single_add_to_cart_button:hover,
.single-product form.cart .polar-wc-buy-now:hover {
	transform: translateY(-1px);
	opacity: 0.95;
}

/* ── Page width ──────────────────────────────────────────────── */
.woocommerce-cart .woocommerce,
.woocommerce-checkout .woocommerce,
.woocommerce-page .woocommerce {
	max-width: 1100px;
	margin: 0 auto;
}

/* ── Checkout & cart cards ───────────────────────────────────── */
.woocommerce-cart .cart-collaterals .cart_totals,
.woocommerce-checkout form.checkout #customer_details,
.woocommerce-checkout form.checkout #order_review {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 28px !important;
	box-sizing: border-box;
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

/* Login panel — compact, hidden until customer clicks login link */
.woocommerce-checkout .woocommerce-form-login-toggle {
	margin-bottom: 16px;
}

.woocommerce-checkout form.woocommerce-form-login {
	margin: 0 0 20px !important;
	padding: 24px !important;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	box-sizing: border-box;
}

/* Two-column checkout: theme-safe floats + clear gap (no CSS grid) */
@media (min-width: 992px) {
	.woocommerce-checkout form.checkout #customer_details {
		float: left;
		width: 48%;
		margin: 0 4% 0 0 !important;
		clear: left;
	}

	.woocommerce-checkout h3#order_review_heading {
		float: right;
		width: 48%;
		clear: right;
		margin: 0 0 12px !important;
		padding: 0;
	}

	.woocommerce-checkout form.checkout #order_review {
		float: right;
		width: 48%;
		clear: right;
		margin: 0 !important;
	}

	.woocommerce-checkout form.checkout::after {
		content: "";
		display: table;
		clear: both;
	}
}

@media (max-width: 991px) {
	.woocommerce-checkout form.checkout #customer_details {
		margin-bottom: 24px !important;
	}
}

.woocommerce-checkout form.checkout #customer_details .col-1,
.woocommerce-checkout form.checkout #customer_details .col-2 {
	float: none;
	width: 100%;
	margin: 0 !important;
	padding: 0 !important;
}

.woocommerce-checkout form.checkout .woocommerce-billing-fields,
.woocommerce-checkout form.checkout .woocommerce-shipping-fields,
.woocommerce-checkout form.checkout .woocommerce-additional-fields {
	margin: 0;
	padding: 0;
}

.woocommerce-checkout form.checkout .form-row {
	margin-left: 0 !important;
	margin-right: 0 !important;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #payment #place_order {
	border-radius: 999px;
	min-height: 48px;
	font-weight: 600;
	padding: 0.85em 1.5em;
}

.woocommerce #payment #place_order {
	width: 100%;
	font-size: 1.05rem;
	margin-top: 12px;
}

/* ── Tables ──────────────────────────────────────────────────── */
.woocommerce table.shop_table {
	border-radius: 8px;
	overflow: visible;
}

.woocommerce-checkout #order_review table.shop_table {
	table-layout: auto;
	width: 100%;
}

.woocommerce-checkout #order_review table.shop_table th,
.woocommerce-checkout #order_review table.shop_table td,
.woocommerce-cart table.shop_table th,
.woocommerce-cart table.shop_table td {
	padding: 12px 16px !important;
	vertical-align: top;
}

.woocommerce-checkout #order_review table.shop_table .product-name,
.woocommerce-cart table.shop_table .product-name {
	word-break: break-word;
	overflow-wrap: break-word;
	line-height: 1.45;
	white-space: normal;
}

.woocommerce-checkout #order_review table.shop_table .product-total,
.woocommerce-cart table.shop_table .product-subtotal,
.woocommerce-cart table.shop_table .product-price {
	text-align: right;
	white-space: nowrap;
	font-weight: 600;
	min-width: 72px;
}

/* ── Notices ─────────────────────────────────────────────────── */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	border-radius: 10px;
	line-height: 1.5;
	word-break: break-word;
	overflow-wrap: anywhere;
}

.woocommerce-checkout .woocommerce-info,
.woocommerce-checkout .woocommerce-message,
.woocommerce-checkout .woocommerce-error,
.woocommerce-cart .woocommerce-info,
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-error {
	border: 1px solid #e5e7eb !important;
	border-left: 1px solid #e5e7eb !important;
	background: #f9fafb !important;
	padding: 14px 18px !important;
	margin: 0 0 20px !important;
	box-sizing: border-box;
}

.woocommerce-checkout .woocommerce-info::before,
.woocommerce-checkout .woocommerce-message::before,
.woocommerce-checkout .woocommerce-error::before,
.woocommerce-cart .woocommerce-info::before,
.woocommerce-cart .woocommerce-message::before,
.woocommerce-cart .woocommerce-error::before,
.woocommerce-notices-wrapper .woocommerce-info::before,
.woocommerce-notices-wrapper .woocommerce-message::before,
.woocommerce-notices-wrapper .woocommerce-error::before {
	display: none !important;
	content: none !important;
}

/* Notice + button on separate lines */
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}

.woocommerce-notices-wrapper .woocommerce-message .button,
.woocommerce-notices-wrapper .woocommerce-info .button,
.woocommerce-notices-wrapper .woocommerce-message .wc-forward,
.woocommerce-notices-wrapper .woocommerce-info .wc-forward {
	align-self: flex-end;
	margin: 0 !important;
	float: none !important;
}

/* ── Payment methods (light touch) ───────────────────────────── */
.woocommerce-checkout #payment ul.payment_methods li {
	padding: 12px 16px;
}

/* ── Account prompt (thank-you page) ─────────────────────────── */
.polar-wc-account-prompt {
	margin-top: 24px;
	padding: 24px;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #f9fafb;
}

.polar-wc-account-prompt h2 {
	margin: 0 0 8px;
	font-size: 1.2rem;
}

.polar-wc-account-prompt p {
	margin: 0 0 16px;
	line-height: 1.5;
}

.polar-wc-account-button {
	border-radius: 999px !important;
	min-height: 44px;
	padding: 0.75em 1.5em !important;
}

/* Fallback: hide address fields if a theme re-injects them */
body.polar-wc-digital-checkout #billing_address_1_field,
body.polar-wc-digital-checkout #billing_address_2_field,
body.polar-wc-digital-checkout #billing_city_field,
body.polar-wc-digital-checkout #billing_state_field,
body.polar-wc-digital-checkout #billing_postcode_field,
body.polar-wc-digital-checkout #billing_phone_field,
body.polar-wc-digital-checkout #billing_company_field,
body.polar-wc-digital-checkout #ship-to-different-address,
body.polar-wc-digital-checkout .woocommerce-shipping-fields,
body.polar-wc-digital-checkout .woocommerce-additional-fields {
	display: none !important;
}

/* Checkout account creation */
.woocommerce-checkout .woocommerce-account-fields {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #e5e7eb;
}

.woocommerce-checkout p.create-account {
	display: block !important;
	margin-bottom: 0;
}

.woocommerce-checkout div.create-account {
	margin-top: 12px;
}

.woocommerce-checkout #account_password_field {
	display: block;
}

/* ── My Account: orders table & action buttons ───────────────── */
.woocommerce-account .woocommerce-MyAccount-content {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 24px;
	box-sizing: border-box;
}

.woocommerce-account table.woocommerce-orders-table {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
}

.woocommerce-account table.woocommerce-orders-table th,
.woocommerce-account table.woocommerce-orders-table td {
	padding: 14px 12px !important;
	vertical-align: middle;
}

.woocommerce-account table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions {
	display: flex !important;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: flex-start;
	white-space: normal;
}

.woocommerce-account table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions::before {
	display: none !important;
}

.woocommerce-account table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a.button {
	float: none !important;
	clear: none !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	margin: 0 !important;
	min-height: 38px;
	padding: 0.45em 1.1em !important;
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.2;
	border-radius: 999px;
	white-space: nowrap;
	text-decoration: none;
	box-shadow: none;
}

.woocommerce-account table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a.pay {
	background: #2563eb !important;
	color: #fff !important;
	border: 1px solid #2563eb !important;
}

.woocommerce-account table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a.view {
	background: #f9fafb !important;
	color: #111827 !important;
	border: 1px solid #d1d5db !important;
}

.woocommerce-account table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a.cancel {
	background: #fff !important;
	color: #dc2626 !important;
	border: 1px solid #fecaca !important;
}

/* ── Order pay page (pending payment) ──────────────────────── */
.woocommerce-order-pay .woocommerce,
.woocommerce-checkout-pay .woocommerce {
	max-width: 720px;
	margin: 0 auto;
	padding: 0 16px;
}

.woocommerce-order-pay #order_review,
.woocommerce-order-pay form#order_review {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 24px !important;
	box-sizing: border-box;
}

.woocommerce-order-pay table.shop_table {
	table-layout: auto !important;
	width: 100% !important;
}

.woocommerce-order-pay table.shop_table th,
.woocommerce-order-pay table.shop_table td {
	white-space: normal !important;
	word-break: normal !important;
	overflow-wrap: break-word;
	hyphens: auto;
	padding: 12px 14px !important;
	vertical-align: top;
	line-height: 1.45;
}

.woocommerce-order-pay table.shop_table .product-name {
	min-width: 0;
	max-width: none;
}

.woocommerce-order-pay table.shop_table .product-quantity,
.woocommerce-order-pay table.shop_table .product-total {
	white-space: nowrap;
	text-align: right;
	min-width: 72px;
}

.woocommerce-order-pay #payment #place_order {
	width: 100%;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (min-width: 768px) {
	.woocommerce-notices-wrapper .woocommerce-message,
	.woocommerce-notices-wrapper .woocommerce-info {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
	}

	.woocommerce-notices-wrapper .woocommerce-message .button,
	.woocommerce-notices-wrapper .woocommerce-info .button,
	.woocommerce-notices-wrapper .woocommerce-message .wc-forward,
	.woocommerce-notices-wrapper .woocommerce-info .wc-forward {
		align-self: center;
		margin-left: 16px !important;
	}
}

@media (max-width: 767px) {
	.single-product form.cart {
		flex-direction: column;
		align-items: stretch;
	}

	.single-product form.cart .single_add_to_cart_button,
	.single-product form.cart .polar-wc-buy-now {
		width: 100%;
		text-align: center;
	}

	.woocommerce-cart .cart-collaterals .cart_totals,
	.woocommerce-checkout form.checkout #customer_details,
	.woocommerce-checkout form.checkout #order_review {
		padding: 20px !important;
	}

	.woocommerce-account .woocommerce-MyAccount-content {
		padding: 16px;
	}

	.woocommerce-account table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions {
		flex-direction: column;
		align-items: stretch;
	}

	.woocommerce-account table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions a.button {
		width: 100%;
	}

	/* Order pay: card layout instead of crushed table */
	.woocommerce-order-pay table.shop_table thead {
		display: none;
	}

	.woocommerce-order-pay table.shop_table,
	.woocommerce-order-pay table.shop_table tbody,
	.woocommerce-order-pay table.shop_table tr,
	.woocommerce-order-pay table.shop_table td {
		display: block;
		width: 100% !important;
	}

	.woocommerce-order-pay table.shop_table tr {
		border-bottom: 1px solid #e5e7eb;
		padding: 12px 0;
		margin-bottom: 8px;
	}

	.woocommerce-order-pay table.shop_table td {
		border: none !important;
		padding: 6px 0 !important;
		text-align: left !important;
	}

	.woocommerce-order-pay table.shop_table td.product-total {
		font-weight: 700;
		font-size: 1.05rem;
	}
}
