/* Hardware Attitude — Catalog list page */

/* === Layout: sidebar + list === */

.ha-catalog-list {
	padding: 0;
}

.ha-list-inner {
	max-width: 80rem;
	margin: 0 auto;
	padding: 0 1rem;
}

/* Hide default Aimeos list head (we use stage for title) */
.ha-catalog-list .catalog-list-head { display: none; }

/* === Info bar: count + sort/view === */

.ha-list-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 0;
	border-top: 1px solid #e9ecef;
	border-bottom: 1px solid #e9ecef;
	margin-bottom: 1rem;
}

.ha-list-count {
	font-size: 0.8125rem;
	color: #6c757d;
	margin: 0;
}

.ha-list-count strong {
	color: #343a40;
}

.ha-list-sort {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

/* Tri en select (remplace la liste de liens du paginateur) */
.pagination .sort {
	display: none;
}

.ha-sort-wrap {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.8125rem;
}

.ha-sort-label {
	color: #6c757d;
	white-space: nowrap;
}

.ha-sort {
	font-size: 0.8125rem;
	color: var(--ai-primary, #212529);
	background-color: #fff;
	border: 1px solid #ced4da;
	border-radius: 0.5rem;
	padding: 0.375rem 1.75rem 0.375rem 0.625rem;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23495057' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.5rem center;
}

.ha-sort:hover,
.ha-sort:focus {
	border-color: var(--ai-secondary, #495057);
	outline: none;
}

/* View type icons */
.ha-catalog-list .catalog-list-type {
	text-align: end;
}

.ha-catalog-list .catalog-list-type .type-item {
	display: inline-block;
	padding: 0.5rem;
	color: #adb5bd;
}

.ha-catalog-list .catalog-list-type .type-item:hover {
	color: var(--ai-secondary);
}

.ha-catalog-list .catalog-list-type .type-grid:after {
	font: normal normal normal 18px/1 bootstrap-icons;
	content: "\f3fc";
}

.ha-catalog-list .catalog-list-type .type-list:after {
	font: normal normal normal 18px/1 bootstrap-icons;
	content: "\f606";
}

/* === Sort bar === */

.sort {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.8125rem;
}

.sort > span {
	color: #6c757d;
	white-space: nowrap;
}

.sort ul {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 0.125rem;
}

.aimeos .sort a,
.aimeos .sort a:link,
.aimeos .sort a:visited,
.ha-catalog-list .sort a,
.ha-catalog-list .sort a:link,
.ha-catalog-list .sort a:visited,
.pagination .sort a,
.pagination .sort a:link,
.pagination .sort a:visited {
	color: #6c757d !important;
	text-decoration: none;
	padding: 0.25rem 0.5rem;
	border-radius: 0.25rem;
	transition: color 0.15s, background 0.15s;
}

.aimeos .sort a:hover,
.ha-catalog-list .sort a:hover,
.pagination .sort a:hover {
	color: #343a40 !important;
	background: #f1f3f5;
}

.aimeos .sort a.active,
.aimeos .sort a.active:link,
.aimeos .sort a.active:visited,
.ha-catalog-list .sort a.active,
.ha-catalog-list .sort a.active:link,
.ha-catalog-list .sort a.active:visited,
.pagination .sort a.active,
.pagination .sort a.active:link,
.pagination .sort a.active:visited {
	color: #343a40 !important;
	font-weight: 600;
}

/* === Grid view (default, class product-list) === */

.ha-catalog-list .catalog-list-items.product-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
	gap: 1rem;
}

.ha-catalog-list .catalog-list-items.product-list .product {
	display: flex !important;
	flex-direction: column !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0.75rem;
	background: #fff;
	border: 1px solid #e9ecef;
	border-radius: 0.75rem;
	text-decoration: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.ha-catalog-list .catalog-list-items.product-list .product:hover {
	border-color: #bcd8ff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ha-catalog-list .catalog-list-items.product-list .product .list-column {
	width: 100% !important;
	flex: 0 0 auto !important;
	min-width: 0;
	margin: 0;
}

.ha-catalog-list .catalog-list-items.product-list .product .list-column:last-child {
	flex: 1 1 auto !important;
	display: flex;
	flex-direction: column;
}

.ha-catalog-list .catalog-list-items.product-list .product .media-list,
.aimeos.ha-catalog-list .product-list div.list-column:first-of-type .media-list {
	width: 100%;
	aspect-ratio: 1 / 1;
	max-height: 15rem;
	height: auto;
	padding-top: 0 !important;
	border-radius: 0.5rem;
	margin: 0 auto 0.125rem;
	overflow: hidden;
	background: #fff;
	max-width: 15rem;
}

.ha-catalog-list .catalog-list-items.product-list .product .media-list .media-item {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.ha-catalog-list .catalog-list-items.product-list .product .media-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	padding: 0;
}

/* Bloc note/étoiles vide (pas d'avis en B2B) : masqué pour coller le titre sous l'image */
.ha-catalog-list .catalog-list-items.product-list .product .product-info {
	display: none;
}

.ha-catalog-list .catalog-list-items.product-list .product a,
.ha-catalog-list .catalog-list-items.product-list .product a:link,
.ha-catalog-list .catalog-list-items.product-list .product a:visited {
	color: inherit;
	text-decoration: none;
	display: block;
}

.ha-catalog-list .catalog-list-items.product-list .product .text-list .name {
	white-space: normal !important;
	text-overflow: clip !important;
}

.ha-catalog-list .catalog-list-items.product-list .product .text-list .text-item {
	white-space: normal !important;
	text-overflow: clip !important;
	font-size: 0.75rem;
	color: #6c757d;
	line-height: 1.4;
	margin-top: 0.25rem;
	display: -webkit-box !important;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden !important;
}

.ha-catalog-list .catalog-list-items.product-list .product .text-list .name {
	font-size: 0.8125rem;
	font-weight: 600;
	min-height: 2.25rem;
	line-height: 1.4;
	color: #343a40;
	text-transform: none !important;
	display: -webkit-box !important;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden !important;
}

.ha-catalog-list .catalog-list-items.product-list .product .offer {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
}

/* Flatten .section and the basket form so price / button / stock
   become direct flex children of .offer and can be reordered */
.ha-catalog-list .catalog-list-items.product-list .product .offer .section,
.ha-catalog-list .catalog-list-items.product-list .product .offer form.basket {
	display: contents;
}

.ha-catalog-list .catalog-list-items.product-list .product .price-list {
	order: 1;
	text-align: center;
	margin-inline-start: 0;
}

.ha-catalog-list .catalog-list-items.product-list .product .stock-list {
	order: 3;
}

.ha-catalog-list .catalog-list-items.product-list .product .addbasket {
	order: 2;
	margin-top: 0.25rem;
	justify-content: center;
}

/* Keep quantity input and add-to-basket button on the same line */
.ha-catalog-list .product .addbasket .input-group {
	flex-wrap: nowrap;
}

/* === List view (l_type=list, class list) — horizontal card layout === */

.ha-catalog-list .catalog-list-items.list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.ha-catalog-list .catalog-list-items.list .product {
	display: flex;
	flex-direction: row;
	gap: 1rem;
	padding: 1rem;
	background: #fff;
	border: 1px solid #e9ecef;
	border-radius: 0.75rem;
	text-decoration: none;
	transition: border-color 0.2s, box-shadow 0.2s;
	width: 100%;
	flex-wrap: nowrap;
}

.ha-catalog-list .catalog-list-items .product:hover {
	border-color: #bcd8ff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Image column */
.ha-catalog-list .product .list-column:first-child {
	flex-shrink: 0;
	width: 6rem;
	margin: 0;
}

.ha-catalog-list .product .media-list {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 6rem;
	height: 6rem;
	background: #fff;
	border-radius: 0.5rem;
	overflow: hidden;
}

.ha-catalog-list .product .media-list.multiple { width: 6rem; }

.ha-catalog-list .product .media-item {
	display: flex;
	align-items: center;
	justify-content: center;
}

.ha-catalog-list .product .media-item img {
	width: 100%;
	height: 6rem;
	object-fit: contain;
	padding: 0.25rem;
}

.ha-catalog-list .product .media-item + .media-item { display: none; }

/* Info column */
.ha-catalog-list .product .list-column:last-child {
	flex: 1;
	min-width: 0;
	margin: 0;
	width: auto;
}

/* Product name */
.ha-catalog-list .product .text-list .name,
.ha-catalog-list .product .text-list h2,
.ha-catalog-list .product h2 {
	font-size: 0.875rem;
	font-weight: 600;
	color: #343a40;
	margin: 0;
	line-height: 1.4;
	letter-spacing: 0;
	text-align: center;
	text-transform: none !important;
	padding: 0;
}

.ha-catalog-list .product:hover .name {
	color: var(--ai-secondary);
}

/* Supplier / info line */
.ha-catalog-list .product .product-info {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-bottom: 0.125rem;
}

.ha-catalog-list .product .supplier {
	font-size: 0.6875rem;
	color: #adb5bd;
}

.ha-catalog-list .product .rating { display: none; }

/* Short description */
.ha-catalog-list .product .text-item {
	font-size: 0.75rem;
	color: #6c757d;
	text-align: center;
	margin-top: 0.25rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Price + stock + basket section */
.ha-catalog-list .product .offer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 0.5rem;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.ha-catalog-list .product .offer .section {
	display: flex;
	align-items: center;
	gap: 1rem;
	width: 100%;
	justify-content: space-between;
}

/* Price */
.ha-catalog-list .product .price-list {
	order: 2;
	text-align: right;
}

.ha-catalog-list .product .price-item:first-of-type {
	display: block;
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--ai-secondary-alt);
}

.ha-catalog-list .product .price-item .currency { font-size: 0.875rem; }
.ha-catalog-list .product .price-item .taxrate { font-size: 0.6875rem; color: #adb5bd; }

/* Stock */
.ha-catalog-list .product .stock-list {
	order: 1;
}

.ha-catalog-list .product .stock-list .articleitem {
	font-size: 0.75rem;
	font-weight: 500;
}

.ha-catalog-list .product .stock-actual .stockitem {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
}

.ha-catalog-list .product .stock-actual .stocktext {
	display: inline;
	color: var(--ai-secondary);
}

/* Basket form */
.ha-catalog-list .product .basket {
	width: 100%;
	margin-top: 0.5rem;
}

.ha-catalog-list .product .addbasket {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.ha-catalog-list .product .addbasket input[type="number"] {
	width: 3.5rem;
	height: 2rem;
	text-align: center;
	border: 1px solid #e9ecef;
	border-radius: 0.375rem;
	font-size: 0.8125rem;
}

.ha-catalog-list .product .addbasket .input-group > .btn-primary.btn-action {
	height: 2rem;
	padding: 0 1rem;
	font-size: 0.75rem;
	font-weight: 600;
	background: var(--ai-secondary-alt);
	border: none;
	border-radius: 0 0.375rem 0.375rem 0;
	color: #fff;
	cursor: pointer;
	transition: background 0.15s;
	width: auto;
	max-width: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ha-catalog-list .product .addbasket .input-group > .btn-primary svg {
	width: 1rem;
	height: 1rem;
}

.ha-catalog-list .product .addbasket .input-group > .btn-primary:hover {
	background: var(--ai-warning);
}

.ha-catalog-list .product .addbasket .btn-pin {
	display: none;
}

/* Badges (new, sale, etc.) */
.ha-catalog-list .product .badges { display: none; }

/* === Search result text === */

.ha-search-result {
	font-size: 0.875rem;
	color: #495057;
	margin-bottom: 1rem;
}

.ha-search-result .searchstring {
	font-weight: 700;
	color: var(--ai-secondary);
}

/* === Pagination === */

.ha-catalog-list .pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.25rem;
	margin: 1.5rem 0 0.5rem;
	list-style: none;
	padding: 0;
}

.ha-catalog-list .pagination .page-item .page-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 0.5rem;
	font-size: 0.8125rem;
	color: #495057;
	text-decoration: none;
	transition: background 0.15s;
}

.ha-catalog-list .pagination .page-item .page-link:hover {
	background: #f1f3f5;
}

.ha-catalog-list .pagination .page-item.active .page-link {
	background: var(--ai-secondary);
	color: #fff;
}

.ha-catalog-list .pagination .page-item.disabled .page-link {
	color: #dee2e6;
	pointer-events: none;
}

/* Paginateur bas : boutons numérotés + flèches, en carrés arrondis */
.ha-catalog-list .pagination .browser {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.375rem;
}

.ha-catalog-list .pagination .browser .page,
.ha-catalog-list .pagination .browser .prev,
.ha-catalog-list .pagination .browser .next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.5rem;
	background: #fff;
	border: 1px solid #ced4da;
	border-radius: 0.5rem;
	color: #495057;
	font-size: 0.875rem;
	text-decoration: none;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}

/* page courante surlignée (orange) */
.ha-catalog-list .pagination .browser .page.actual {
	background: #f57c00;
	border-color: #f57c00;
	color: #fff;
	font-weight: 600;
}

.ha-catalog-list .pagination .browser a.page:hover,
.ha-catalog-list .pagination .browser a.prev:hover,
.ha-catalog-list .pagination .browser a.next:hover {
	border-color: #f57c00;
	color: #f57c00;
}

.ha-catalog-list .pagination .browser .gap {
	display: inline-flex;
	align-items: center;
	padding: 0 0.25rem;
	color: #adb5bd;
}

.ha-catalog-list .pagination .browser .prev.disabled,
.ha-catalog-list .pagination .browser .next.disabled {
	opacity: 0.4;
	pointer-events: none;
}

/* chevrons des flèches (SVG centré) */
.ha-catalog-list .pagination .browser .prev {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23495057' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
}

.ha-catalog-list .pagination .browser .next {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23495057' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
}

/* === Footer text === */

.ha-catalog-list .catalog-list-footer {
	margin-top: 2rem;
	padding: 1rem 0;
	border-top: 1px solid #e9ecef;
}

.ha-catalog-list .catalog-list-footer .footer-text {
	font-size: 0.8125rem;
	color: #6c757d;
	line-height: 1.6;
}

/* === Responsive === */

@media (max-width: 639px) {
	.ha-catalog-list .product .list-column:first-child {
		width: 4rem;
	}
	.ha-catalog-list .product .media-list {
		width: 4rem;
		height: 4rem;
	}
	.ha-catalog-list .product .media-item img {
		height: 4rem;
	}
	.ha-list-bar {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}

	/* Mobile-first : grille produits en 2 colonnes, image pleine largeur, cartes plus denses */
	.ha-catalog-list .catalog-list-items.product-list {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.5rem;
	}
	.ha-catalog-list .catalog-list-items.product-list .product {
		padding: 0.5rem;
		border-radius: 0.5rem;
	}
	.ha-catalog-list .catalog-list-items.product-list .product .list-column {
		padding-left: 0;
		padding-right: 0;
	}
	.ha-catalog-list .catalog-list-items.product-list .product .media-list {
		width: 100% !important;
		max-width: none !important;
		max-height: none !important;
	}
}

/* === Filtre repliable mobile/tablette === */
/* Desktop : bouton masqué, colonne filtre visible normalement */
.ha-filter-toggle { display: none; }

@media (max-width: 991.98px) {
	.ha-filter-toggle {
		display: block;
		width: 100%;
		margin: 0 0 1rem;
		padding: 0.65rem 1rem;
		background: var(--ai-secondary, #1a7bb9);
		color: #fff;
		border: none;
		border-radius: 0.5rem;
		font-weight: 600;
		font-size: 0.95rem;
		cursor: pointer;
	}
	.ha-filter-toggle::before {
		content: "\2630"; /* ☰ */
		margin-right: 0.5rem;
	}
	/* Colonne filtre masquée par défaut sur mobile, révélée au clic */
	.ha-filter-aside { display: none; }
	.ha-filter-aside.ha-filter-open { display: block; }
}
