/**
 * Homepage layout (concept A) — loaded only on pages that use the "dsfw-home" wrapper
 *
 * @since 1.25.0
 */

/* The page title is not needed on the homepage layout */
.dsfw-home-page .hero-section {
	display: none;
}

.dsfw-home {
	display: flex;
	flex-direction: column;
	gap: 48px;
	margin-top: 8px;
	margin-bottom: 48px;
}

.dsfw-home > * {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

/* ---------- Hero: carousel + 2 star offers ---------- */
/*
 * Banners are 1000x448. The side column width makes the slider exactly as tall as the
 * 2 stacked star offers (+16px gap): side = (100% - gap - gap * 1000/448) / 3
 */
.dsfw-home__hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) calc((100% - 16px - 35.72px) / 3);
	gap: 16px;
	align-items: stretch;
}

.dsfw-home__hero-main {
	min-width: 0;
	border-radius: 18px;
	overflow: hidden;
}

.dsfw-home__hero-main .dsfw-slider-container,
.dsfw-home__hero-main .dsfw-slider,
.dsfw-home__hero-main .dsfw-banner-stack,
.dsfw-home__hero-main .dsfw-banner {
	height: 100%;
	border-radius: 18px;
	overflow: hidden;
}

.dsfw-home__hero-main .dsfw-slider .swiper-slide img {
	height: 100%;
	object-fit: cover;
}

.dsfw-home__hero-side {
	min-width: 0;
}

/* No star offers: the slider takes the full width */
.dsfw-home__hero:not(:has(.dsfw-home__hero-side *)) {
	grid-template-columns: minmax(0, 1fr);
}

.dsfw-home__hero-side:not(:has(*)) {
	display: none;
}

/* Tablet and phone: slider on top, the 2 star offers side by side under it */
@media (max-width: 999px) {
	.dsfw-home__hero {
		grid-template-columns: minmax(0, 1fr);
	}

	.dsfw-home__hero-side .dsfw-banner-stack {
		flex-direction: row;
		gap: 12px;
	}

	.dsfw-home__hero-side .dsfw-banner {
		flex: 1 1 0;
		min-width: 0;
	}
}

/* ---------- Page title (H1) ---------- */
/* Sits between the hero and the shop promises strip */
.dsfw-home__title {
	margin: -24px 0 -12px !important;
	color: #1F2A33;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
}

/* ---------- Shop promises: shipping, delivery, advice, payment ---------- */
.dsfw-home__usps {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin-top: -24px !important;
}

.dsfw-home__usp {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid #E2E7ED;
	border-radius: 16px;
	color: #1F2A33;
	line-height: 1.3;
}

.dsfw-home__usp svg {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	color: #3E7B27;
}

.dsfw-home__usp strong {
	display: block;
	font-size: 15px;
}

.dsfw-home__usp span {
	display: block;
	color: #5B6670;
	font-size: 13px;
}

@media (max-width: 689px) {
	.dsfw-home__usps {
		grid-template-columns: minmax(0, 1fr);
		gap: 8px;
	}

	.dsfw-home__usp {
		justify-content: flex-start;
	}

	.dsfw-home__pay {
		margin-top: -28px !important;
		padding: 14px 12px;
	}

}

@media (max-width: 479px) {
	.dsfw-home__usp {
		padding: 10px 12px;
		gap: 8px;
	}

	.dsfw-home__usp svg {
		width: 24px;
		height: 24px;
	}

	.dsfw-home__usp strong {
		font-size: 14px;
	}

	.dsfw-home__usp span {
		font-size: 12px;
	}
}

/* Payment strip under the 3 promises: card, Apple Pay, Google Pay */
.dsfw-home__pay {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px 28px;
	margin-top: -36px !important;
	padding: 16px 24px;
	background: #fff;
	border: 1px solid #3E7B27;
	border-radius: 16px;
	text-align: center;
}

.dsfw-home__pay-text strong {
	display: block;
	color: #1F2A33;
	font-size: 16px;
	line-height: 1.3;
}

.dsfw-home__pay-text span {
	display: block;
	color: #5B6670;
	font-size: 13px;
	line-height: 1.3;
}

/* Same size as the "Plăți rapide și sigure" title */
.dsfw-home__pay-alt {
	display: block;
	color: #1F2A33;
	font-size: 16px;
	line-height: 1.3;
}

.dsfw-home__pay-marks {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dsfw-home__pay-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 3px;
	height: 40px;
	min-width: 64px;
	margin: 0;
	padding: 0 12px;
	background: #fff;
	border: 1px solid #D0D5DB;
	border-radius: 8px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 19px;
	font-weight: 500;
	line-height: 1;
}

