/**
 * UpNovo Tech - couche mobile.
 *
 * Le telephone n'est pas un bureau retreci. Cette feuille reprend la densite
 * d'une application boutique : recherche compacte, puces de categories, ligne
 * de tri, grille deux colonnes serree, barre basse permanente avec le panier.
 *
 * Rien ici ne touche l'affichage bureau : tout est sous media queries.
 */

:root {
	--upn-accent: #1C61E7;
	--upn-accent-dark: #164BB4;
	--upn-accent-soft: #EAF1FF;
	--upn-ink: #1B2437;
	--upn-body: #414C61;
	--upn-muted: #6B7788;
	--upn-line: #E6EAF0;
	--upn-bg: #F4F6F8;
	--upn-surface: #FFFFFF;
	--upn-gold: #FFB400;
	--upn-success: #12764F;
	--upn-success-soft: #E8F5EF;
	--upn-warning: #8A5A00;
	--upn-warning-soft: #FDF3E2;
	--upn-whatsapp: #128C7E;
	--upn-bar-h: 58px;
}

/* ==========================================================================
   1. Barre d'outils basse - toujours visible, panier compris
   ========================================================================== */

@media (max-width: 1024px) {

	.wd-toolbar {
		background: var(--upn-surface);
		border-top: 1px solid var(--upn-line);
		box-shadow: 0 -2px 14px rgba(27, 36, 55, .07);
		padding: 0;
		min-height: var(--upn-bar-h);
		padding-bottom: env(safe-area-inset-bottom);
	}

	.wd-toolbar .wd-toolbar-item,
	.wd-toolbar .wd-tools-element,
	.wd-toolbar .wd-header-search,
	.wd-toolbar .wd-header-cart,
	.wd-toolbar .wd-header-my-account {
		flex: 1 1 0;
		min-width: 0;
	}

	.wd-toolbar > div > a {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-height: var(--upn-bar-h);
		padding: 6px 2px;
		color: var(--upn-muted);
	}

	.wd-toolbar .wd-toolbar-label {
		font-size: 10px;
		line-height: 1.1;
		letter-spacing: .01em;
		text-transform: none;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: 100%;
	}

	.wd-toolbar .wd-tools-icon {
		font-size: 21px;
	}

	.wd-toolbar > div > a:hover,
	.wd-toolbar > div > a:focus-visible,
	.wd-toolbar > div.wd-active > a {
		color: var(--upn-accent);
	}

	/* L'onglet correspondant a la page ouverte. */
	.wd-toolbar .upn-tab-current > a {
		position: relative;
		color: var(--upn-accent);
		font-weight: 600;
	}

	.wd-toolbar .upn-tab-current > a::before {
		content: "";
		position: absolute;
		top: 0;
		left: 50%;
		transform: translateX(-50%);
		width: 28px;
		height: 3px;
		border-radius: 0 0 3px 3px;
		background: var(--upn-accent);
	}

	/* Le compteur du panier : pastille or, lisible d'un coup d'oeil. */
	.wd-toolbar .wd-header-cart .wd-cart-number {
		position: absolute;
		top: -6px;
		inset-inline-start: 58%;
		min-width: 18px;
		height: 18px;
		padding: 0 5px;
		border-radius: 999px;
		background: var(--upn-gold);
		color: #23303F;
		font-size: 11px;
		font-weight: 700;
		line-height: 18px;
		text-align: center;
		box-shadow: 0 0 0 2px var(--upn-surface);
	}

	.wd-toolbar .wd-header-cart .wd-cart-number span {
		display: none;
	}

	/* Panier vide : pas de pastille. */
	.wd-toolbar .wd-header-cart.upn-cart-empty .wd-cart-number {
		display: none;
	}

	/* De la place sous le contenu pour que la barre ne masque rien. */
	body.upn-has-bottom-bar {
		padding-bottom: calc(var(--upn-bar-h) + env(safe-area-inset-bottom));
	}

	/* Le bouton WhatsApp flottant remonte au-dessus de la barre. */
	.upnovo-wa-float {
		bottom: calc(var(--upn-bar-h) + 14px + env(safe-area-inset-bottom));
		inset-inline-end: 14px;
		z-index: 340;
	}

	.scrollToTop {
		bottom: calc(var(--upn-bar-h) + 76px + env(safe-area-inset-bottom));
	}
}

/* ==========================================================================
   2. Moins de decor : ce que le telephone n'a pas a porter
   ========================================================================== */

