/* Dialog: lock scroll and keep exit animations from snapping back visible */
body.dialog-open {
	overflow: hidden;
}

.theme-dialog[data-closing] {
	pointer-events: none;
}

.theme-dialog [data-dialog-layer][data-state="closed"] {
	animation-fill-mode: forwards;
}

.theme-dialog.is-open .theme-dialog__close {
	background-color: var(--accent);
	color: var(--accent-foreground);
}

/* WordPress admin bar offset for sticky header */
body.admin-bar .site-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .site-header {
		top: 46px;
	}
}

/* Pointer cursor on interactive elements */
a[href],
button:not(:disabled),
[role="button"]:not([aria-disabled="true"]),
input[type="submit"],
input[type="button"],
input[type="reset"],
label[for],
select,
summary,
.theme-menu-link,
.theme-cat-filter,
.theme-card-link,
.theme-card-btn,
[data-menu-toggle],
[data-cart-open],
[data-cart-close],
[data-dialog-open],
[data-dialog-close],
[data-menu-close],
[data-modal-trigger],
.link-underline {
	cursor: pointer;
}

button:disabled,
[aria-disabled="true"],
input:disabled,
select:disabled {
	cursor: not-allowed;
}

/* PDP tabs: horizontal scroll only; underline sits on border-b */
.theme-product-tabs [role="tablist"] {
	overflow-y: hidden;
	scrollbar-width: thin;
}

.theme-product-tabs .theme-tab:not(.is-active) .theme-tab__line {
	display: none;
}

.theme-product-tabs .theme-tab.is-active {
	font-style: italic;
	color: var(--foreground);
}

/* -------------------------------------------------------------------------
 * WooCommerce Blocks checkout (Lovable alignment)
 * Dual selectors: body.woocommerce-checkout + .entry-content (embedded block)
 * ---------------------------------------------------------------------- */

:root {
	--checkout-max-width: 1280px;
	--checkout-gap: 2rem;
}

/* C.1 — shared horizontal alignment */
.theme-checkout-header,
body.woocommerce-checkout .wc-block-components-notices,
.entry-content .wc-block-components-notices,
body.woocommerce-checkout .wc-block-checkout,
body.woocommerce-checkout .wp-block-woocommerce-checkout,
.entry-content > .wc-block-checkout,
.entry-content > .wp-block-woocommerce-checkout {
	max-width: var(--checkout-max-width);
	width: 100%;
	margin-inline: auto;
	box-sizing: border-box;
}

/* C.2 — vertical spacing; single fixed-header offset */
body.woocommerce-checkout .theme-checkout-main {
	padding-top: 0;
}

.theme-checkout-shell {
	width: 100%;
	max-width: none;
	padding-inline: 1.5rem;
	padding-block: 0.5rem 4rem;
	box-sizing: border-box;
}

@media (min-width: 1024px) {
	.theme-checkout-shell {
		padding-inline: 2rem;
	}
}

.theme-checkout-header {
	margin-bottom: 0;
}

.checkout-continue-link {
	margin-bottom: 1rem;
}

.theme-checkout-title {
	margin: 0;
}

.theme-checkout-intro {
	margin: 0.75rem 0 0;
}

body.woocommerce-checkout .theme-checkout-main > .container-wide,
body.woocommerce-checkout .theme-checkout-shell,
body.woocommerce-checkout .theme-checkout-main .entry-content,
.entry-content:has(.wc-block-checkout) {
	max-width: none;
	width: 100%;
	margin-top: 0;
	padding-top: 0;
}

body.woocommerce-checkout .theme-checkout-main .entry-content > .wc-block-checkout,
body.woocommerce-checkout .theme-checkout-main .entry-content > .wp-block-woocommerce-checkout,
.entry-content > .wc-block-checkout:first-child,
.entry-content > .wp-block-woocommerce-checkout:first-child {
	margin-top: 0;
}

/* D — checkout root container */
body.woocommerce-checkout .wc-block-checkout,
body.woocommerce-checkout .wp-block-woocommerce-checkout,
.entry-content .wc-block-checkout,
.entry-content .wp-block-woocommerce-checkout {
	min-width: 0;
	margin-top: 0;
	padding-top: 0;
	color: var(--foreground);
}

body.woocommerce-checkout .wc-block-checkout.alignwide,
.entry-content .wc-block-checkout.alignwide {
	margin-top: 0;
}

body.woocommerce-checkout .wc-block-checkout__main,
body.woocommerce-checkout .wc-block-components-main,
.entry-content .wc-block-checkout__main,
.entry-content .wc-block-components-main,
body.woocommerce-checkout .wc-block-checkout .wc-block-components-sidebar-layout,
body.woocommerce-checkout .wc-block-checkout .wc-block-checkout-sidebar-layout,
.entry-content .wc-block-checkout .wc-block-components-sidebar-layout,
.entry-content .wc-block-checkout .wc-block-checkout-sidebar-layout {
	margin-top: 0;
	padding-top: 0;
}

