/**
 * Κατάλογος προϊόντων (κατηγορίες, shop, αναζήτηση)
 * Φορτώνει σε σελίδες καταλόγου (.lino-catalog) και σε σελίδες προϊόντος για τα σχετικά (.lino-related), βλ. assets/php/catalog-chips.php.
 * Πλέγμα: 2 στήλες κινητό, 3 tablet, 4 laptop, 5 μεγάλη οθόνη.
 */

body.lino-catalog,
body.lino-related {
	--lino-brand: #972f67;
	--lino-price: #972071;
	--lino-ink: #54595f;
	--lino-muted: #6b7077;
	--lino-line: #e4e2e6;
	--lino-gap: 10px;
	--lino-cols: 2;
}
@media (min-width: 640px) {
	body.lino-catalog, body.lino-related { --lino-cols: 3; --lino-gap: 16px; }
}
@media (min-width: 960px) {
	body.lino-catalog, body.lino-related { --lino-cols: 4; --lino-gap: 18px; }
}
@media (min-width: 1280px) {
	body.lino-catalog, body.lino-related { --lino-cols: 5; --lino-gap: 20px; }
}

/* Σχετικά προϊόντα (σελίδα προϊόντος): 4 προϊόντα, άρα 2 στήλες κινητό και 4 από tablet */
body.lino-related .related.products ul.products { --lino-cols: 2; }
@media (min-width: 768px) {
	body.lino-related .related.products ul.products { --lino-cols: 4; }
}
body.lino-related .related.products > h2 {
	margin: 0 0 16px;
	font-size: clamp(20px, 2.4vw, 26px);
	font-weight: 700;
	color: #54595f;
}
/* Ίδιος τίτλος με τον κατάλογο (το παλιό στυλ ήταν κεφαλαία, weight 300) */
body.lino-related.single-product .related.products .woocommerce-loop-product__title {
	text-transform: none;
	font-weight: 600 !important;
	margin-top: 12px;
}

/* Πλάτος περιεχομένου: το παλιό 115% προκαλούσε οριζόντια υπερχείλιση */
@media (min-width: 768px) {
	body.lino-catalog.archive main#main,
	body.lino-catalog main#main {
		width: 100%;
	}
}
body.lino-catalog #content > div.col-full {
	padding-left: max(12px, env(safe-area-inset-left, 0px));
	padding-right: max(12px, env(safe-area-inset-right, 0px));
}
@media (min-width: 768px) {
	body.lino-catalog #content > div.col-full {
		padding-left: 24px;
		padding-right: 24px;
	}
}