@media (max-width: 768.98px) {

	/* Fil d'Ariane, compteur de resultats bavard, description de categorie
	   longue : autant de lignes qui repoussent les produits sous la ligne de
	   flottaison. */
	body.post-type-archive-product .woocommerce-breadcrumb,
	body.tax-product_cat .woocommerce-breadcrumb,
	body.single-product .woocommerce-breadcrumb {
		display: none;
	}

	.wd-page-title,
	.page-title.wd-title-color-white {
		padding-block: 14px;
		min-height: 0;
	}

	.wd-page-title .entry-title,
	.page-title .entry-title {
		font-size: 20px;
		line-height: 1.2;
	}

	/* WoodMart empile ses propres outils de boutique : nous les remplacons.
	   Le fil d'Ariane, le carrousel de categories en photos, le selecteur de tri
	   natif et le bouton de filtres coutaient a eux seuls la moitie du premier
	   ecran. Les puces et la ligne de tri UpNovo disent la meme chose en trois
	   fois moins de hauteur. */
	body.post-type-archive-product .wd-shop-tools,
	body.tax-product_cat .wd-shop-tools,
	body.post-type-archive-product .wd-el-breadcrumbs,
	body.tax-product_cat .wd-el-breadcrumbs,
	body.post-type-archive-product .wd-cats-element,
	body.tax-product_cat .wd-cats-element,
	body.post-type-archive-product .wd-shop-ordering,
	body.tax-product_cat .wd-shop-ordering,
	body.post-type-archive-product .wd-off-canvas-btn,
	body.tax-product_cat .wd-off-canvas-btn,
	body.post-type-archive-product .wd-shop-result-count,
	body.tax-product_cat .wd-shop-result-count {
		display: none !important;
	}

	/* Le titre d'archive reste, en discret : il dit ou l'on est. */
	body.post-type-archive-product .wd-woo-page-title .entry-title,
	body.tax-product_cat .wd-woo-page-title .entry-title {
		font-size: 22px;
		line-height: 1.15;
		font-weight: 600;
	}

	body.post-type-archive-product .wd-woo-page-title,
	body.tax-product_cat .wd-woo-page-title {
		margin-bottom: 10px;
	}

	.wd-content-area,
	.site-content {
		padding-block: 12px;
	}

	.wd-section-stretch,
	.wd-negative-gap {
		margin-inline: 0;
	}
}

/* ==========================================================================
   3. Barre d'outils boutique UpNovo : recherche, puces, tri
   ========================================================================== */

.upn-shop-tools {
	display: none;
}

@media (max-width: 768.98px) {

	.upn-shop-tools {
		display: block;
		margin: 0 0 14px;
	}

	/* Rappel d'une recherche en cours. */
	.upn-searching {
		margin: 0 0 10px;
		font-size: 13px;
		color: var(--upn-muted);
	}

	.upn-searching strong {
		color: var(--upn-ink);
	}

	.upn-searching a {
		margin-inline-start: 6px;
		color: var(--upn-accent);
	}

	/* Puces de categories : un rail qui glisse, jamais un menu deroulant. */
	.upn-chips {
		display: flex;
		gap: 8px;
		margin: 0 0 10px;
		padding: 2px 0 6px;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
	}

	.upn-chips::-webkit-scrollbar {
		display: none;
	}

	.upn-chip {
		flex: 0 0 auto;
		scroll-snap-align: start;
		display: inline-flex;
		align-items: center;
		height: 36px;
		padding: 0 15px;
		border: 1px solid var(--upn-line);
		border-radius: 999px;
		background: var(--upn-surface);
		color: var(--upn-body);
		font-size: 13.5px;
		line-height: 1;
		white-space: nowrap;
		text-decoration: none;
	}

	.upn-chip:hover,
	.upn-chip:focus-visible {
		color: var(--upn-accent);
		border-color: var(--upn-accent);
	}

	.upn-chip.is-active {
		background: var(--upn-accent);
		border-color: var(--upn-accent);
		color: #fff;
		font-weight: 500;
	}

	/* Ligne de tri : des mots, pas un select natif. */
	.upn-sort {
		display: flex;
		align-items: center;
		gap: 6px;
		margin: 0 0 10px;
		padding: 0 0 8px;
		overflow-x: auto;
		scrollbar-width: none;
		border-bottom: 1px solid var(--upn-line);
	}

	.upn-sort::-webkit-scrollbar {
		display: none;
	}

	.upn-sort a {
		flex: 0 0 auto;
		padding: 5px 8px;
		border-radius: 6px;
		color: var(--upn-muted);
		font-size: 13px;
		line-height: 1.2;
		white-space: nowrap;
		text-decoration: none;
	}

	.upn-sort a.is-active {
		background: var(--upn-accent-soft);
		color: var(--upn-accent);
		font-weight: 600;
	}

	.upn-sort__stock {
		display: inline-flex;
		align-items: center;
		gap: 7px;
		margin-inline-start: auto;
		padding-inline-start: 6px;
	}

	.upn-sort__stock .upn-radio {
		width: 15px;
		height: 15px;
		border: 1.5px solid var(--upn-line);
		border-radius: 999px;
		flex: 0 0 auto;
	}

	.upn-sort__stock.is-active .upn-radio {
		border-color: var(--upn-accent);
		background: radial-gradient(circle, var(--upn-accent) 0 45%, transparent 46%);
	}

	.upn-count {
		margin: 0 0 10px;
		color: var(--upn-muted);
		font-size: 13px;
	}
}