/* G — notices (no gap when empty) */
body.woocommerce-checkout .wc-block-checkout > .wc-block-components-notices:empty,
.entry-content .wc-block-checkout > .wc-block-components-notices:empty {
	display: none;
	margin: 0;
	padding: 0;
}

body.woocommerce-checkout .wc-block-components-notices,
.entry-content .wc-block-components-notices {
	margin-top: 0;
	padding-top: 0;
	margin-bottom: var(--checkout-gap);
}

body.woocommerce-checkout .wc-block-checkout__main,
body.woocommerce-checkout .wc-block-checkout__sidebar,
.entry-content .wc-block-checkout__main,
.entry-content .wc-block-checkout__sidebar {
	width: auto !important;
	max-width: 100%;
	min-width: 0;
}

/* E — 2-column grid on inner wrapper only (≥768px); 50/50 like Lovable reference */
@media (min-width: 768px) {
	body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout,
	body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout.is-large,
	body.woocommerce-checkout .wc-block-checkout .wc-block-components-sidebar-layout,
	body.woocommerce-checkout .wc-block-checkout .wc-block-checkout-sidebar-layout,
	.entry-content .wc-block-components-sidebar-layout.wc-block-checkout,
	.entry-content .wc-block-checkout .wc-block-components-sidebar-layout,
	.entry-content .wc-block-checkout .wc-block-checkout-sidebar-layout {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--checkout-gap);
		align-items: start;
		flex-direction: unset !important;
		flex-wrap: nowrap !important;
		margin: 0;
	}

	@media (min-width: 1024px) {
		body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout,
		body.woocommerce-checkout .wc-block-components-sidebar-layout.wc-block-checkout.is-large,
		body.woocommerce-checkout .wc-block-checkout .wc-block-components-sidebar-layout,
		body.woocommerce-checkout .wc-block-checkout .wc-block-checkout-sidebar-layout,
		.entry-content .wc-block-components-sidebar-layout.wc-block-checkout,
		.entry-content .wc-block-checkout .wc-block-components-sidebar-layout,
		.entry-content .wc-block-checkout .wc-block-checkout-sidebar-layout {
			gap: 4rem;
		}
	}

	body.woocommerce-checkout .wc-block-checkout .wc-block-components-sidebar-layout .wc-block-checkout__main,
	body.woocommerce-checkout .wc-block-checkout .wc-block-components-sidebar-layout .wc-block-components-main,
	body.woocommerce-checkout .wc-block-checkout .wc-block-components-sidebar-layout .wc-block-checkout__sidebar,
	body.woocommerce-checkout .wc-block-checkout .wc-block-components-sidebar-layout .wc-block-components-sidebar,
	.entry-content .wc-block-checkout .wc-block-components-sidebar-layout .wc-block-checkout__main,
	.entry-content .wc-block-checkout .wc-block-components-sidebar-layout .wc-block-components-main,
	.entry-content .wc-block-checkout .wc-block-components-sidebar-layout .wc-block-checkout__sidebar,
	.entry-content .wc-block-checkout .wc-block-components-sidebar-layout .wc-block-components-sidebar {
		width: auto !important;
		max-width: 100%;
		min-width: 0;
		margin: 0 !important;
		padding: 0 !important;
		box-sizing: border-box;
	}

	/* Fallback: main + sidebar as direct children of checkout root */
	body.woocommerce-checkout .wc-block-checkout:has(> .wc-block-checkout__main):has(> .wc-block-checkout__sidebar),
	.entry-content .wc-block-checkout:has(> .wc-block-checkout__main):has(> .wc-block-checkout__sidebar) {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--checkout-gap);
		align-items: start;
	}

	body.woocommerce-checkout .wc-block-checkout:has(> .wc-block-checkout__main) > .wc-block-components-notices,
	.entry-content .wc-block-checkout:has(> .wc-block-checkout__main) > .wc-block-components-notices {
		grid-column: 1 / -1;
	}
}

/* F — sidebar wrappers transparent; card only on order summary */
body.woocommerce-checkout .wc-block-checkout__sidebar,
body.woocommerce-checkout .wc-block-components-sidebar,
body.woocommerce-checkout .wp-block-woocommerce-checkout-totals-block,
.entry-content .wc-block-checkout__sidebar,
.entry-content .wc-block-components-sidebar,
.entry-content .wp-block-woocommerce-checkout-totals-block {
	background: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	padding: 0 !important;
}

body.woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block,
.entry-content .wp-block-woocommerce-checkout-order-summary-block {
	width: 100%;
	background-color: var(--card);
	border-radius: 1.5rem;
	padding: 1.75rem;
	border: 1px solid var(--border);
	box-sizing: border-box;
}

/* H — empty checkout cart */
body.woocommerce-checkout .wc-block-checkout-empty,
.entry-content .wc-block-checkout-empty {
	margin-inline: auto;
	max-width: 36rem;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
}
