/* ==========================================================================
   Product category archive — woocommerce/taxonomy-product_cat.php styles
   Shares the visual language of the homepage (front-page.php / homepage.css):
   same sidebar, same product card, same buttons, same 4-column grid.
   Kept as a separate file so the homepage assets stay untouched.
   ========================================================================== */

/* ── Variables (mirrors homepage.css :root) ─────────────────────────────── */
:root {
	--hp-brand:      #7c3aed;
	--hp-brand-dk:   #5b21b6;
	--hp-brand-lt:   #f3effe;
	--hp-brand-mid:  #c4b5fd;
	--hp-coral:      #fb923c;
	--hp-ink:        #2c2438;
	--hp-muted:      #6b5e7e;
	--hp-line:       #ede8f5;
	--hp-panel:      #ffffff;
	--hp-bg:         #faf8ff;
	--hp-radius-md:  22px;
	--hp-radius-sm:  12px;
	--hp-radius-pill:50px;
	--hp-gap:        16px;
	--hp-shadow-soft:0 2px 12px rgba(124,58,237,.08);
	--hp-shadow-lift:0 8px 28px rgba(124,58,237,.18);
}

/* ── Layout ───────────────────────────────────────────────────────────────── */

/* Neutralise Storefront's outer .col-full constraint on category archives —
   same fix as .home #content .col-full (style.css) and
   body.single-product .site-content > .col-full (pdp.css). Without this,
   .hp-main is centred at .col-full's max-width and its background only
   covers that width, leaving grey side margins that don't match homepage. */
body.tax-product_cat .site-content > .col-full,
body.artsets-akce-page .site-content > .col-full {
	max-width: none;
	padding: 0;
}

.hp-main {
	background: var(--hp-bg);
}

.hp-hero {
	display: flex;
	flex-direction: column;
	gap: var(--hp-gap);
	width: 100%;
	margin: 0;
	padding: 12px 16px;
	box-sizing: border-box;
}

@media (min-width: 1024px) {
	.hp-hero {
		flex-direction: row;
		align-items: flex-start;
		padding: 12px 150px;
		gap: 20px;
	}
}

/* ── Sidebar (identical to homepage) ─────────────────────────────────────── */
.hp-sidebar {
	width: 100%;
	background: var(--hp-panel);
	border-radius: var(--hp-radius-md);
	border: 1.5px solid var(--hp-line);
	padding: 12px 0;
	box-shadow: var(--hp-shadow-soft);
}

@media (min-width: 1024px) {
	.hp-sidebar {
		width: 220px;
		flex-shrink: 0;
		position: sticky;
		top: 88px;
	}
}

/* Mobile: same as homepage — categories remain reachable via the hamburger menu. */
@media (max-width: 767px) {
	.hp-sidebar {
		display: none !important;
	}
}

.hp-sidebar-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.hp-sidebar-item {
	margin: 0;
}

.hp-sidebar-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 18px;
	font-size: 14px;
	font-weight: 600;
	color: var(--hp-ink);
	border-radius: 0;
	transition: background .13s, color .13s;
	text-decoration: none;
}

.hp-sidebar-link:hover,
.hp-sidebar-item.is-active .hp-sidebar-link {
	background: var(--hp-brand-lt);
	color: var(--hp-brand);
}

.hp-sidebar-link:focus {
	outline: none;
}

.hp-sidebar-link:focus-visible {
	outline: 2px solid var(--hp-brand);
	outline-offset: 1px;
}

.hp-sidebar-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--hp-brand);
}

.hp-sidebar-icon img {
	width: 28px;
	height: 28px;
}

.hp-sidebar-divider {
	height: 1px;
	background: var(--hp-line);
	margin: 8px 18px;
}

.hp-sidebar-blocks {
	padding: 4px 0;
}

.hp-sidebar-card {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	text-decoration: none;
	transition: background .13s;
}

.hp-sidebar-card:hover {
	background: var(--hp-brand-lt);
}

.hp-sidebar-card-badge {
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 800;
	color: #fff;
}

.hp-sidebar-card-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.hp-sidebar-card-title {
	font-size: 13px;
	font-weight: 700;
	color: var(--hp-ink);
}

.hp-sidebar-card-desc {
	font-size: 11.5px;
	color: var(--hp-muted);
}

.hp-sidebar-extra {
	padding: 8px 0 4px;
}

.hp-sidebar-widget {
	padding: 8px 18px;
}

/* ── Main content ─────────────────────────────────────────────────────────── */
.hp-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* ── Trust strip (identical to homepage .hp-trust-strip) ─────────────────── */
.hp-trust-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.hp-trust-item {
	flex: 1 1 0;
	min-width: 140px;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	background: #fff;
	border: 1.5px solid var(--hp-line);
	border-radius: var(--hp-radius-pill);
	font-size: 12.5px;
	font-weight: 600;
	color: var(--hp-ink);
	line-height: 1.3;
}

.hp-trust-icon {
	font-size: 18px;
	flex-shrink: 0;
	line-height: 1;
}