/* ==========================================================================
   4. Cartes produits : le format d'application, pas la fiche complete
   ========================================================================== */

@media (max-width: 768.98px) {

	.wd-products-element .products,
	.products.wd-products {
		gap: 10px 10px;
		margin-inline: 0;
	}

	.products.elements-grid .wd-product,
	.wd-product.wd-col {
		padding-inline: 5px;
		margin-bottom: 10px;
	}

	.wd-product .product-wrapper {
		background: var(--upn-surface);
		border: 1px solid var(--upn-line);
		border-radius: 12px;
		overflow: hidden;
		height: 100%;
		display: flex;
		flex-direction: column;
	}

	.wd-product .wd-product-thumb {
		margin-bottom: 0;
		border-radius: 0;
		background: #fff;
	}

	.wd-product .product-element-bottom {
		padding: 9px 10px 11px;
		display: flex;
		flex-direction: column;
		gap: 4px;
		flex: 1 1 auto;
	}

	/* Ce que la carte n'a pas besoin de dire sur un telephone. La ligne de
	   disponibilite part avec le reste : le badge pose sur la photo dit deja
	   "Bientot disponible", et l'ecrire deux fois dans 143 px de large est du
	   remplissage. Les icones favoris / comparer / apercu laissent la place a
	   la seule pastille qui compte, celle qui ajoute au panier. */
	.wd-product .wd-product-cats,
	.wd-product .wd-product-sku,
	.wd-product .wd-product-detail,
	.wd-product .wd-product-stock,
	.wd-product .wd-product-card-hover,
	.wd-product .hover-content-wrap,
	.wd-product .woocommerce-product-attributes,
	.wd-product .wd-compare-btn,
	.wd-product .wd-quick-view-btn,
	.wd-product .wd-wishlist-btn,
	.wd-product .wd-buttons,
	.wd-product .wd-product-grid-slider-pagin {
		display: none !important;
	}

	.wd-product .wd-entities-title {
		margin: 0;
		font-size: 13.5px;
		line-height: 1.32;
		font-weight: 500;
		color: var(--upn-ink);
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
		min-height: calc(13.5px * 1.32 * 2);
	}

	.wd-product .wd-entities-title a {
		color: inherit;
	}

	.wd-product .wd-product-stock {
		margin: 0;
		font-size: 11.5px;
		line-height: 1.3;
		font-weight: 500;
	}

	.wd-product .wrap-price,
	.wd-product .price {
		margin: 0;
		font-size: 15px;
		line-height: 1.25;
		font-weight: 700;
		color: var(--upn-accent);
	}

	.wd-product .price del {
		font-size: 12px;
		font-weight: 400;
		color: var(--upn-muted);
	}

	.wd-product .price ins {
		text-decoration: none;
	}

	/* L'action reste visible : sur mobile rien ne se revele au survol. */
	.wd-product .wd-add-btn {
		margin-top: auto;
		padding-top: 6px;
		opacity: 1;
		visibility: visible;
		transform: none;
		position: static;
	}

	.wd-product .wd-add-btn > a,
	.wd-product .wd-add-btn .button {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 6px;
		width: 100%;
		min-height: 36px;
		padding: 0 10px;
		border-radius: 8px;
		font-size: 12.5px;
		line-height: 1.2;
		font-weight: 600;
		text-align: center;
	}

	/* Le vert WhatsApp est la couleur du canal, jamais l'accent d'interface :
	   sur la carte le bouton est un contour vert sur blanc.

	   !important assume : WoodMart peint ce bouton depuis
	   `.wd-product.wd-hover-<style> .wd-add-btn > a`, dont le selecteur change
	   avec le style de survol choisi dans le theme. Surencherir sur la
	   specificite obligerait a enumerer chaque variante et a la maintenir a
	   chaque mise a jour du theme. */
	.wd-product .wd-add-btn .upnovo-wa-btn {
		background: var(--upn-surface) !important;
		border: 1px solid var(--upn-whatsapp) !important;
		color: var(--upn-whatsapp) !important;
		min-height: 36px;
	}

	.wd-product .wd-add-btn .upnovo-wa-btn__long {
		display: none;
	}

	.wd-product .wd-add-btn .upnovo-wa-btn {
		white-space: nowrap;
	}

	/* Le bouton d'ajout rapide, en pastille sur la photo. */
	.upn-quick-add {
		position: absolute;
		top: 8px;
		inset-inline-end: 8px;
		z-index: 3;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 34px;
		height: 34px;
		border: 1px solid var(--upn-line);
		border-radius: 999px;
		background: rgba(255, 255, 255, .96);
		color: var(--upn-accent);
		box-shadow: 0 1px 5px rgba(27, 36, 55, .1);
		text-decoration: none;
		padding: 0;
		cursor: pointer;
	}

	.upn-quick-add .upn-i {
		width: 16px;
		height: 16px;
		display: block;
	}

	.upn-quick-add--wa {
		color: var(--upn-whatsapp);
	}

	.upn-quick-add.is-loading {
		opacity: .5;
		pointer-events: none;
	}

	/* Ajoute : la pastille passe au bleu plein une seconde et demie, le temps
	   que le pouce voie qu'il s'est passe quelque chose. */
	.upn-quick-add.is-done {
		background: var(--upn-accent);
		border-color: var(--upn-accent);
		color: #fff;
	}

	.upn-quick-add.is-done .upn-i {
		visibility: hidden;
	}

	.upn-quick-add.is-done::after {
		content: "";
		position: absolute;
		width: 11px;
		height: 6px;
		border-left: 2px solid #fff;
		border-bottom: 2px solid #fff;
		transform: rotate(-45deg) translate(1px, -1px);
	}

	/* Le badge de statut : petit, en bas a gauche, sur la photo. */
	.wd-product .upnovo-badge {
		top: auto;
		bottom: 8px;
		inset-inline-start: 8px;
		font-size: 10.5px;
		padding: 3px 8px;
		border-radius: 999px;
	}
}

