/* ====
   WOO SHOP — Page archive produits
   Emplacement : votre-child-theme/assets/css/woo-shop.css
   ==== */

:root {
	--ades-teal-900: #073640; /* le plus foncé de la charte — hover, éléments de texte forts */
	--ades-teal-700: #173434; /* foncé secondaire — texte/bordures */
	--ades-teal-500: #1A8592; /* teal principal de marque — boutons, éléments actifs/sélectionnés */
	--ades-text: #1d1d1d;
	--ades-text-light: #6b7280;
	--ades-border: #e5e7eb;
	--ades-bg-light: #f8f9fa;
}

/* --- Conteneur général --- */
.ades-shop-wrapper { max-width: 1280px; margin: 0 auto; padding: 30px 20px 60px; }
.ades-shop-title { font-size: 22px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; margin: 0 0 24px; color: var(--ades-text); }
.ades-shop-layout { display: flex; gap: 32px; align-items: flex-start; }
.ades-shop-sidebar { flex: 0 0 240px; }
.ades-shop-main { flex: 1; min-width: 0; }
.ades-filters-toggle { display: none; }

/* --- Blocs de filtres --- */
.ades-filter-block { border-bottom: 1px solid var(--ades-border); padding-bottom: 20px; margin-bottom: 20px; }
.ades-filter-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 14px; color: var(--ades-text); }
.ades-filter-categories, .ades-filter-checkboxes { list-style: none; margin: 0; padding: 0; }
.ades-filter-categories li { margin-bottom: 10px; }
.ades-filter-categories a { color: var(--ades-text-light); text-decoration: none; font-size: 14px; transition: color .15s ease; }
.ades-filter-categories a:hover { color: var(--ades-teal-500); }
.ades-filter-categories li.is-active a { color: var(--ades-teal-900); font-weight: 600; }