/* ── Category header ──────────────────────────────────────────────────────── */
.cat-header {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

/* Storefront wraps woocommerce_breadcrumb() in its own
   <div class="storefront-breadcrumb"><div class="col-full"><nav class="woocommerce-breadcrumb">
   (see storefront/inc/woocommerce/class-storefront-woocommerce.php). Both the wrapper
   (large margin/padding) and the nested .col-full (its own 42px side padding — a
   *different* element than the .site-content > .col-full neutralised above) push the
   breadcrumb away from .cat-title. Strip both so the breadcrumb sits flush with
   .hp-content's top/left edge, directly above the title.
   Note: the .cat-header .woocommerce-breadcrumb rule below targets <nav> directly and
   doesn't depend on this wrapper, so a future Storefront update that drops/renames
   .storefront-breadcrumb / .col-full degrades gracefully — these two wrapper rules
   would simply become unused, not break the layout. */
.cat-header .storefront-breadcrumb {
	margin: 0;
	padding: 0;
}

.cat-header .storefront-breadcrumb .col-full {
	max-width: none;
	margin: 0;
	padding: 0;
}

.cat-header .woocommerce-breadcrumb {
	margin: 0;
	padding: 0;
	font-size: 12.5px;
	color: var(--hp-muted);
}

.cat-header .woocommerce-breadcrumb a {
	color: var(--hp-muted);
	text-decoration: none;
}

.cat-header .woocommerce-breadcrumb a:hover {
	color: var(--hp-brand);
}

.cat-title {
	font-size: clamp(22px, 3vw, 32px);
	font-weight: 800;
	color: var(--hp-ink);
	margin: 0;
}

.cat-description {
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--hp-muted);
}

/* term_description() wraps text in <p> — Storefront's base p{margin:0 0 1.41575em}
   adds ~23px on top of .hp-content's 24px flex gap, making the gap above
   .hp-trust-strip almost double the gap below it. Strip it so both gaps match. */
.cat-description p {
	margin: 0;
}

.cat-description p + p {
	margin-top: 8px;
}

/* ── Product section (identical to homepage .hp-section.hp-products) ───── */
.hp-section {
	background: var(--hp-panel);
	border-radius: var(--hp-radius-md);
	border: 1.5px solid var(--hp-line);
	padding: 20px;
	box-shadow: var(--hp-shadow-soft);
}

/* ── Product grid (4 per row / 2 on mobile — same breakpoint as homepage slider) */
.hp-product-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}

@media (max-width: 860px) {
	.hp-product-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ── Product card (identical to homepage .hp-product-card) ──────────────── */
.hp-product-card {
	display: flex;
	flex-direction: column;
	background: var(--hp-panel);
	border: 1.5px solid var(--hp-line);
	border-radius: var(--hp-radius-md);
	overflow: hidden;
	transition: transform .15s, box-shadow .15s, border-color .15s;
}

.hp-product-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--hp-shadow-lift);
	border-color: transparent;
}

.hp-product-card-link {
	text-decoration: none;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.hp-product-img-wrap {
	position: relative;
	background: var(--hp-brand-lt);
	aspect-ratio: 1;
	overflow: hidden;
}

.hp-product-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .3s;
}

.hp-product-card:hover .hp-product-img {
	transform: scale(1.04);
}

.hp-product-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	padding: 3px 8px;
	border-radius: var(--hp-radius-pill);
	font-size: 11px;
	font-weight: 800;
	color: #fff;
}

.hp-product-badge--sale {
	background: #ef4444;
}

.hp-product-body {
	padding: 12px 14px 10px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	flex: 1;
}

.hp-product-name {
	font-size: 13.5px;
	font-weight: 700;
	color: var(--hp-ink);
	margin: 0;
	line-height: 1.35;
}

.hp-product-rating {
	display: flex;
	align-items: center;
	gap: 4px;
}

.hp-stars {
	display: flex;
	gap: 1px;
}

.hp-star {
	font-size: 14px;
	line-height: 1;
}

.hp-star--full  { color: #f59e0b; }
.hp-star--half  { color: #f59e0b; opacity: .5; }
.hp-star--empty { color: #d1c4e9; }

.hp-rating-score {
	font-size: 12px;
	font-weight: 700;
	color: var(--hp-ink);
}

.hp-rating-count {
	font-size: 12px;
	color: var(--hp-muted);
}

.hp-product-price {
	display: flex;
	align-items: baseline;
	gap: 6px;
	margin-top: auto;
	padding-top: 4px;
}

.hp-price-now {
	font-size: 16px;
	font-weight: 800;
	color: var(--hp-ink);
}

.hp-price-was {
	font-size: 12px;
	color: var(--hp-muted);
	text-decoration: line-through;
}

.hp-product-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 14px;
	background: var(--hp-brand);
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	border-radius: var(--hp-radius-pill);
	margin: 0 14px 14px;
	text-decoration: none;
	transition: background .14s, transform .12s;
}

/* "Do košíku" rendered as <button> for AJAX add-to-cart — reset native button chrome
   and Elementor kit's `.elementor-kit-* button{}` defaults so it matches the <a>
   variant used for "Vybrat model". */
.hp-product-btn--ajax {
	appearance: none;
	-webkit-appearance: none;
	border: none;
	cursor: pointer;
	position: relative;
	background: var(--hp-brand) !important;
	color: #fff !important;
	font-family: inherit !important;
	font-size: 13px !important;
	font-weight: 800 !important;
	border-radius: var(--hp-radius-pill) !important;
}

.hp-product-btn--ajax.loading {
	color: transparent;
	pointer-events: none;
}

/* WC core's add-to-cart.js inserts a "Zobrazit košík" link after the button on
   added_to_cart — the popup already covers this, so hide the extra link. */
.hp-product-card .added_to_cart {
	display: none !important;
}

.hp-product-btn--ajax.loading::after {
	content: "";
	position: absolute;
	width: 16px;
	height: 16px;
	top: 50%;
	left: 50%;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba(255, 255, 255, .4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: hp-btn-spin .6s linear infinite;
}

@keyframes hp-btn-spin {
	to { transform: rotate(360deg); }
}

.hp-product-btn:hover {
	background: var(--hp-brand-dk);
	transform: translateY(-1px);
}
