/* ==========================================================
   EF Category Boost — Desktop Layout
   Active when mode = desktop or both
   ========================================================== */

@media (min-width: 768px) {

	/* ── Hide EFCB mobile elements on desktop ── */

	.efcb-mode-desktop .efcb-desktop-product,
	.efcb-mode-both .efcb-desktop-product {
		display: none !important;
	}

	.efcb-mode-desktop .efcb-mobile-product,
	.efcb-mode-both .efcb-mobile-product {
		display: block !important;
	}

	/* ALWAYS hide mobile-only elements on desktop */
	.efcb-toolbar--mobile,
	.efcb-sort-overlay,
	.efcb-sort-sheet {
		display: none !important;
	}

	/* Hide Flatsome native toolbar (result count + ordering) — replaced by EFCB */
	.efcb-mode-desktop .category-page-title .flex-col.medium-text-center,
	.efcb-mode-both .category-page-title .flex-col.medium-text-center {
		display: none !important;
	}

	/* Keep Flatsome breadcrumb visible — only hide the ordering/result part */
	.efcb-mode-desktop .category-page-title .flex-col.flex-grow,
	.efcb-mode-both .category-page-title .flex-col.flex-grow {
		display: block !important;
	}

	/* On desktop: hide EFCB title + count (Flatsome shows them already) */
	.efcb-mode-desktop .efcb-cat-header__title,
	.efcb-mode-both .efcb-cat-header__title {
		display: block !important;
	}

	.efcb-mode-desktop .efcb-cat-header__count,
	.efcb-mode-both .efcb-cat-header__count {
		display: none !important;
	}

	/* Match Flatsome title style */
	.efcb-mode-desktop .efcb-cat-header__title,
	.efcb-mode-both .efcb-cat-header__title {
		font-size: 28px;
		font-weight: 700;
		text-transform: uppercase;
		color: #111;
		margin: 0 0 5px;
		line-height: 1.2;
	}

	/* Always show EFCB header body on desktop */

	/* Show EFCB desktop toolbar */
	.efcb-mode-desktop .efcb-toolbar--desktop,
	.efcb-mode-both .efcb-toolbar--desktop {
		display: flex !important;
		align-items: center;
		justify-content: space-between;
		padding: 12px 0;
		margin-bottom: 0;
	}

	.efcb-toolbar--desktop .efcb-toolbar__results {
		font-size: 13px;
		color: #666;
	}

	.efcb-toolbar--desktop .efcb-toolbar__results .woocommerce-result-count {
		margin: 0;
		padding: 0;
	}

	.efcb-toolbar__right-desktop {
		display: flex;
		align-items: center;
		gap: 12px;
	}

	.efcb-toolbar__right-desktop .woocommerce-ordering {
		margin: 0;
	}

	.efcb-toolbar__right-desktop .woocommerce-ordering select {
		border: 1px solid #ddd;
		border-radius: 4px;
		padding: 6px 10px;
		font-size: 13px;
		background: #fff;
		cursor: pointer;
	}

	.efcb-toolbar--desktop .efcb-toolbar__view-btn {
		background: none; border: none; padding: 4px; margin: 0;
		cursor: pointer; opacity: 0.3; transition: opacity 0.15s; line-height: 0; flex-shrink: 0;
	}

	.efcb-toolbar--desktop .efcb-toolbar__view-btn + .efcb-toolbar__view-btn { margin-left: 2px; }
	.efcb-toolbar--desktop .efcb-toolbar__view-btn.active { opacity: 1; }
	.efcb-toolbar--desktop .efcb-toolbar__view-btn svg { width: 22px; height: 22px; fill: #333; }

	/* Desktop sort popup — not needed, using native select */
	.efcb-mode-desktop .efcb-sort-overlay,
	.efcb-mode-both .efcb-sort-overlay,
	.efcb-mode-desktop .efcb-sort-sheet,
	.efcb-mode-both .efcb-sort-sheet {
		display: none !important;
	}

	/* Hide EFCB breadcrumb on desktop (Flatsome has its own) */
	.efcb-mode-desktop .efcb-cat-header__breadcrumb,
	.efcb-mode-both .efcb-cat-header__breadcrumb {
		display: none !important;
	}

	/* Show EFCB header on desktop (for description with "Voir plus") */
	.efcb-mode-desktop .efcb-cat-header,
	.efcb-mode-both .efcb-cat-header {
		display: block !important;
		padding: 0;
		margin: 0 0 15px;
	}

	/* Hide native WooCommerce term-description on desktop (replaced by EFCB) */
	.efcb-mode-desktop .term-description,
	.efcb-mode-both .term-description {
		display: none !important;
	}

	/* Desktop header styles */
	.efcb-mode-desktop .efcb-cat-header__body,
	.efcb-mode-both .efcb-cat-header__body {
		display: flex;
		flex-direction: row;
		gap: 20px;
		align-items: flex-start;
		width: 100%;
		max-width: 100%;
	}

	.efcb-mode-desktop .efcb-cat-header__body .efcb-cat-header__image,
	.efcb-mode-both .efcb-cat-header__body .efcb-cat-header__image {
		flex-shrink: 0;
		width: 120px;
		border-radius: 6px;
		overflow: hidden;
	}

	.efcb-mode-desktop .efcb-cat-header__body .efcb-cat-header__text,
	.efcb-mode-both .efcb-cat-header__body .efcb-cat-header__text {
		flex: 1;
		min-width: 0;
	}

	.efcb-mode-desktop .efcb-cat-header__desc,
	.efcb-mode-both .efcb-cat-header__desc {
		font-size: 14px;
		line-height: 1.5;
		color: #555;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.efcb-mode-desktop .efcb-cat-header__desc-wrap.expanded .efcb-cat-header__desc,
	.efcb-mode-both .efcb-cat-header__desc-wrap.expanded .efcb-cat-header__desc {
		-webkit-line-clamp: unset;
		display: block;
	}

	.efcb-mode-desktop .efcb-cat-header__more,
	.efcb-mode-both .efcb-cat-header__more {
		background: none;
		border: none;
		padding: 6px 0;
		font-size: 13px;
		font-weight: 600;
		color: var(--efcb-primary);
		cursor: pointer;
	}

	/* ── VIEW TOGGLE — injected into Flatsome native toolbar via JS ── */

	.efcb-view-toggle {
		display: inline-flex;
		align-items: center;
		gap: 4px;
		margin-left: 16px;
		vertical-align: middle;
	}

	.efcb-view-toggle__label {
		font-size: 13px;
		color: #666;
		margin-right: 2px;
	}

	.efcb-view-toggle__btn {
		background: none;
		border: none;
		padding: 4px;
		cursor: pointer;
		opacity: 0.3;
		transition: opacity 0.15s;
		line-height: 0;
	}

	.efcb-view-toggle__btn.active { opacity: 1; }
	.efcb-view-toggle__btn svg { width: 22px; height: 22px; fill: #333; }

	/* ── DESKTOP GRID VIEW ── */

	.efcb-mode-desktop .products.efcb-view-grid,
	.efcb-mode-both .products.efcb-view-grid {
		display: grid !important;
		gap: 0;
		margin: 0 !important;
		padding: 0 !important;
		border: 1px solid #e0e0e0;
	}

	.products.efcb-view-grid.efcb-cols-2 { grid-template-columns: 1fr 1fr; }
	.products.efcb-view-grid.efcb-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
	.products.efcb-view-grid.efcb-cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
	.products.efcb-view-grid.efcb-cols-5 { grid-template-columns: repeat(5, 1fr); }

	.efcb-view-grid .efcb-mobile-product {
		padding: 16px !important;
		margin: 0 !important;
		border-bottom: 1px solid #e0e0e0;
		border-right: 1px solid #e0e0e0;
		box-sizing: border-box;
		background: #fff;
	}

	.products.efcb-view-grid.efcb-cols-2 .efcb-mobile-product:nth-of-type(2n) { border-right: none; }
	.products.efcb-view-grid.efcb-cols-3 .efcb-mobile-product:nth-of-type(3n) { border-right: none; }
	.products.efcb-view-grid.efcb-cols-4 .efcb-mobile-product:nth-of-type(4n) { border-right: none; }
	.products.efcb-view-grid.efcb-cols-5 .efcb-mobile-product:nth-of-type(5n) { border-right: none; }

	.efcb-view-grid .efcb-card {
		display: flex; flex-direction: column; height: 100%;
		border: none; border-radius: 0; padding: 0; gap: 0;
	}

	.efcb-view-grid .efcb-card__image-link {
		width: 100%; height: 220px;
		display: flex; align-items: center; justify-content: center;
		overflow: hidden; position: relative; background: #fafafa;
		border-radius: 4px; margin-bottom: 10px;
	}

	.efcb-view-grid .efcb-card__info { display: flex; flex-direction: column; gap: 4px; flex: 1; }
	.efcb-view-grid .efcb-card__category { font-size: 11px; text-transform: uppercase; color: #888; font-weight: 600; }
	.efcb-view-grid .efcb-card__title { font-size: 14px !important; -webkit-line-clamp: 2; }
	.efcb-view-grid .efcb-card__price { font-size: 16px; font-weight: 700; color: var(--efcb-primary); }
	.efcb-view-grid .efcb-card__rating .star-rating { font-size: 12px; }
	.efcb-view-grid .efcb-card__rating-count { font-size: 12px; }
	.efcb-view-grid .efcb-card__actions { display: none; }

	/* Hide inline ATC on desktop — use .efcb-card__actions instead */
	.efcb-card__atc-inline { display: none !important; }

	/* Stock row on desktop */
	.efcb-card__stock-row {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
	}

	/* Show ATC inline in grid if option enabled */
	.efcb-show-atc-grid .efcb-view-grid .efcb-card__atc-inline:not(.added) {
		display: inline-flex !important;
		align-items: center;
		gap: 4px;
		background: var(--efcb-primary);
		color: #fff;
		border: 2px solid var(--efcb-primary);
		border-radius: 99px;
		padding: 6px 12px;
		font-size: 11px;
		font-weight: 600;
		cursor: pointer;
		text-decoration: none;
		white-space: nowrap;
		line-height: 1.4;
	}

	.efcb-show-atc-grid .efcb-view-grid .efcb-card__atc-inline.added { display: none !important; }

	.efcb-show-atc-grid .efcb-view-grid .efcb-card__atc-inline:hover { opacity: 0.9; }
	.efcb-show-atc-grid .efcb-view-grid .efcb-card__atc-inline.efcb-atc--outofstock { background: #bbb; border-color: #bbb; cursor: not-allowed; }

	/* ── DESKTOP LIST VIEW ── */

	.efcb-mode-desktop .products.efcb-view-list,
	.efcb-mode-both .products.efcb-view-list {
		display: grid !important;
		grid-template-columns: 1fr;
		gap: 0;
		margin: 0 !important;
		padding: 0 !important;
		border: 1px solid #e0e0e0;
	}

	.efcb-view-list .efcb-mobile-product {
		border-bottom: 1px solid #e0e0e0;
		background: #fff;
	}

	.efcb-view-list .efcb-mobile-product:last-child { border-bottom: none; }

	.efcb-view-list .efcb-card {
		display: flex; flex-direction: row; align-items: center;
		padding: 20px 16px; gap: 24px; border: none; border-radius: 0;
	}

	.efcb-view-list .efcb-card__image-link {
		flex-shrink: 0; width: 120px; height: 120px;
		display: flex; align-items: center; justify-content: center;
		overflow: hidden; position: relative; background: #fafafa; border-radius: 4px;
	}

	.efcb-view-list .efcb-card__info {
		flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0;
	}

	.efcb-view-list .efcb-card__category { font-size: 11px; text-transform: uppercase; color: #888; font-weight: 600; }
	.efcb-view-list .efcb-card__title { font-size: 15px !important; -webkit-line-clamp: 2; }
	.efcb-view-list .efcb-card__price { font-size: 18px; font-weight: 700; color: var(--efcb-primary); }

	.efcb-view-list .efcb-card__actions {
		display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; width: 180px;
	}

	.efcb-view-list .efcb-card__atc {
		display: flex; align-items: center; justify-content: center; gap: 6px;
		width: 100%; text-align: center;
		background: var(--efcb-primary); color: #fff; border: none; border-radius: 4px;
		padding: 12px 20px; font-size: 14px; font-weight: 600; cursor: pointer;
		text-decoration: none; line-height: 1.3; text-transform: none;
	}

	.efcb-view-list .efcb-card__atc:hover { opacity: 0.9; color: #fff; }
	.efcb-view-list .efcb-card__atc.efcb-atc--outofstock { background: #bbb; cursor: not-allowed; }

	/* After add to cart: hide ATC, show "Voir le panier" */
	.efcb-card__atc.added,
	.efcb-card__atc-inline.added,
	a.efcb-card__atc.added,
	a.efcb-card__atc-inline.added { display: none !important; }

	/* "Voir le panier" link */
	.efcb-card__actions .added_to_cart,
	.efcb-card__stock-row .added_to_cart,
	.efcb-card__info .added_to_cart,
	.efcb-card .added_to_cart {
		display: inline-flex !important;
		align-items: center;
		gap: 4px;
		background: transparent !important;
		color: var(--efcb-primary) !important;
		border: 2px solid var(--efcb-primary) !important;
		border-radius: 99px !important;
		padding: 0 12px !important;
		font-size: 13px !important;
		font-weight: 600 !important;
		text-decoration: none !important;
		white-space: nowrap;
		text-align: center;
		line-height: 2.19em !important;
	}

	.efcb-card__actions .added_to_cart {
		display: inline-flex !important;
		width: auto;
		padding: 0 20px !important;
		font-size: 13px !important;
	}

	.efcb-card .added_to_cart:hover {
		background: var(--efcb-primary) !important;
		color: #fff !important;
	}

	.efcb-view-list .efcb-card__quickview { display: none; }

	/* ── COMMON ── */

	.efcb-card__img { width: 100% !important; height: 100% !important; object-fit: contain; }

	.efcb-card__sale-badge {
		position: absolute; top: 8px; left: 8px;
		background: #e74c3c; color: #fff; font-size: 11px; font-weight: 700;
		padding: 3px 8px; border-radius: 3px; text-transform: uppercase;
	}

	.efcb-card__title-link { text-decoration: none; color: inherit; }

	.efcb-card__title {
		font-size: 14px !important; font-weight: 600 !important; line-height: 1.35 !important;
		color: #111 !important; margin: 0 !important; padding: 0 !important;
		display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
		overflow: hidden; text-overflow: ellipsis; height: auto !important; text-transform: none !important;
	}

	.efcb-card__rating { display: flex; align-items: center; gap: 4px; }
	.efcb-card__rating .star-rating { font-size: 12px; margin: 0; }
	.efcb-card__rating-count { font-size: 12px; color: #666; }

	.efcb-card__price del { font-size: 13px; font-weight: 400; color: #999; }
	.efcb-card__price ins { text-decoration: none; font-weight: 700; }

	.efcb-badge { font-size: 12px; font-weight: 600; line-height: 1; display: flex; align-items: center; gap: 4px; }
	.efcb-badge::before { content: '●'; font-size: 8px; }
	.efcb-badge--instock { color: #067d06; }
	.efcb-badge--onorder { color: #d68000; }
	.efcb-badge--outofstock { color: #333; }

} /* fin @media */
