/* ============================================================
   Mindtech V3 — Shop (catalogue + fiche produit)
   ============================================================ */

.mt-container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* ====== HERO ====== */
.mt-shop-hero {
	background: linear-gradient(180deg, var(--mt-surface) 0%, var(--mt-bg) 100%);
	border-bottom: 1px solid var(--mt-border);
	padding: 32px 0 28px;
	margin-bottom: 28px;
}
.mt-shop-title {
	font-family: var(--mt-fd, 'Rubik', sans-serif);
	font-size: 36px;
	font-weight: 800;
	margin: 8px 0 6px;
	color: var(--mt-text);
	letter-spacing: -.02em;
}
.mt-shop-desc {
	max-width: 720px;
	color: var(--mt-text-2);
	font-size: 15px;
	line-height: 1.6;
}
.mt-shop-desc p { margin: 0; }

/* ====== BREADCRUMB ====== */
.mt-breadcrumb {
	font-size: 13px;
	color: var(--mt-text-3);
	margin-bottom: 6px;
	padding: 12px 0 4px;
}
.mt-breadcrumb a {
	color: var(--mt-text-3);
	text-decoration: none;
	transition: color .2s;
}
.mt-breadcrumb a:hover { color: var(--mt-red); }
.mt-bc-sep { color: var(--mt-text-4); margin: 0 4px; }

/* ====== LAYOUT ====== */
.mt-shop-layout {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 32px;
	padding-bottom: 56px;
}

/* ====== SIDEBAR FILTRES ====== */
.mt-shop-sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
	font-size: 13.5px;
}
.mt-filter {
	background: var(--mt-surface);
	border: 1px solid var(--mt-border);
	border-radius: 10px;
	padding: 16px 18px;
}
.mt-filter-title {
	font-family: var(--mt-fd, 'Rubik', sans-serif);
	font-size: 13px;
	font-weight: 700;
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--mt-border);
	color: var(--mt-text);
	text-transform: uppercase;
	letter-spacing: .04em;
}