/* --- Cases à cocher --- */
.ades-checkbox-option { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ades-text); font-size: 14px; margin-bottom: 10px; }
.ades-checkbox-box { width: 16px; height: 16px; border: 1px solid #ccc; border-radius: 3px; display: inline-block; position: relative; flex-shrink: 0; transition: background .15s ease, border-color .15s ease; }
.ades-checkbox-option.is-checked .ades-checkbox-box { background: var(--ades-teal-500); border-color: var(--ades-teal-500); }
.ades-checkbox-option.is-checked .ades-checkbox-box::after { content: ''; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ades-checkbox-count { color: var(--ades-text-light); font-size: 13px; }

/* --- Pastilles de couleur --- */
.ades-filter-colors { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; }
.ades-color-swatch { width: 22px; height: 22px; border-radius: 50%; display: block; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--ades-border); transition: box-shadow .15s ease; }
.ades-color-swatch.is-checked { border-color: #fff; box-shadow: 0 0 0 2px var(--ades-teal-500); }

/* --- Slider de prix --- */
.ades-price-slider { margin: 10px 2px 16px; }
.ades-price-values { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ades-text-light); margin-bottom: 14px; }
.ades-price-dash { color: var(--ades-border); }
.ades-btn-filter { width: 100%; background: var(--ades-teal-500); color: #fff; border: none; padding: 10px 0; font-size: 13px; font-weight: 600; letter-spacing: .5px; border-radius: 4px; cursor: pointer; transition: background .2s ease; }
.ades-btn-filter:hover { background: var(--ades-teal-900); }
.ades-btn-reset { display: block; text-align: center; padding: 10px 0; border: 1px solid var(--ades-border); border-radius: 4px; color: var(--ades-text); text-decoration: none; font-size: 13px; font-weight: 600; letter-spacing: .5px; transition: border-color .15s ease, color .15s ease; }
.ades-btn-reset:hover { border-color: var(--ades-teal-900); color: var(--ades-teal-900); }

/* --- jQuery UI Slider --- */
.ui-slider { position: relative; height: 4px; background: var(--ades-border); border-radius: 2px; }
.ui-slider .ui-slider-range { position: absolute; height: 100%; background: var(--ades-teal-500); border-radius: 2px; }
.ui-slider .ui-slider-handle { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--ades-teal-500); border-radius: 50%; top: -5px; margin-left: -7px; cursor: pointer; outline: none; }

/* --- Toolbar tri + résultats --- */
.ades-shop-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.ades-shop-toolbar .woocommerce-result-count { order: 1; margin: 0; color: var(--ades-text-light); font-size: 14px; }
.ades-shop-toolbar .woocommerce-ordering { order: 2; margin: 0; }
.ades-shop-toolbar .woocommerce-ordering select { border: 1px solid var(--ades-border); border-radius: 4px; padding: 8px 12px; font-size: 13px; background: #fff; }

/* --- Grille produits --- */
ul.products { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 28px; list-style: none; padding: 0; margin: 0 0 40px; }

.ades-product-card { position: relative; background: #fff; border: 1px solid var(--ades-border); border-radius: 8px; overflow: hidden; text-align: center; transition: box-shadow .25s ease, border-color .25s ease, transform .25s ease; }
.ades-product-card:hover { border-color: var(--ades-teal-900); box-shadow: 0 10px 28px rgba(0,0,0,.08); transform: translateY(-3px); }

.ades-product-card__image { position: relative; background: var(--ades-bg-light); aspect-ratio: 1 / 1; overflow: hidden; }
.ades-product-card__imglink { display: block; width: 100%; height: 100%; }
.ades-product-card__image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 18px; box-sizing: border-box; transition: transform .35s ease; }
.ades-product-card:hover .ades-product-card__image img { transform: scale(1.05); }

.ades-badge-sale { position: absolute; top: 12px; left: 12px; z-index: 2; background: var(--ades-teal-500); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 3px; }

/* --- Bouton favoris (wishlist) --- */
.ades-card-wishlist {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	width: 32px;
	height: 32px;
	min-width: 32px;
	max-width: 32px;
	padding: 0;
	margin: 0;
	line-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: var(--ades-text-light);
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0,0,0,.1);
	transition: color .2s ease, transform .2s ease;
}
.ades-card-wishlist svg {
	width: 16px;
	height: 16px;
	display: block;
	flex-shrink: 0;
	pointer-events: none;
}
.ades-card-wishlist:hover { color: var(--ades-teal-500); transform: scale(1.08); }
.ades-card-wishlist.is-active { color: #e0245e; }
.ades-card-wishlist.is-active svg { fill: currentColor; }

/* --- Bouton panier flottant --- */
.ades-btn-cart { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--ades-teal-500); color: #fff; text-decoration: none; opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease, background .2s ease; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.ades-product-card:hover .ades-btn-cart { opacity: 1; transform: translateY(0); }
.ades-btn-cart:hover { background: var(--ades-teal-900); color: #fff; }
.ades-btn-cart--variable { background: #9ca3af; }
.ades-btn-cart--variable:hover { background: var(--ades-teal-900); }
.ades-btn-cart.added { background: #16a34a; opacity: 1; transform: translateY(0); }
.ades-btn-cart.loading { opacity: .6; pointer-events: none; }

/* --- Infos carte --- */
.ades-product-card__info { padding: 16px 14px 20px; }
.ades-product-card__title { font-size: 14px; font-weight: 600; margin: 0 0 8px; line-height: 1.4; }
.ades-product-card__title a { color: var(--ades-text); text-decoration: none; }
.ades-product-card__title a:hover { color: var(--ades-teal-900); }
.ades-product-card__price { font-size: 15px; font-weight: 700; color: var(--ades-teal-900); }
.ades-product-card__price del { color: var(--ades-text-light); font-weight: 400; margin-right: 6px; font-size: 13px; }
.ades-product-card__price ins { text-decoration: none; }

/* --- Bouton CTA bas de carte --- */
.ades-product-card__cta { display: block; margin-top: 14px; width: 100%; padding: 10px 0; background: var(--ades-teal-500); color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; border-radius: 4px; box-sizing: border-box; transition: background .2s ease; }
.ades-product-card__cta:hover { background: var(--ades-teal-900); color: #fff; }

/* --- Pagination --- */
.woocommerce-pagination ul.page-numbers { display: flex; gap: 8px; list-style: none; padding: 0; justify-content: center; }
.woocommerce-pagination .page-numbers li a, .woocommerce-pagination .page-numbers li span { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--ades-border); color: var(--ades-text); text-decoration: none; font-size: 13px; transition: border-color .15s ease, color .15s ease; }
.woocommerce-pagination .page-numbers li span.current { background: var(--ades-teal-900); color: #fff; border-color: var(--ades-teal-900); }
.woocommerce-pagination .page-numbers li a:hover { border-color: var(--ades-teal-900); color: var(--ades-teal-900); }

/* --- États focus clavier (accessibilité) --- */
.ades-checkbox-option:focus-visible,
.ades-color-swatch:focus-visible,
.ades-btn-filter:focus-visible,
.ades-btn-reset:focus-visible,
.ades-btn-cart:focus-visible,
.ades-card-wishlist:focus-visible,
.ades-product-card__cta:focus-visible,
.ades-filters-toggle:focus-visible {
	outline: 2px solid var(--ades-teal-500);
	outline-offset: 2px;
}

/* --- Responsive --- */

/* Le vrai hover n'existe pas au doigt : le bouton panier flottant (opacity:0
   tant qu'on ne survole pas la carte) ne s'affiche jamais sur tactile, et
   resterait "coincé" en hover après un tap. On le remet dans le flux normal,
   à côté du prix, avec un retour ":active" au tap pour le feedback. */
@media (hover: none), (pointer: coarse) {
	.ades-product-card__meta {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
	}
	.ades-product-card__price { flex: 1; min-width: 0; overflow-wrap: anywhere; }
	.ades-btn-cart {
		position: static;
		opacity: 1;
		transform: none;
		flex-shrink: 0;
	}
	.ades-btn-cart:active,
	.ades-card-wishlist:active,
	.ades-color-swatch:active { transform: scale(.92); }
}

@media (max-width: 900px) {

	.ades-shop-wrapper { padding: 20px 16px 48px; }
	.ades-shop-title { font-size: 19px; margin-bottom: 16px; }

	/* Bug corrigé : en colonne, "align-items: flex-start" (hérité de la
	   version desktop) empêchait la sidebar et le contenu principal de
	   prendre toute la largeur — on force l'étirement. Et "flex: 0 0 240px"
	   sur la sidebar, une fois l'axe principal devenu vertical, réservait
	   240px de HAUTEUR sous le bouton "Filtres" même fermé : on repasse en
	   hauteur automatique. */
	.ades-shop-layout { flex-direction: column; align-items: stretch; gap: 0; }
	.ades-shop-sidebar { flex: 0 0 auto; }

	/* --- Bouton "Filtres" --- */
	.ades-filters-toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
		width: 100%;
		background: var(--ades-teal-500);
		color: #fff;
		border: none;
		padding: 13px 16px;
		font-size: 13px;
		font-weight: 600;
		letter-spacing: .5px;
		text-transform: uppercase;
		border-radius: 6px;
		margin-bottom: 16px;
		cursor: pointer;
		transition: background .2s ease;
		-webkit-tap-highlight-color: transparent;
	}
	.ades-filters-toggle:active { background: var(--ades-teal-900); }
	.ades-filters-toggle__label { display: flex; align-items: center; gap: 8px; }
	.ades-filters-toggle__icon { flex-shrink: 0; }
	.ades-filters-count {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 18px;
		height: 18px;
		padding: 0 5px;
		background: #fff;
		color: var(--ades-teal-900);
		font-size: 11px;
		font-weight: 700;
		border-radius: 9px;
	}
	.ades-filters-chevron { flex-shrink: 0; transition: transform .25s ease; }
	.ades-filters-toggle[aria-expanded="true"] .ades-filters-chevron { transform: rotate(180deg); }

	/* On masque via max-height/overflow plutôt que display:none : la largeur
	   du panneau reste réelle, donc le slider jQuery UI calcule correctement
	   sa position dès l'initialisation, même si le panneau est replié. */
	.ades-shop-sidebar-inner {
		max-height: 0;
		overflow: hidden;
		opacity: 0;
		transition: max-height .3s ease, opacity .25s ease;
	}
	.ades-shop-sidebar.is-open .ades-shop-sidebar-inner {
		max-height: 2000px;
		opacity: 1;
		padding-top: 4px;
		margin-bottom: 10px;
		border-bottom: 1px solid var(--ades-border);
	}

	/* --- Cibles tactiles agrandies dans les filtres (44px conseillés) --- */
	.ades-checkbox-option { min-height: 40px; margin-bottom: 2px; }
	.ades-filter-colors { gap: 14px; }
	.ades-color-swatch { width: 28px; height: 28px; }
	.ades-btn-filter,
	.ades-btn-reset { min-height: 44px; }

	/* --- Curseur du slider de prix : plus grand pour le doigt --- */
	.ui-slider { height: 5px; }
	.ui-slider .ui-slider-handle { width: 22px; height: 22px; top: -9px; margin-left: -11px; }

	/* --- Barre tri / compteur : le select passe en pleine largeur en dessous --- */
	.ades-shop-toolbar { margin-bottom: 16px; }
	.ades-shop-toolbar .woocommerce-result-count { font-size: 13px; }
	.ades-shop-toolbar .woocommerce-ordering { width: 100%; }
	.ades-shop-toolbar .woocommerce-ordering select {
		width: 100%;
		min-height: 44px;
		font-size: 14px;
	}

	/* --- Grille produits : on garde 2 colonnes sur mobile (plus dense,
	   plus proche des habitudes d'achat sur téléphone qu'une colonne unique) --- */
	ul.products { grid-template-columns: repeat(2, 1fr); gap: 14px; }
	.ades-product-card__info { padding: 12px 10px 14px; }
	.ades-product-card__title { font-size: 13px; margin-bottom: 6px; }
	.ades-product-card__price { font-size: 13.5px; }

	/* --- Pagination : cibles tactiles agrandies --- */
	.woocommerce-pagination .page-numbers li a,
	.woocommerce-pagination .page-numbers li span { width: 40px; height: 40px; }
}

@media (max-width: 380px) {
	ul.products { gap: 10px; }
	.ades-product-card__info { padding: 10px 8px 12px; }
	.ades-product-card__price { font-size: 13px; }
}