/* Trois colonnes des que l'ecran le permet, sans changer la densite. */
@media (min-width: 560px) and (max-width: 768.98px) {

	.products.elements-grid .wd-product,
	.wd-product.wd-col {
		width: 33.333%;
	}
}

/* ==========================================================================
   5. Fiche produit, panier, compte : la meme economie de place
   ========================================================================== */

@media (max-width: 768.98px) {

	.single-product .product_title {
		font-size: 19px;
		line-height: 1.25;
	}

	.single-product .summary .price {
		font-size: 22px;
	}

	.single-product .wd-single-product-tabs,
	.single-product .woocommerce-tabs {
		margin-top: 18px;
	}

	.single-product .wd-tab-title,
	.single-product .wc-tabs li a {
		font-size: 13.5px;
		padding: 10px 12px;
	}

	.single-product .upnovo-trust {
		gap: 8px;
	}

	.single-product .upnovo-trust__item {
		font-size: 12.5px;
	}

	/* Le bouton d'achat reste sous la main. */
	.single-product form.cart .single_add_to_cart_button {
		min-height: 46px;
		font-size: 15px;
	}

	.woocommerce-cart .cart_totals,
	.woocommerce-checkout .woocommerce-checkout-review-order {
		margin-top: 16px;
	}

	.woocommerce-cart table.cart td,
	.woocommerce-cart table.cart th {
		padding: 10px 8px;
		font-size: 13.5px;
	}
}

/* ==========================================================================
   6. Banniere UpNovo
   ========================================================================== */

.upn-banner {
	position: relative;
	display: block;
	margin: 0 0 22px;
	border-radius: 12px;
	overflow: hidden;
	background: #2A0A21;
	text-decoration: none;
	color: #fff;
}

.upn-banner img {
	display: block;
	width: 100%;
	height: auto;
}

.upn-banner__body {
	position: absolute;
	inset-inline-start: 0;
	bottom: 0;
	width: 100%;
	padding: 34px 20px 16px;
	background: linear-gradient(to top, rgba(24, 6, 19, .82) 0%, rgba(24, 6, 19, .55) 45%, rgba(24, 6, 19, 0) 100%);
}

