/**
 * KAUFLOND — Homepage (Phase 5)
 *
 * The homepage is an Elementor page built from WoodMart's own widgets
 * (banner, product categories, products, infobox, mailchimp, title). This file
 * only tunes their presentation to the KAUFLOND system and gives the page its
 * retail rhythm. Section containers carry `kfl-home-section` + a section class
 * (set in the container's CSS Classes field), widgets carry `kfl-*` classes.
 *
 * Layout notes:
 *  - Elementor boxed containers render children inside `.e-con-inner`; the grid
 *    rules therefore target `> .e-con-inner`.
 *  - Product cards are the Phase 3 card component untouched (product-card.css).
 *
 * @package Kauflond
 */

/* =========================================================================
 * 1. SECTION RHYTHM
 * ====================================================================== */

.e-con.kfl-home-section {
	margin-block-end: var(--kfl-space-10);
}

.e-con.kfl-home-section.kfl-promo {
	margin-block-start: var(--kfl-space-4);
}

/* Spacing inside sections comes from the container gap, not widget margins. */
.kfl-home-section .elementor-widget:not(:last-child) {
	margin-block-end: 0;
}

/* Section header: title left, "Alle … ansehen →" right. Elementor gives every
 * widget in a container 100% width; the header row needs shrink-to-fit. */
.kfl-section-head {
	row-gap: var(--kfl-space-1);
}

.kfl-section-head > .elementor-widget {
	--container-widget-width: auto;
	width: auto;
	max-width: 100%;
	flex: 0 0 auto;
}

.kfl-section-head > .kfl-section-title {
	flex: 1 1 12rem;
}

.kfl-section-title .title-wrapper,
.kfl-section-title .title-wrapper.wd-set-mb {
	margin-bottom: 0;
}

.kfl-section-title .title,
.kfl-products--titled .wd-el-title {
	margin: 0;
	font-size: var(--kfl-font-size-xl);
	line-height: var(--kfl-line-height-tight);
	font-weight: var(--kfl-font-weight-bold);
	color: var(--kfl-color-text-primary);
	text-transform: none;
}

.kfl-products--titled .wd-el-title {
	margin-bottom: var(--kfl-space-4);
}

.kfl-section-more {
	margin-inline-start: auto;
}

.kfl-section-more + .kfl-section-more {
	margin-inline-start: 0;
}

.kfl-section-more .elementor-shortcode {
	display: flex;
	gap: var(--kfl-space-4);
}

.kfl-section-link {
	font-size: var(--kfl-font-size-sm);
	font-weight: var(--kfl-font-weight-semibold);
	color: var(--kfl-color-text-secondary);
	white-space: nowrap;
}

.kfl-section-link:hover,
.kfl-section-link:focus-visible {
	color: var(--kfl-color-brand-primary);
	text-decoration: underline;
}

/* =========================================================================
 * 2. PROMO ZONE — one primary tile + two secondary tiles
 *
 * Kept deliberately compact: the header and search already own the top of
 * the viewport, so the promo row is a 2:1 grid, not a hero.
 * ====================================================================== */

.kfl-promo > .e-con-inner {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: var(--kfl-space-4);
	align-items: stretch;
}

.kfl-promo__primary,
.kfl-promo__secondary {
	--width: 100%;
	width: 100%;
	min-width: 0;
}

.kfl-promo__secondary {
	gap: var(--kfl-space-4);
}

/* Tiles: rounded cards, image covers, content overlays. */
.kfl-promo-tile,
.kfl-promo-tile .elementor-widget-container,
.kfl-promo-tile .promo-banner-wrapper,
.kfl-promo-tile .promo-banner {
	height: 100%;
}

.kfl-promo-tile .promo-banner {
	position: relative;
	overflow: hidden;
	border-radius: var(--kfl-radius-lg);
	border: var(--kfl-border-width) solid var(--kfl-color-border);
}

.kfl-promo-tile .main-wrapp-img,
.kfl-promo-tile .banner-image {
	position: absolute;
	inset: 0;
	height: 100%;
}

.kfl-promo-tile .banner-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: right center;
}

/* WoodMart absolutely positions the content (.wd-fill); make it flow so the
 * tile grows with its text on narrow screens instead of clipping the CTA. */
.kfl-promo-tile .promo-banner .wrapper-content-banner.wd-fill {
	position: relative;
	inset: auto;
	min-height: 100%;
	padding: var(--kfl-space-6);
}

.kfl-promo-tile .content-banner {
	max-width: 34rem;
}

.kfl-promo-tile .banner-subtitle {
	margin-bottom: var(--kfl-space-2);
	font-size: var(--kfl-font-size-sm);
	font-weight: var(--kfl-font-weight-semibold);
	text-transform: none;
}

