/* Homepage Styles */

.homepage {
	display: flex;
	flex-direction: column;
}

/* ==========================================================================
   Category Showcase
   ========================================================================== */
.homepage-categories {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	max-width: 1400px;
	margin: 2.5rem auto;
	padding: 0 1.5rem;
}

.homepage-category-tile {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	color: inherit;
	text-decoration: none;
}

.homepage-category-label {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--text-dark);
}

.homepage-category-tile img,
.homepage-category-tile .category-tile-placeholder {
	width: 100%;
	height: 320px;
	object-fit: cover;
	border-radius: 5px;
	transition: opacity 0.2s ease;
}

.homepage-category-tile:hover img {
	opacity: 0.9;
}

/* ==========================================================================
   Hero Slider
   ========================================================================== */
.homepage-hero-slider {
	/* Full-bleed: break out of .site-main's max-width/padding (main.css)
	   so the slider spans the full browser width, edge to edge. */
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	margin-bottom: 2.5rem;
}

.hero-slider .hero-slide {
	position: relative;
	height: 460px;
	overflow: hidden;
	display: flex !important;
	align-items: center;
}

.hero-slide-picture {
	position: absolute;
	inset: 0;
	display: block;
	line-height: 0;
}

.hero-slide-picture img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hero-slide-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(var(--overlay-rgb), 0.55) 0%, rgba(var(--overlay-rgb), 0.25) 55%, rgba(var(--overlay-rgb), 0) 80%);
}

/* Keeps the text aligned with the same 1400px content column as the rest
   of the homepage, instead of sitting flush against the raw viewport
   edge now that the slider itself is full-bleed. */
.hero-slide-inner {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 3rem;
}

.hero-slide-content {
	max-width: 560px;
	color: var(--white);
}

/* Force EVERY descendant (h2, p, strong/b, a, em, ...) to inherit the
   color set above rather than whatever explicit color main.css's global
   typography rules give that tag (h1-h6, strong/b, etc. all set their
   own color there, which normally beats inheritance regardless of those
   rules' low specificity - only a rule this specific reliably wins). */
.hero-slide-content * {
	color: inherit;
}

