/*
 * Sticky footer. Body's direct children are the Elementor header/footer
 * location wrappers with the page's own content in between (confirmed via
 * an empty page: no extra wrapper div appears around them), so a flex
 * column on body + margin-top: auto on the footer pushes it to the bottom
 * on short/empty pages without needing every page template to opt in.
 */
body {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
}

body > footer[data-elementor-type="footer"] {
	margin-top: auto;
}

/*
 * Flexbox quirk: a flex item with an auto cross-axis margin (Tailwind's
 * mx-auto, used by every page's <main class="mx-auto max-w-[...]">  to
 * center itself) ignores the container's align-items: stretch and instead
 * shrink-wraps to its content's width — this is what made marche/checkout/
 * etc. render narrow once body became a flex container above. Forcing full
 * width back on the actual document-flow children of body restores the
 * original block-layout sizing while keeping the flex column for the
 * footer fix.
 *
 * This is an allowlist (header/content/footer), not a blanket `body > *`,
 * on purpose: several scripts append position:absolute/fixed overlays
 * straight to <body> (select2's dropdown, the search modal moved there by
 * linfasy-header.php, the floating WhatsApp button) that must size
 * themselves, not stretch to full page width — a blanket rule previously
 * broke select2 open-dropdowns (no inline width set, so the 100% rule won,
 * stretching the dropdown to the full page width and causing a horizontal
 * scrollbar) and would just as easily break the next such overlay someone
 * adds. Every actual content template's top-level element is one of these
 * three, confirmed by checking each page-*.php / single-product.php /
 * archive-product.php (all <main>) and an Elementor canvas page's markup
 * (<div data-elementor-type="wp-page">) — extend this list if a future
 * template introduces a different top-level tag.
 */
body > header[data-elementor-type="header"],
body > footer[data-elementor-type="footer"],
body > div[data-elementor-type="wp-page"],
body > main {
	width: 100%;
}

/*
 * Link underlines. Hello Elementor's assets/css/theme.css carries
 *
 *     .comments-area a, .page-content a { text-decoration: underline }
 *
 * and the parent theme enqueues it AFTER every child stylesheet, so it beats
 * Tailwind's preflight (`a { text-decoration: inherit }`) on both specificity
 * and order. `.page-content` is the wrapper the parent's header-footer.php
 * puts around an Elementor page's content, and the homepage (page 2, template
 * elementor_header_footer) is the only page that goes through it - every other
 * page renders from a custom page-*.php / archive-product.php template whose
 * top-level element is a bare <main>. That is why the homepage, and only the
 * homepage, drew a line under every link: nav, category tiles, product titles,
 * brand names, "Vedi tutte", the social cards.
 *
 * Nothing in this design uses underlined links, so turn them off wherever that
 * wrapper appears. The leading `body` exists purely to out-specify the parent
 * rule; without it the two selectors tie and load order hands the win back to
 * theme.css.
 */
body .page-content a,
body .comments-area a {
	text-decoration: none;
}