/* Γρήγορα φίλτρα (chips) */
.lino-chips {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 4px 2px 10px;
	margin: 0 0 6px;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.lino-chips::-webkit-scrollbar {
	display: none;
}
.lino-chip {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid var(--lino-line, #e4e2e6);
	border-radius: 999px;
	background: #fff;
	color: #54595f;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.lino-chip:hover {
	border-color: #972f67;
	color: #972f67;
}
.lino-chip.is-active {
	background: #f6e9f0;
	border-color: #972f67;
	color: #7d2556;
}
.lino-chip__n {
	font-size: 12px;
	font-weight: 600;
	color: #6b7077;
}
.lino-chip.is-active .lino-chip__n {
	color: #7d2556;
}
.lino-chip:focus-visible {
	outline: 3px solid #972f67;
	outline-offset: 2px;
}

/* Μπάρα εργαλείων: πλήθος αποτελεσμάτων και ταξινόμηση */
body.lino-catalog .storefront-sorting {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
	margin: 0 0 16px;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid var(--lino-line);
	border-radius: 12px;
}
body.lino-catalog .storefront-sorting .woocommerce-result-count {
	order: 1;
	float: none;
	margin: 0;
	font-size: 13px;
	color: var(--lino-muted);
}
body.lino-catalog .storefront-sorting .woocommerce-ordering {
	order: 2;
	float: none;
	margin: 0;
}
body.lino-catalog .storefront-sorting .woocommerce-ordering select {
	min-height: 40px;
	padding: 8px 12px;
	border: 1px solid var(--lino-line);
	border-radius: 10px;
	background-color: #f8f8f8;
	font-size: 13px;
	font-weight: 600;
	color: var(--lino-ink);
}
@media (max-width: 639px) {
	body.lino-catalog .storefront-sorting .woocommerce-result-count {
		order: 3;
		flex-basis: 100%;
	}
	body.lino-catalog .storefront-sorting .woocommerce-ordering {
		width: 100%;
	}
	body.lino-catalog .storefront-sorting .woocommerce-ordering select {
		width: 100%;
	}
}

/* Πλέγμα προϊόντων */
:is(body.lino-catalog, body.lino-related) ul.products {
	display: grid !important;
	grid-template-columns: repeat(var(--lino-cols), minmax(0, 1fr));
	gap: var(--lino-gap);
	align-items: stretch;
	margin: 0 0 24px;
	padding: 0;
	flex-direction: row;
}
:is(body.lino-catalog, body.lino-related) ul.products::before,
:is(body.lino-catalog, body.lino-related) ul.products::after {
	display: none !important;
}
:is(body.lino-catalog, body.lino-related) ul.products li.product,
:is(body.lino-catalog, body.lino-related) .site-main ul.products[class*="columns-"] li.product {
	position: relative;
	display: flex !important;
	flex-direction: column;
	float: none !important;
	clear: none !important;
	width: auto !important;
	min-width: 0;
	margin: 0 !important;
	padding: 10px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(40, 20, 35, 0.06), 0 6px 18px rgba(40, 20, 35, 0.07);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
:is(body.lino-catalog, body.lino-related) ul.products li.product:hover,
:is(body.lino-catalog, body.lino-related) ul.products li.product.type-product:hover {
	box-shadow: 0 2px 4px rgba(40, 20, 35, 0.08), 0 14px 30px rgba(40, 20, 35, 0.14);
	transform: translateY(-3px);
}
@media (hover: none) {
	:is(body.lino-catalog, body.lino-related) ul.products li.product:hover {
		transform: none;
	}
}

/* Φωτογραφία: ίδιο κουτί 1:1 για τετράγωνες και κάθετες */
:is(body.lino-catalog, body.lino-related) ul.products li.product .woocommerce-LoopProduct-link {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}
:is(body.lino-catalog, body.lino-related) ul.products li.product img {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 8px;
	transition: transform 0.45s ease;
}
:is(body.lino-catalog, body.lino-related) ul.products li.product:hover img {
	transform: scale(1.04);
}
/* Το zoom μένει μέσα στο κουτί της φωτογραφίας */
:is(body.lino-catalog, body.lino-related) ul.products li.product .woocommerce-LoopProduct-link {
	overflow: hidden;
	border-radius: 8px;
}

/* Τίτλος: έως 2 γραμμές, ώστε τιμές και κουμπιά να ευθυγραμμίζονται */
:is(body.lino-catalog, body.lino-related) ul.products li.product .woocommerce-loop-product__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 12px 4px 0;
	padding: 0;
	min-height: calc(2 * 1.35em);
	font-size: 14px !important;
	line-height: 1.35;
	text-align: center;
}
:is(body.lino-catalog, body.lino-related) ul.products li.product .price {
	display: block;
	margin: auto 0 0;
	padding-top: 8px;
	font-size: 18px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

/* Διαθεσιμότητα και κουμπί */
:is(body.lino-catalog, body.lino-related) ul.products li.product .skroutz-availability {
	margin: 8px 0 0;
	font-size: 12px;
	text-align: center;
}
:is(body.lino-catalog, body.lino-related) ul.products li.product .button {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	margin: 8px 0 0;
	text-align: center;
	line-height: 1.2;
}

/* Wishlist (TI WooCommerce Wishlist): στρογγυλό κουμπί πάνω δεξιά στη φωτογραφία */
:is(body.lino-catalog, body.lino-related) ul.products li.product .tinvwl-loop {
	top: 18px;
	right: 18px;
	width: 40px;
	height: 40px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
	border-color: transparent;
}
:is(body.lino-catalog, body.lino-related) ul.products li.product .tinvwl-loop::before {
	width: 18px;
	height: 18px;
}
/* Υπάρχον badge «-20% στο 2ο σεντόνι»: πάνω αριστερά στη φωτογραφία */
:is(body.lino-catalog, body.lino-related) ul.products li.product .wecom-sheets-cat-badge {
	top: 18px;
	left: 18px;
}

/* Κινητό: πιο συμπαγείς κάρτες */
@media (max-width: 639px) {
	:is(body.lino-catalog, body.lino-related) ul.products li.product {
		padding: 8px;
		border-radius: 10px;
	}
	:is(body.lino-catalog, body.lino-related) ul.products li.product .woocommerce-loop-product__title {
		font-size: 12.5px !important;
		margin-top: 10px;
	}
	:is(body.lino-catalog, body.lino-related) ul.products li.product .price {
		font-size: 16px;
	}
	:is(body.lino-catalog, body.lino-related) ul.products li.product .skroutz-availability {
		font-size: 11px;
	}
	:is(body.lino-catalog, body.lino-related) ul.products li.product .button {
		padding: 10px 4px !important;
		font-size: 11.5px;
	}
	:is(body.lino-catalog, body.lino-related) ul.products li.product .tinvwl-loop {
		top: 14px;
		right: 14px;
		width: 34px;
		height: 34px;
	}
	:is(body.lino-catalog, body.lino-related) ul.products li.product .wecom-sheets-cat-badge {
		top: 14px;
		left: 14px;
	}
}

/* Σελιδοποίηση */
body.lino-catalog .woocommerce-pagination {
	margin: 8px 0 24px;
}
body.lino-catalog .woocommerce-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	border: 0;
}
body.lino-catalog .woocommerce-pagination ul.page-numbers li {
	border: 0;
	float: none;
}
body.lino-catalog .woocommerce-pagination .page-numbers a,
body.lino-catalog .woocommerce-pagination .page-numbers span.page-numbers {
	display: grid;
	place-items: center;
	min-width: 42px;
	height: 42px;
	padding: 0 10px;
	border: 1px solid var(--lino-line);
	border-radius: 10px;
	background: #fff;
	font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
	:is(body.lino-catalog, body.lino-related) ul.products li.product,
	:is(body.lino-catalog, body.lino-related) ul.products li.product img,
	.lino-chip {
		transition: none;
	}
	:is(body.lino-catalog, body.lino-related) ul.products li.product:hover {
		transform: none;
	}
}