.upn-banner__title {
	display: block;
	margin: 0 0 3px;
	font-size: clamp(16px, 3.4vw, 26px);
	line-height: 1.15;
	font-weight: 600;
	color: #fff;
}

.upn-banner__text {
	display: block;
	margin: 0;
	font-size: clamp(12px, 2.4vw, 15px);
	line-height: 1.4;
	color: rgba(255, 255, 255, .88);
}

.upn-banner__cta {
	display: inline-flex;
	align-items: center;
	margin-top: 10px;
	padding: 0 16px;
	height: 38px;
	border-radius: 8px;
	background: var(--upn-accent);
	color: #fff;
	font-size: 13.5px;
	font-weight: 600;
}

@media (max-width: 480px) {

	.upn-banner__body {
		padding: 26px 14px 12px;
	}

	.upn-banner__cta {
		height: 34px;
		font-size: 12.5px;
	}
}

/* ==========================================================================
   7. Icones

   Les icones sont posees en SVG dans le document (voir upnovo_mobile_icon en
   PHP) plutot qu'en masque CSS : sur les WebView Android d'entree de gamme un
   masque CSS s'affiche parfois comme une pastille vide, et une pastille vide
   dans le coin d'une photo produit ne veut rien dire.
   ========================================================================== */

.upn-i {
	flex: 0 0 auto;
}

/* ==========================================================================
   8. Pied de page

   Le pied de page precedent empilait une bande de reassurance en 4 colonnes
   puis un bloc de liens en 4 colonnes : sur telephone cela faisait sept
   ecrans de defilement avant d'atteindre le copyright. Ici, deux colonnes
   seulement (marque / liens), et les deux listes de liens restent cote a
   cote meme sur telephone pour que le pied reste court.
   ========================================================================== */

.wd-footer .main-footer {
	padding-top: 0;
	padding-bottom: 0;
}

.upn-footer-brand .wd-block-image {
	margin-bottom: 12px;
}

.upn-footer-brand .wd-block-image img {
	width: 132px;
	height: auto;
}

.upn-footer-line {
	margin: 0 0 12px;
	max-width: 34rem;
	font-size: 13.5px;
	line-height: 1.55;
	opacity: .8;
}

.upn-footer-contact {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
	font-size: 13.5px;
	line-height: 1.5;
}

.upn-footer-contact a {
	font-weight: 600;
}

.upn-footer-contact span {
	opacity: .72;
}

/* Les deux listes cote a cote a l'interieur de la colonne de droite. */
.upn-footer-links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px 24px;
	align-content: start;
}

.upn-footer-links .wp-block-wd-menu-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.upn-footer-links .wp-block-wd-menu-list > li {
	list-style: none;
}

.upn-footer-links .sub-sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.upn-footer-h {
	display: block;
	margin-bottom: 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	opacity: .55;
}

.upn-footer-links .wp-block-wd-menu-list-item {
	margin: 0;
	list-style: none;
}

.upn-footer-links .wp-block-wd-menu-list-item a {
	display: block;
	padding: 3px 0;
	font-size: 13.5px;
	line-height: 1.45;
}

/* Le copyright : une seule ligne, pas deux blocs qui se chevauchent.
   La specificite est doublee parce que footer-base.css, charge dans le pied
   de page donc apres cette feuille, pose padding-block: 20px. */
.wd-footer .wd-copyrights {
	padding-block: 12px;
	font-size: 12.5px;
}

.wd-footer .wd-copyrights .upn-pay {
	opacity: .7;
}

@media (min-width: 1025px) {

	.upn-footer-links {
		padding-left: 8%;
	}
}

@media (max-width: 1024px) {

	.upn-footer-brand {
		margin-bottom: 22px;
	}
}

@media (max-width: 767px) {

	.wd-footer .wd-copyrights .wd-grid-g {
		gap: 4px;
		text-align: center;
	}

	.upn-footer-brand .wd-block-image img {
		width: 116px;
	}

	.upn-footer-line,
	.upn-footer-contact,
	.upn-footer-links .wp-block-wd-menu-list-item a {
		font-size: 13px;
	}

	.upn-footer-brand {
		margin-bottom: 18px;
	}

	.upn-footer-links {
		gap: 14px 18px;
	}

	/* La barre d'action collee en bas masque la fin du pied de page. */
	.upn-has-bottom-bar .wd-footer .wd-copyrights {
		padding-bottom: 18px;
	}
}