/* Catégories sidebar */
.mt-cat-list { list-style: none; margin: 0; padding: 0; }
.mt-cat-list > li { margin: 0; }
.mt-cat-list > li > a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 7px 8px;
	border-radius: 6px;
	color: var(--mt-text-2);
	text-decoration: none;
	font-weight: 500;
	transition: background .15s, color .15s;
}
.mt-cat-list > li > a:hover { background: var(--mt-surface-2); color: var(--mt-red); }
.mt-cat-list > li.is-active > a { background: var(--mt-red-soft); color: var(--mt-red); font-weight: 600; }
.mt-cat-count {
	background: var(--mt-surface-2);
	color: var(--mt-text-3);
	font-family: var(--mt-fm, 'JetBrains Mono', monospace);
	font-size: 11px;
	padding: 1px 7px;
	border-radius: 10px;
	font-weight: 500;
}
.mt-cat-list > li.is-active > a .mt-cat-count { background: var(--mt-red); color: #fff; }

/* === ACCORDÉON sous-catégories — grid 3-cols pour alignement parfait
 * Règle Boris : count + chevron toujours sur la même verticale (2026-05-06).
 * === */
.mt-cat-acc-row {
	display: grid;
	grid-template-columns: 1fr 36px 28px;  /* label | count | chevron-or-spacer */
	align-items: center;
	gap: 4px;
	border-radius: 6px;
	transition: background .15s;
	position: relative;
}
.mt-cat-acc-row:hover { background: var(--mt-surface-2); }
.mt-cat-list > li.is-active > .mt-cat-acc-row { background: var(--mt-red-soft); }

.mt-cat-acc-row .mt-cat-link {
	display: flex;
	align-items: center;
	padding: 8px 6px 8px 10px;
	color: var(--mt-text-2);
	text-decoration: none;
	font-weight: 500;
	min-width: 0;
	transition: color .15s;
}
.mt-cat-acc-row .mt-cat-link:hover { color: var(--mt-red); }
.mt-cat-list > li.is-active > .mt-cat-acc-row .mt-cat-link {
	color: var(--mt-red);
	font-weight: 600;
}
.mt-cat-acc-row .mt-cat-label {
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	line-height: 1.3;
	font-size: 13.5px;
}

/* count colonne 2 — toujours à la même position quelle que soit la longueur du label */
.mt-cat-acc-row .mt-cat-count {
	justify-self: end;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 30px;
	height: 22px;
	padding: 0 8px;
	background: var(--mt-surface-2);
	color: var(--mt-text-3);
	font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
	font-variant-numeric: tabular-nums;
	font-size: 11px;
	font-weight: 500;
	border-radius: 100px;
	transition: background .15s, color .15s;
}
.mt-cat-list > li.is-active > .mt-cat-acc-row .mt-cat-count {
	background: var(--mt-red);
	color: #fff;
}

/* chevron OU spacer — toujours 28px de réservé pour alignement parfait */
.mt-cat-toggle,
.mt-cat-toggle-spacer {
	width: 28px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.mt-cat-toggle {
	border: 0;
	background: transparent;
	color: var(--mt-text-3);
	border-radius: 6px;
	cursor: pointer;
	padding: 0;
	transition: transform 200ms cubic-bezier(.16, 1, .3, 1), box-shadow 200ms cubic-bezier(.16, 1, .3, 1), border-color 200ms cubic-bezier(.16, 1, .3, 1), background-color 200ms cubic-bezier(.16, 1, .3, 1), color 200ms cubic-bezier(.16, 1, .3, 1), opacity 200ms cubic-bezier(.16, 1, .3, 1);
}
.mt-cat-toggle:hover { background: rgba(0,0,0,.04); color: var(--mt-red); }
.mt-cat-toggle svg { transition: transform 220ms cubic-bezier(.16, 1, .3, 1); }
.mt-cat-parent.is-open > .mt-cat-acc-row > .mt-cat-toggle svg { transform: rotate(180deg); }
.mt-cat-parent.is-open > .mt-cat-acc-row > .mt-cat-toggle { color: var(--mt-red); }

.mt-cat-sub {
	list-style: none;
	margin: 6px 0 10px 6px;
	padding-left: 14px;
	border-left: 2px solid var(--mt-border);
	overflow: hidden;
}
.mt-cat-sub[hidden] { display: none; }
.mt-cat-sub li > a {
	display: flex;
	justify-content: space-between;
	padding: 5px 8px;
	font-size: 12.5px;
	color: var(--mt-text-3);
	text-decoration: none;
	border-radius: 4px;
}
.mt-cat-sub li > a:hover { color: var(--mt-red); background: var(--mt-surface-2); }
.mt-cat-sub li.is-active > a { color: var(--mt-red); font-weight: 600; }

/* Filtre dispo */
.mt-radio {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
	cursor: pointer;
	font-size: 13.5px;
	color: var(--mt-text-2);
}
.mt-radio input { accent-color: var(--mt-red); }
.mt-radio:hover { color: var(--mt-red); }

/* Help block */
.mt-filter-help { background: linear-gradient(160deg, var(--mt-red-soft) 0%, var(--mt-surface) 100%); border-color: var(--mt-red-border); }
.mt-filter-help p { font-size: 12.5px; color: var(--mt-text-2); margin: 0 0 12px; }
.mt-filter-help .mt-btn { width: 100%; margin-top: 8px; justify-content: center; }

/* ====== TOOLBAR ====== */
.mt-shop-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 0 18px;
	border-bottom: 1px solid var(--mt-border);
	margin-bottom: 22px;
	font-size: 13.5px;
}
.mt-result-count { color: var(--mt-text-3); }
.mt-orderby select {
	border: 1px solid var(--mt-border);
	border-radius: 6px;
	padding: 7px 12px;
	font-size: 13px;
	background: var(--mt-surface);
	cursor: pointer;
}
.mt-orderby select:focus { border-color: var(--mt-red); outline: none; }

/* ====== GRID PRODUITS ====== */
.mt-products-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 22px;
}
.mt-products-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.mt-products-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }

/* ====== PAGINATION ====== */
.mt-pagination { margin-top: 32px; display: flex; justify-content: center; }
.mt-pagination .page-numbers,
.woocommerce-pagination .page-numbers {
	display: inline-flex;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.mt-pagination .page-numbers li { margin: 0; }
.mt-pagination .page-numbers a,
.mt-pagination .page-numbers span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid var(--mt-border);
	border-radius: 6px;
	background: var(--mt-surface);
	color: var(--mt-text-2);
	font-weight: 600;
	font-size: 13px;
	text-decoration: none;
	transition: transform .15s, box-shadow .15s, border-color .15s, background-color .15s, color .15s, opacity .15s;
}
.mt-pagination .page-numbers a:hover { border-color: var(--mt-red); color: var(--mt-red); }
.mt-pagination .page-numbers .current {
	background: var(--mt-red);
	border-color: var(--mt-red);
	color: #fff;
}

/* ====== SHOP EMPTY ====== */
.mt-shop-empty {
	text-align: center;
	padding: 80px 20px;
	color: var(--mt-text-3);
}
.mt-shop-empty svg { color: var(--mt-text-4); margin-bottom: 16px; }
.mt-shop-empty h3 { margin: 0 0 8px; color: var(--mt-text); font-size: 20px; }
.mt-shop-empty p { margin: 0 0 20px; }