.kfl-promo-tile .banner-title {
	margin: 0 0 var(--kfl-space-3);
	line-height: var(--kfl-line-height-tight);
	font-weight: var(--kfl-font-weight-bold);
}

.kfl-promo-tile .banner-inner {
	margin-bottom: var(--kfl-space-5);
	font-size: var(--kfl-font-size-base);
}

.kfl-promo-tile .banner-btn-wrapper {
	margin-top: 0;
}

/* Buttons follow the card/PDP CTA conventions: sentence case, 40 px. */
.kfl-promo-tile .btn {
	min-height: 40px;
	font-size: var(--kfl-font-size-sm);
	text-transform: none;
	letter-spacing: 0;
}

/* Primary tile: brand red ground, white type (global.css paints headings dark,
 * so the light scheme is restated here). */
.kfl-promo-tile--primary .promo-banner {
	border-color: transparent;
	min-height: 320px;
}

.kfl-promo-tile--primary .banner-title,
.kfl-promo-tile--primary .banner-subtitle,
.kfl-promo-tile--primary .banner-inner {
	color: var(--kfl-color-brand-on-primary);
}

.kfl-promo-tile--primary .banner-title {
	font-size: clamp(1.5rem, 2.4vw, 2.25rem);
	max-width: 16ch;
}

.kfl-promo-tile--primary .banner-subtitle {
	opacity: .9;
}

.kfl-promo-tile--primary .btn.btn-color-white {
	background: var(--kfl-color-surface);
	color: var(--kfl-color-brand-primary);
	font-weight: var(--kfl-font-weight-bold);
	box-shadow: none;
}

.kfl-promo-tile--primary .btn.btn-color-white:hover {
	background: var(--kfl-color-surface-subtle);
	color: var(--kfl-color-brand-primary-hover);
}

/* Secondary tiles: white card, render on the right, text on the left. */
.kfl-promo-tile--secondary .promo-banner {
	aspect-ratio: 900 / 420;
	background: var(--kfl-color-surface);
}

.kfl-promo-tile--secondary .content-banner {
	max-width: 56%;
	padding-inline-end: var(--kfl-space-4);
	/* the render sits on the right; a soft white fade keeps the text legible
	 * when the two meet on narrow tiles */
	background: linear-gradient(90deg, var(--kfl-color-surface) 78%, transparent);
}

.kfl-promo-tile--secondary .banner-subtitle {
	color: var(--kfl-color-text-muted);
}

.kfl-promo-tile--secondary .banner-title {
	font-size: var(--kfl-font-size-lg);
	color: var(--kfl-color-text-primary);
}

.kfl-promo-tile--secondary .btn.btn-style-link {
	padding: 0;
	font-size: var(--kfl-font-size-sm);
	font-weight: var(--kfl-font-weight-semibold);
	color: var(--kfl-color-brand-primary);
	text-transform: none;
}

.kfl-promo-tile--secondary .btn.btn-style-link::after {
	content: " →";
}

.kfl-promo-tile .promo-banner:hover .btn.btn-style-link {
	text-decoration: underline;
}

/* =========================================================================
 * 3. BELIEBTE KATEGORIEN — compact tiles, whole tile clickable (WoodMart's
 *    `a.wd-fill.category-link` already covers the tile)
 * ====================================================================== */

.kfl-cat-grid .wd-cat .wd-cat-inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	padding: var(--kfl-space-4) var(--kfl-space-3);
	border: var(--kfl-border-width) solid var(--kfl-color-border);
	border-radius: var(--kfl-radius-lg);
	background: var(--kfl-color-surface);
	text-align: center;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.kfl-cat-grid .wd-cat:hover .wd-cat-inner,
.kfl-cat-grid .wd-cat:focus-within .wd-cat-inner {
	border-color: var(--kfl-color-brand-primary);
	box-shadow: none;
}

.kfl-cat-grid .wd-cat .wd-cat-thumb {
	width: 96px;
	margin: 0 auto var(--kfl-space-2);
}

.kfl-cat-grid .wd-cat .wd-cat-thumb img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--kfl-radius-md);
}

/* WoodMart's default design overlays the title on the image; here it sits
 * below the illustration as plain text. */
.kfl-cat-grid .wd-cat .wd-cat-content {
	position: static;
	transform: none;
	padding: 0;
	background: none;
	box-shadow: none;
	opacity: 1;
	visibility: visible;
}

.kfl-cat-grid .wd-cat .wd-entities-title {
	position: static; /* WoodMart parks it above the overlay box */
	margin: 0;
	font-size: var(--kfl-font-size-sm);
	line-height: var(--kfl-line-height-snug);
	font-weight: var(--kfl-font-weight-semibold);
	color: var(--kfl-color-text-primary);
	text-transform: none;
}