.dsfw-home__pay-mark svg {
	display: block;
}

.dsfw-home__pay-mark--visa svg {
	width: 52px;
	height: 26px;
}

.dsfw-home__pay-mark--mc svg {
	width: 40px;
	height: 26px;
}

.dsfw-home__pay-mark--apple {
	background: #000;
	border-color: #000;
	color: #fff;
}

.dsfw-home__pay-mark--apple svg {
	width: 18px;
	height: 20px;
	margin-top: -3px;
}

.dsfw-home__pay-mark--gpay {
	border-color: #747775;
	color: #3C4043;
}

.dsfw-home__pay-mark--gpay svg {
	width: 18px;
	height: 18px;
	margin-right: 2px;
}

/* Phones: all 4 payment marks on one row (after the base rules so they win) */
@media (max-width: 689px) {
	.dsfw-home__pay-marks {
		flex: 1 1 100%;
		gap: 6px;
	}

	.dsfw-home__pay-mark {
		height: 36px;
		min-width: 0;
		padding: 0 8px;
		font-size: 17px;
	}

	.dsfw-home__pay-mark--visa svg {
		width: 44px;
	}

	.dsfw-home__pay-mark--mc svg {
		width: 34px;
	}
}

/* ---------- Section heading ---------- */
.dsfw-home__head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 8px 16px;
	margin-bottom: 16px;
}

.dsfw-home__head h2 {
	margin: 0;
	font-size: 28px;
	font-weight: 800;
	line-height: 1.2;
}

.dsfw-home__head a {
	font-weight: 700;
	color: #2F6B1E;
	text-decoration: none;
}

.dsfw-home__head a:hover {
	text-decoration: underline;
}

/* ---------- Category shortcuts ---------- */
.dsfw-home__cats {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
	gap: 12px;
}

.dsfw-home__cat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 18px 10px;
	background: #fff;
	border: 1px solid #E2E7ED;
	border-radius: 16px;
	text-align: center;
	color: #1F2A33;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.dsfw-home__cat:hover {
	border-color: #3E7B27;
	box-shadow: 0 6px 18px rgba(31, 42, 51, .08);
	color: #1F2A33;
}

.dsfw-home__cat-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #E8F3E1;
	color: #2F6B1E;
}

.dsfw-home__cat-icon svg {
	width: 26px;
	height: 26px;
}

/* ---------- Pharmacy services band ---------- */
.dsfw-home__services {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 20px;
	padding: 32px;
	border-radius: 24px;
	background: #1F4A13;
	color: #fff;
}

.dsfw-home__services h2 {
	margin: 0 0 8px;
	color: #fff;
	font-size: 24px;
	font-weight: 800;
}

.dsfw-home__services p {
	margin: 0;
	color: #D3E7C8;
	line-height: 1.5;
}

.dsfw-home__service {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 18px;
	border-radius: 16px;
	background: #2B5E1B;
	color: #fff;
	text-decoration: none;
	transition: background .2s ease;
}

.dsfw-home__service:hover {
	background: #33701F;
	color: #fff;
}

.dsfw-home__service strong {
	font-size: 17px;
}

.dsfw-home__service span {
	color: #D3E7C8;
	font-size: 14px;
}

/* ---------- Brands ---------- */
.dsfw-home__brands {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}

.dsfw-home__brand {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 64px;
	padding: 8px;
	background: #fff;
	border: 1px solid #E2E7ED;
	border-radius: 12px;
	color: #1F2A33;
	font-weight: 800;
	font-size: 14px;
	letter-spacing: .06em;
	text-align: center;
	text-decoration: none;
}

/* Brand logos are square images with empty space around the name: a taller box, slightly zoomed in */
.dsfw-home__brand--logo {
	padding: 6px 10px;
	overflow: hidden;
}

.dsfw-home__brand--logo img {
	display: block;
	width: 100%;
	height: 96px !important;
	object-fit: contain;
	transform: scale(1.35);
}

@media (max-width: 689px) {
	.dsfw-home__brand--logo img {
		height: 72px !important;
	}
}

.dsfw-home__brand:hover {
	border-color: #3E7B27;
	color: #2F6B1E;
}

/* ---------- Product shelves (Blocksy cards from [products]) ---------- */
.dsfw-home .woocommerce {
	margin: 0;
}

@media (max-width: 689px) {
	.dsfw-home {
		gap: 36px;
	}

	.dsfw-home__head h2 {
		font-size: 22px;
	}

	.dsfw-home__services {
		padding: 20px;
	}
}