/* ====== BOUTONS COMMUNS ====== */
.mt-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 18px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform .18s cubic-bezier(.16,1,.3,1), box-shadow .18s cubic-bezier(.16,1,.3,1), border-color .18s cubic-bezier(.16,1,.3,1), background-color .18s cubic-bezier(.16,1,.3,1), color .18s cubic-bezier(.16,1,.3,1), opacity .18s cubic-bezier(.16,1,.3,1);
	font-family: inherit;
}
.mt-btn-primary { background: var(--mt-red); color: #fff; border-color: var(--mt-red); }
.mt-btn-primary:hover { background: var(--mt-red-dark); border-color: var(--mt-red-dark); color: #fff; }
.mt-btn-wa { background: var(--mt-wa); color: #fff; border-color: var(--mt-wa); }
.mt-btn-wa:hover { background: var(--mt-wa-dark); border-color: var(--mt-wa-dark); color: #fff; }
.mt-btn-tel { background: var(--mt-surface); color: var(--mt-text); border-color: var(--mt-border); }
.mt-btn-tel:hover { border-color: var(--mt-red); color: var(--mt-red); }
.mt-btn-disabled { background: var(--mt-surface-2); color: var(--mt-text-4); cursor: not-allowed; border-color: var(--mt-border); }

/* ====== FICHE PRODUIT ====== */
.mt-product-page { padding-bottom: 56px; }

.mt-product-top {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	padding-top: 12px;
	padding-bottom: 56px;
}

/* GALERIE */
.mt-product-gallery { position: sticky; top: 16px; align-self: start; }
.mt-gallery-main {
	position: relative;
	background: var(--mt-surface);
	border: 1px solid var(--mt-border);
	border-radius: 12px;
	padding: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	overflow: hidden;
}
.mt-gallery-main img {
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}
.mt-gallery-main .mt-pc-badge {
	position: absolute;
	top: 16px;
	left: 16px;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.mt-gallery-empty { color: var(--mt-text-4); flex-direction: column; gap: 8px; font-size: 13px; }
.mt-gallery-empty svg { color: var(--mt-text-4); }

.mt-gallery-thumbs {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 10px;
	margin-top: 14px;
}
.mt-gallery-thumb {
	background: var(--mt-surface);
	border: 2px solid var(--mt-border);
	border-radius: 8px;
	padding: 6px;
	cursor: pointer;
	transition: border-color .15s;
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;             /* bulletproof : aucune image ne dépasse le cadre */
	box-sizing: border-box;
}
.mt-gallery-thumb img {
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;          /* préserve l'aspect ratio, même pour images non-carrées */
	display: block;
}
.mt-gallery-thumb:hover { border-color: var(--mt-red-border); }
.mt-gallery-thumb.is-active { border-color: var(--mt-red); }

/* INFOS */
.mt-product-info { padding-top: 8px; }
.mt-product-cat {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	color: var(--mt-red);
	text-transform: uppercase;
	letter-spacing: .06em;
	text-decoration: none;
	margin-bottom: 10px;
	padding: 4px 10px;
	background: var(--mt-red-soft);
	border-radius: 4px;
}
.mt-product-cat:hover { background: var(--mt-red); color: #fff; }
.mt-product-title {
	font-family: var(--mt-fd, 'Rubik', sans-serif);
	font-size: 32px;
	font-weight: 800;
	letter-spacing: -.02em;
	line-height: 1.2;
	margin: 0 0 14px;
	color: var(--mt-text);
}
.mt-product-meta {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 18px;
	font-size: 13px;
}
.mt-product-stock {
	padding: 4px 10px;
	border-radius: 6px;
	font-weight: 700;
	font-size: 12px;
	letter-spacing: .03em;
	text-transform: uppercase;
}
.mt-product-stock.mt-bs-ok  { background: #dcfce7; color: #166534; }
.mt-product-stock.mt-bs-low { background: #fef3c7; color: #92400e; }
.mt-product-stock.mt-bs-out { background: #fee2e2; color: #991b1b; }
.mt-product-sku { color: var(--mt-text-3); }
.mt-product-sku code {
	background: var(--mt-surface-2);
	padding: 2px 8px;
	border-radius: 4px;
	font-family: var(--mt-fm, 'JetBrains Mono', monospace);
	font-size: 12px;
	color: var(--mt-text);
}

.mt-product-price {
	font-family: var(--mt-fm, 'JetBrains Mono', monospace);
	font-size: 32px;
	font-weight: 600;
	color: var(--mt-red);
	margin: 18px 0 22px;
	letter-spacing: -.01em;
}
.mt-product-price .woocommerce-Price-amount,
.mt-product-price .price { font-family: inherit; }
.mt-product-price ins { background: transparent; text-decoration: none; }
.mt-product-price del { color: var(--mt-text-4); font-size: 18px; margin-right: 10px; }

.mt-product-short {
	background: var(--mt-surface-2);
	border-left: 3px solid var(--mt-red);
	padding: 14px 18px;
	border-radius: 0 6px 6px 0;
	margin-bottom: 22px;
	font-size: 14px;
	color: var(--mt-text-2);
}
.mt-product-short p { margin: 0; }

/* ACTIONS produit */
.mt-product-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 24px;
}
.mt-cart-form {
	display: flex;
	gap: 8px;
	align-items: stretch;
	flex-grow: 1;
	min-width: 280px;
}
.mt-qty-wrap {
	display: flex;
	align-items: center;
	background: var(--mt-surface);
	border: 1px solid var(--mt-border);
	border-radius: 8px;
	padding: 0 6px 0 14px;
	gap: 8px;
}
.mt-qty-wrap label { font-size: 12px; font-weight: 600; color: var(--mt-text-3); text-transform: uppercase; letter-spacing: .06em; }
.mt-qty-wrap input {
	width: 50px;
	border: 0;
	font-size: 15px;
	font-family: var(--mt-fm, 'JetBrains Mono', monospace);
	font-weight: 600;
	background: transparent;
	padding: 11px 4px;
	text-align: center;
}
.mt-qty-wrap input:focus { outline: none; }
.mt-btn-add { flex-grow: 1; justify-content: center; }
.mt-btn-add svg { flex-shrink: 0; }
.mt-product-actions .mt-btn-wa { flex-grow: 1; justify-content: center; min-width: 240px; }

/* TRUST BADGES */
.mt-product-trust {
	list-style: none;
	margin: 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--mt-border);
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.mt-product-trust li {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13.5px;
	color: var(--mt-text-2);
}
.mt-product-trust li svg { color: var(--mt-red); flex-shrink: 0; }
.mt-product-trust strong { color: var(--mt-text); }

/* ====== TABS ====== */
.mt-product-tabs { padding: 16px 0; }
.mt-tabs-nav {
	list-style: none;
	margin: 0 0 28px;
	padding: 0 0 1px;
	display: flex;
	gap: 4px;
	border-bottom: 1px solid var(--mt-border);
	overflow-x: auto;
}
.mt-tabs-nav li { margin: 0; }
.mt-tab-btn {
	background: transparent;
	border: 0;
	padding: 14px 22px;
	cursor: pointer;
	font-family: var(--mt-fd, 'Rubik', sans-serif);
	font-weight: 600;
	font-size: 14.5px;
	color: var(--mt-text-3);
	border-bottom: 3px solid transparent;
	transition: transform .15s, box-shadow .15s, border-color .15s, background-color .15s, color .15s, opacity .15s;
	margin-bottom: -1px;
	white-space: nowrap;
}
.mt-tab-btn:hover { color: var(--mt-text); }
.mt-tab-btn.is-active {
	color: var(--mt-red);
	border-bottom-color: var(--mt-red);
}

.mt-tab-pane { display: none; line-height: 1.7; color: var(--mt-text-2); }
.mt-tab-pane.is-active { display: block; }
.mt-tab-pane h3 {
	font-family: var(--mt-fd, 'Rubik', sans-serif);
	font-size: 18px;
	margin: 24px 0 12px;
	color: var(--mt-text);
}
.mt-tab-pane h3:first-child { margin-top: 0; }
.mt-tab-pane p { margin: 0 0 14px; }
.mt-tab-pane ul { padding-left: 22px; margin: 0 0 14px; }
.mt-tab-pane ul li { margin-bottom: 6px; }
.mt-tab-pane strong { color: var(--mt-text); }
.mt-tab-pane code {
	background: var(--mt-surface-2);
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 13px;
}
.mt-tab-empty { color: var(--mt-text-3); font-style: italic; padding: 24px 0; text-align: center; }
.mt-distributor-note { background: var(--mt-red-soft); padding: 14px 18px; border-radius: 6px; border-left: 3px solid var(--mt-red); font-size: 13.5px; }

/* SPECS TABLE */
.mt-specs-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
.mt-specs-table tr { border-bottom: 1px solid var(--mt-border); }
.mt-specs-table tr:hover { background: var(--mt-surface-2); }
.mt-specs-table th {
	text-align: left;
	padding: 12px 16px;
	width: 35%;
	font-weight: 600;
	color: var(--mt-text-2);
	background: var(--mt-surface-2);
}
.mt-specs-table td {
	padding: 12px 16px;
	color: var(--mt-text);
	font-family: var(--mt-fm, 'JetBrains Mono', monospace);
	font-size: 13.5px;
}

/* ====== PRODUITS SIMILAIRES ====== */
.mt-related-products { padding: 40px 0; border-top: 1px solid var(--mt-border); }
.mt-related-products h2 {
	font-family: var(--mt-fd, 'Rubik', sans-serif);
	font-size: 24px;
	font-weight: 700;
	margin: 0 0 24px;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1100px) {
	.mt-products-grid.columns-4 { grid-template-columns: repeat(3, 1fr); }
	.mt-shop-layout { grid-template-columns: 220px 1fr; gap: 24px; }
}
@media (max-width: 900px) {
	.mt-shop-layout { grid-template-columns: 1fr; }
	.mt-shop-sidebar { order: 2; }
	.mt-shop-main { order: 1; }
	.mt-product-top { grid-template-columns: 1fr; gap: 32px; }
	.mt-product-gallery { position: static; }
	.mt-products-grid.columns-3,
	.mt-products-grid.columns-4 { grid-template-columns: repeat(2, 1fr); }
	.mt-product-title { font-size: 26px; }
	.mt-shop-title { font-size: 28px; }
	.mt-product-price { font-size: 26px; }
}
@media (max-width: 540px) {
	.mt-container { padding: 0 16px; }
	.mt-products-grid.columns-3,
	.mt-products-grid.columns-4 { grid-template-columns: 1fr; }
	.mt-product-actions { flex-direction: column; }
	.mt-cart-form { flex-direction: column; }
	.mt-cart-form .mt-qty-wrap { width: 100%; }
	.mt-cart-form .mt-btn-add { width: 100%; }
	.mt-product-actions .mt-btn-wa { width: 100%; }
	.mt-shop-toolbar { flex-direction: column; gap: 12px; align-items: flex-start; }
	.mt-tabs-nav { gap: 0; }
	.mt-tab-btn { padding: 12px 16px; font-size: 13px; }
	.mt-specs-table th { width: 45%; font-size: 12.5px; }
	.mt-specs-table td { font-size: 12px; }
}
