/*
 * Homepage – compact mobile layout (max 767px).
 * Loaded on the front page only (inc/home-mobile.php).
 * Hero and footer are intentionally untouched.
 */

/* Marquee element is created by JS; hidden on larger screens. */
.gr-usp-marquee,
.gr-mslider-dots {
	display: none;
}

@media (max-width: 767.98px) {
	/* ---------- General rhythm ---------- */
	body.home .entry-content {
		--theme-section-spacing: 24px;
	}

	body.home .entry-content > .gb-container + .gb-container,
	body.home .entry-content > .gb-element-a73e0d36 + .gb-container {
		margin-top: 8px;
	}

	/* Section headings a bit smaller & closer to content */
	body.home .gb-headline-8fc5c7ca,
	body.home .gb-headline-5ed13def,
	body.home .gb-headline-2f8500f4,
	body.home .gb-headline-cc0dbf9b,
	body.home .gb-headline-f9230495,
	body.home .gb-headline-4583c275,
	body.home .gb-headline-84d9bc8b {
		margin-bottom: 14px !important;
	}

	/* "Vezi toate ..." buttons: less space above */
	body.home .gb-element-f7608851,
	body.home .gb-element-712720ff,
	body.home .gb-element-839d6ebe,
	body.home .gb-element-471408a7 {
		margin-top: 18px !important;
	}

	/* ---------- Inspiră-ți grădina zi de zi: marquee ---------- */
	body.home .gb-element-1689ec8b {
		padding-top: 14px !important;
		padding-bottom: 14px !important;
	}

	body.home .gb-text-30322c02 {
		margin-bottom: 12px !important;
	}

	body.home.gr-has-marquee .slider-usp {
		display: none !important;
	}

	.gr-usp-marquee {
		display: block;
		position: relative;
		margin: 0 -20px;
		overflow: hidden;
		-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
		mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
	}

	.gr-usp-marquee__track {
		display: flex;
		width: max-content;
		animation: gr-usp-marquee var(--gr-marquee-duration, 22s) linear infinite;
		will-change: transform;
	}

	.gr-usp-marquee__group {
		display: flex;
		flex-shrink: 0;
		align-items: center;
		gap: 28px;
		padding-right: 28px;
	}

	.gr-usp-marquee__item {
		flex-shrink: 0;
		margin: 0 !important;
		white-space: nowrap;
	}

	@keyframes gr-usp-marquee {
		from { transform: translate3d(0, 0, 0); }
		to { transform: translate3d(-50%, 0, 0); }
	}

	/* ---------- Categorii produse: 2 per row ---------- */
	body.home .home-cat {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 12px !important;
	}

	body.home .home-cat .wc-block-featured-category {
		--wc-featured-item-min-height: 0px;
		min-height: 0 !important;
		height: auto !important;
		aspect-ratio: 4 / 5;
	}

	body.home .home-cat .wc-block-featured-category__wrapper {
		width: 100% !important;
		height: 100% !important;
		min-height: 0 !important;
		padding: 12px 8px !important;
		justify-content: flex-end;
	}

	body.home .home-cat .wc-block-featured-category__inner-blocks {
		width: 100%;
		margin: 0 !important;
	}

	body.home .home-cat .wc-block-featured-category h2 {
		margin: 0 0 8px !important;
		padding: 0 !important;
		font-size: 17px !important;
		line-height: 1.2 !important;
	}

	body.home .home-cat .wp-block-buttons {
		margin: 0 !important;
		justify-content: center;
	}

	body.home .home-cat .wp-block-button__link {
		padding: 7px 12px !important;
		min-height: 0 !important;
		font-size: 13px !important;
		line-height: 1.3 !important;
	}

	/* ---------- Sliders: Top vânzări, Produse noi, Noutăți și sfaturi ---------- */
	body.home .gr-mslider {
		display: flex !important;
		grid-template-columns: none !important;
		gap: 12px !important;
		margin-left: -20px !important;
		margin-right: -20px !important;
		padding: 0 20px 4px !important;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-left: 20px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	body.home .gr-mslider::-webkit-scrollbar {
		display: none;
	}

	body.home .gr-mslider > * {
		flex: 0 0 68% !important;
		width: auto !important;
		max-width: none !important;
		margin: 0 !important;
		scroll-snap-align: start;
	}

	body.home .gr-mslider--posts > * {
		flex-basis: 80% !important;
	}

	/* compact product cards inside the slider */
	body.home .gr-mslider .woocommerce-loop-product__title {
		font-size: 15px !important;
		line-height: 1.3 !important;
		margin-bottom: 4px !important;
	}

	body.home .gr-mslider .price {
		font-size: 14px !important;
	}

	body.home .gr-mslider .entry-meta,
	body.home .gr-mslider li.product .meta-categories {
		font-size: 11px !important;
	}

	body.home .gr-mslider li.product .button {
		min-height: 38px !important;
		padding: 6px 12px !important;
		font-size: 13px !important;
	}

	/* compact blog cards */
	body.home .gr-mslider--posts .entry-title {
		font-size: 16px !important;
		line-height: 1.3 !important;
	}

	body.home .gr-mslider--posts .entry-excerpt {
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
		font-size: 14px;
	}

	/* dots */
	.gr-mslider-dots {
		display: flex;
		justify-content: center;
		gap: 6px;
		margin-top: 12px;
	}

	.gr-mslider-dots button {
		width: 8px;
		height: 8px;
		min-height: 0;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 8px;
		background: var(--theme-palette-color-1, #0c6641);
		opacity: 0.25;
		cursor: pointer;
		transition: width 0.25s ease, opacity 0.25s ease;
	}

	.gr-mslider-dots button[aria-current='true'] {
		width: 22px;
		opacity: 1;
	}

	/* ---------- Clienții noștri: 3 per row ---------- */
	body.home .gb-element-e2a84941 {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
		gap: 10px !important;
	}

	/* ---------- Lucrările noastre: 3-col grid, first 9 photos ---------- */
	body.home .gb-container-97818516 .gallery {
		display: grid !important;
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
		gap: 8px !important;
		columns: auto !important;
	}

	body.home .gb-container-97818516 .gallery > a {
		position: relative;
		display: block;
		width: auto !important;
		margin: 0 !important;
		aspect-ratio: 1;
		overflow: hidden;
		border-radius: 12px;
	}

	body.home .gb-container-97818516 .gallery > a img {
		width: 100% !important;
		height: 100% !important;
		object-fit: cover;
	}

	body.home .gb-container-97818516 .gallery > a:nth-of-type(n + 10) {
		display: none !important;
	}

	body.home .gb-container-97818516 .gallery > a[data-gr-more]::after {
		content: attr(data-gr-more);
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		background: rgba(4, 61, 37, 0.6);
		color: #fff;
		font-size: 22px;
		font-weight: 700;
	}

	/* ---------- Instagram: tighter spacing ---------- */
	body.home #sb_instagram #sbi_images {
		padding-top: 4px !important;
		padding-bottom: 4px !important;
	}
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
	.gr-usp-marquee__track {
		animation: none;
		width: auto;
	}

	.gr-usp-marquee__group {
		flex-wrap: wrap;
		justify-content: center;
		gap: 8px 20px;
		padding: 0 20px;
	}

	.gr-usp-marquee__group[aria-hidden='true'] {
		display: none;
	}
}