/* =========================================================================
 * 4. PRODUCT SECTIONS — cards come from product-card.css unchanged
 * ====================================================================== */

.kfl-products .wd-products-element {
	margin: 0;
}

/* Discovery: 2 × 2 teasers, each a heading + two cards. */
.kfl-discovery > .e-con-inner {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--kfl-space-10) var(--kfl-space-8);
}

.kfl-teaser {
	--width: 100%;
	width: 100%;
	min-width: 0;
}

/* =========================================================================
 * 5. TRUST STRIP — three verified facts, compact
 * ====================================================================== */

.kfl-trust > .e-con-inner {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--kfl-space-4);
}

.kfl-trust-item .wd-info-box {
	display: flex;
	align-items: flex-start;
	gap: var(--kfl-space-3);
	height: 100%;
	padding: var(--kfl-space-4);
	border: var(--kfl-border-width) solid var(--kfl-color-border);
	border-radius: var(--kfl-radius-lg);
	background: var(--kfl-color-surface-subtle);
}

.kfl-trust-item .box-icon-wrapper {
	flex: 0 0 auto;
	margin: 0;
}

.kfl-trust-item .info-svg-wrapper {
	display: flex;
}

.kfl-trust-item .info-box-content {
	flex: 1 1 auto;
	min-width: 0;
}

.kfl-trust-item .info-box-title {
	margin: 0 0 2px;
	font-size: var(--kfl-font-size-base);
	line-height: var(--kfl-line-height-snug);
	font-weight: var(--kfl-font-weight-bold);
	color: var(--kfl-color-text-primary);
}

.kfl-trust-item .info-box-inner {
	font-size: var(--kfl-font-size-sm);
	line-height: var(--kfl-line-height-snug);
	color: var(--kfl-color-text-secondary);
}

.kfl-trust-item .info-box-inner p:last-child {
	margin-bottom: 0;
}

/* =========================================================================
 * 6. NEWSLETTER — inline, no popup
 * ====================================================================== */

.e-con.kfl-newsletter {
	border-radius: var(--kfl-radius-lg);
}

.kfl-newsletter > .e-con-inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	gap: var(--kfl-space-6);
}

.kfl-newsletter__title .title-after_title {
	margin-top: var(--kfl-space-1);
	font-size: var(--kfl-font-size-sm);
	color: var(--kfl-color-text-secondary);
}

.kfl-newsletter__title .title-after_title p {
	margin: 0;
}

.kfl-newsletter__form .mc4wp-form {
	max-width: 32rem;
}

.kfl-newsletter__row {
	display: flex;
	gap: var(--kfl-space-2);
}

.kfl-newsletter__row input[type="email"] {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	border-color: var(--kfl-color-border);
	background: var(--kfl-color-surface);
}

.kfl-newsletter__row input[type="submit"] {
	flex: 0 0 auto;
	height: 44px;
	padding-inline: var(--kfl-space-5);
	background: var(--kfl-color-brand-primary);
	color: var(--kfl-color-brand-on-primary);
	font-weight: var(--kfl-font-weight-bold);
	box-shadow: none;
}

.kfl-newsletter__row input[type="submit"]:hover {
	background: var(--kfl-color-brand-primary-hover);
}

.kfl-newsletter__row input[type="submit"][disabled] {
	opacity: .55;
	cursor: not-allowed;
}

.kfl-newsletter__hint,
.kfl-newsletter-note {
	margin: var(--kfl-space-2) 0 0;
	font-size: var(--kfl-font-size-xs);
	line-height: var(--kfl-line-height-snug);
	color: var(--kfl-color-text-secondary); /* muted is 4.48:1 on the subtle surface */
}

.kfl-newsletter-note {
	margin: 0;
	font-size: var(--kfl-font-size-base);
	font-weight: var(--kfl-font-weight-semibold);
	color: var(--kfl-color-text-secondary);
}

.kfl-newsletter__hint a {
	text-decoration: underline;
}

/* =========================================================================
 * 7. DEVELOPMENT NOTICE — placeholder legal/service pages (Phase 6)
 * ====================================================================== */

.kfl-dev-notice {
	margin: 0 0 var(--kfl-space-6);
	padding: var(--kfl-space-3) var(--kfl-space-4);
	border: var(--kfl-border-width) solid var(--kfl-color-accent);
	border-left-width: 4px;
	border-radius: var(--kfl-radius-md);
	background: var(--kfl-color-surface-subtle);
	font-size: var(--kfl-font-size-sm);
	line-height: var(--kfl-line-height-base);
	color: var(--kfl-color-text-primary);
}