.hero-slide-content h2 {
	margin: 0 0 1.25rem;
	font-size: 2.75rem;
	line-height: 1.15;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.hero-slide-content p {
	margin: 0 0 1.75rem;
	font-size: 1.05rem;
	line-height: 1.6;
	opacity: 0.9;
}

.hero-slide-button {
	display: inline-block;
	padding: 0.85rem 1.75rem;
	background: var(--primary-color);
	color: var(--white);
	border-radius: 5px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.2s;
}

.hero-slide-button:hover {
	background: var(--primary-hover);
	text-decoration: none;
}

/* ==========================================================================
   Feature / Trust Badges
   ========================================================================== */
.homepage-features {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
	max-width: 1400px;
	margin: 0 auto 2.5rem;
	padding: 1.75rem 1.5rem;
	border-bottom: 1px solid var(--border-light);
}

.homepage-feature {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
}

.homepage-feature-icon {
	flex-shrink: 0;
	color: var(--primary-color);
}

.homepage-feature-text {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.homepage-feature-text strong {
	color: var(--text-dark);
	font-size: 1rem;
}

.homepage-feature-text span {
	color: var(--text-muted);
	font-size: 0.88rem;
	line-height: 1.5;
}

/* ==========================================================================
   Latest Products ("Novinky")
   ========================================================================== */
.homepage-products {
	max-width: 1400px;
	margin: 0 auto 3rem;
	padding: 0 1.5rem;
}

.homepage-products h2 {
	margin: 0 0 1.5rem;
	font-size: 1.4rem;
	color: var(--text-dark);
}

/* Divider between stacked homepage sections (multiple "New Products"/
   "Page" ACF blocks back to back, and before the "Blog" section below). */
.homepage-products + .homepage-products,
.homepage-blog {
	padding-top: 3rem;
	border-top: 1px solid var(--border-light);
}

.homepage-blog {
	max-width: 1400px;
	margin: 0 auto 3rem;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}

.homepage-blog h2 {
	margin: 0 0 1.5rem;
	font-size: 1.4rem;
	color: var(--text-dark);
}

.blog-container {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.5rem;
}

.blog-block {
	background: var(--white);
	border: 1px solid var(--border-light);
	border-radius: 5px;
	overflow: hidden;
	transition: all 0.2s;
}

.blog-block:hover {
	box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.15);
	border-color: var(--primary-color);
}

.blog-block a {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.blog-img {
	height: 200px;
	overflow: hidden;
}

.blog-img img,
.blog-img .category-tile-placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.blog-img img {
	display: block;
}

.blog-date {
	margin: 0.75rem 0.75rem 0;
	font-size: 0.75rem;
	color: var(--text-gray);
}

.blog-block h2 {
	margin: 0.35rem 0.75rem;
	font-size: 1rem;
	line-height: 1.3;
	color: var(--text-dark);
}

.blog-perex {
	margin: 0 0.75rem;
	font-size: 0.85rem;
	line-height: 1.4;
	color: var(--text-gray);
	flex-grow: 1;
}

.blog-link {
	margin: 0.75rem;
	color: var(--primary-color);
	font-weight: 600;
	font-size: 0.85rem;
}

@media (max-width: 1024px) {
	.blog-container {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.blog-container {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}
}

.homepage-products-grid {
	list-style: none !important;
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	gap: 1.5rem !important;
	margin: 0 !important;
	padding: 0 !important;
}

.homepage-products-grid::before,
.homepage-products-grid::after {
	display: none !important;
	content: none !important;
}

.homepage-products-grid li.product {
	position: relative; /* anchors the .onsale badge below */
	display: flex !important;
	flex-direction: column;
	background: var(--white);
	border: 1px solid var(--border-light);
	border-radius: 5px;
	overflow: hidden;
	transition: all 0.2s;
	float: none !important;
	width: auto !important;
	margin: 0 !important;
}

.homepage-products-grid li.product:hover {
	box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.15);
	border-color: var(--primary-color);
}

/* WooCommerce's own .onsale badge styling only kicks in inside a
   ".woocommerce ul.products" wrapper (see plugins/woocommerce/assets/css/
   woocommerce.css) - our homepage grid uses its own markup/classes and
   has neither, so the badge needs its own self-contained style here.
   Diagonal ribbon across the top-left corner of the image - "overflow:
   hidden" on li.product (set above) clips the corners that hang outside. */
.homepage-products-grid li.product .onsale {
	position: absolute;
	top: 16px;
	left: -38px;
	z-index: 2;
	width: 140px;
	margin: 0;
	padding: 0.35rem 0;
	background-color: var(--primary-color);
	color: var(--white);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-align: center;
	text-transform: uppercase;
	line-height: 1.2;
	border-radius: 0;
	min-width: 0;
	min-height: 0;
	transform: rotate(-45deg);
	box-shadow: 0 2px 6px rgba(var(--shadow-rgb), 0.15);
}

.homepage-products-grid li.product a.woocommerce-LoopProduct-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.homepage-products-grid li.product img {
	width: 100%;
	height: 260px;
	object-fit: cover;
	display: block;
}

.homepage-products-grid li.product h2,
.homepage-products-grid li.product h3 {
	margin: 0.75rem;
	margin-bottom: 0.25rem;
	font-size: 1rem;
	line-height: 1.3;
	color: var(--text-dark);
}

.homepage-products-grid li.product .product-short-description {
	margin: 0.5rem 0.75rem;
	font-size: 0.85rem;
	line-height: 1.4;
	color: var(--text-gray);
}

.homepage-products-grid li.product .price {
	margin: 0 0.75rem 0.75rem;
	color: var(--primary-color);
	font-weight: 600;
	font-size: 1.1rem;
}

.homepage-products-grid li.product .button {
	display: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
	.homepage-features {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}

	.homepage-products-grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

@media (max-width: 768px) {
	.homepage-categories {
		grid-template-columns: 1fr;
	}

	.homepage-category-tile img,
	.homepage-category-tile .category-tile-placeholder {
		height: 220px;
	}

	.hero-slider .hero-slide {
		height: 380px;
	}

	.hero-slide-inner {
		padding: 0 1.5rem;
	}

	.hero-slide-content {
		max-width: 100%;
	}

	.hero-slide-content h2 {
		font-size: 1.9rem;
	}

	.hero-slide-overlay {
		background: linear-gradient(180deg, rgba(var(--overlay-rgb), 0.15) 0%, rgba(var(--overlay-rgb), 0.65) 100%);
	}
}

@media (max-width: 480px) {
	.homepage-products-grid {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 0.75rem !important;
	}

	.homepage-products-grid li.product img {
		height: 160px;
	}

	.hero-slide-content h2 {
		font-size: 1.5rem;
	}
}
