/* ==========================================================================
   Correctifs mobiles transverses : barre mobile du thème (icônes compte +
   panier), menu mobile (accordéon catégories), cibles tactiles.
   Chargé sur toute page front (voir CWC_Auth::enqueue_assets()).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Barre mobile : « Mon compte » + panier (insérés par
   woo-custom-commerce-header.js dans .lqd-mobile-modules-container).
   -------------------------------------------------------------------------- */
.lqd-mobile-sec .cwc-mobile-actions {
	display: flex;
	align-items: center;
	gap: 4px;
	/* Le thème coupe les événements pointeur sur le header (smart sticky)
	   et ne les rétablit que pour ses propres modules. */
	pointer-events: auto;
}

/* Avec des modules dans la barre, le thème recentre le logo et colle
   l'icône hamburger au bord droit de l'écran (rognée) : marge équivalente
   à celle des icônes à gauche. */
.lqd-mobile-sec .lqd-mobile-modules-container:not(.empty) + .nav-trigger {
	padding-inline-end: 20px;
}

.cwc-mobile-actions__account {
	display: flex;
	align-items: center;
}

/* Invité : icône seule, cible tactile de 44px. */
.cwc-mobile-actions .cwc-account-btn--guest {
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #1f2227;
}

.cwc-mobile-actions .cwc-account-btn--guest span {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.cwc-mobile-actions .cwc-account-btn--guest svg {
	width: 22px;
	height: 22px;
	color: currentColor;
}

/* Connecté : avatar seul (nom + chevron masqués), cible de 44px. */
.cwc-mobile-actions .cwc-account-btn__trigger {
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

.cwc-mobile-actions .cwc-account-btn__name,
.cwc-mobile-actions .cwc-account-btn__chevron {
	display: none;
}

/* Le bouton est à gauche de la barre mobile : le dropdown s'ouvre vers la
   droite depuis son bord gauche (aligné à droite comme sur desktop, il
   sortirait de l'écran). */
.cwc-mobile-actions .cwc-account-btn__dropdown {
	top: calc(100% + 6px);
	right: auto;
	left: 0;
	max-width: calc(100vw - 32px);
}

.cwc-mobile-actions .cwc-account-btn__item {
	min-height: 44px;
}

.cwc-mobile-cart {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: #1f2227;
	text-decoration: none;
}

.cwc-mobile-cart:hover,
.cwc-mobile-cart:focus-visible {
	color: #000;
}

.cwc-mobile-cart__count {
	position: absolute;
	top: 4px;
	right: 2px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: #1f2227;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

.cwc-mobile-cart__count[hidden] {
	display: none;
}

/* --------------------------------------------------------------------------
   Menu mobile : sous-catégories (accordéon) — cibles tactiles >= 44px.
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   Boutique, panier : cibles tactiles et cohérence visuelle.
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
	/* Grille produits : « Ajouter au panier » et « Demander un devis » de
	   même largeur et même hauteur (le second, pleine largeur sur 2 lignes,
	   côtoyait un premier bouton étroit sur 1 ligne). */
	ul.products a.cwc-add-to-cart,
	ul.products .cwc-quote-link {
		display: flex !important;
		align-items: center;
		justify-content: center;
		width: 100%;
		min-height: 44px;
		margin-top: 0;
		padding: 8px 6px !important;
		font-size: 13px;
		line-height: 1.2;
		text-align: center;
		white-space: normal;
	}

	/* Filtres par catégorie (boutique, Nos Projets). */
	.cwc-shop-filter__pill,
	.cwc-projects__filter-btn {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
	}

	/* Pied de page : email / téléphones (appel au tap) — zone tactile
	   agrandie, marges négatives pour ne rien décaler visuellement. */
	footer a[href^="tel:"],
	footer a[href^="mailto:"] {
		display: inline-block;
		padding: 10px 0;
		margin: -10px 0;
	}

	/* « Voir plus » des cards avis et flèches du slider du thème
	   (accueil) : zone tactile invisible étendue, sans changer le rendu. */
	.cwc-review-carousel-card__more,
	.lqd-af-slidenav__item {
		position: relative;
	}

	.cwc-review-carousel-card__more::after,
	.lqd-af-slidenav__item::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: max(100%, 44px);
		height: 44px;
		transform: translate(-50%, -50%);
	}

	/* Bandeau cookies du thème. */
	.lqd-gdpr-accept {
		min-height: 44px;
	}

	body.woocommerce nav.woocommerce-pagination ul.page-numbers li > a,
	body.woocommerce nav.woocommerce-pagination ul.page-numbers li > span {
		width: 44px;
		height: 44px;
	}

	/* Panier (bloc WooCommerce) : la ligne produit est une grille à
	   colonnes fixes (80px + 132px + total), plus large que l'écran dès que
	   le montant dépasse ~75 TND (total rogné à droite). Colonne produit
	   flexible à la place. Préfixe body : passe devant cart.css de WC. */
	body .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row {
		grid-template-columns: 64px minmax(0, 1fr) auto;
		column-gap: 12px;
	}

	body .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image {
		padding-right: 0;
	}

	body .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product {
		grid-column-end: 3;
	}

	/* Boutons quantité et suppression : 44px de haut. */
	body .wc-block-cart .wc-block-components-quantity-selector {
		min-height: 44px;
	}

	body .wc-block-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
		width: 40px;
		min-width: 40px;
		min-height: 44px;
	}

	body .wc-block-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input {
		min-height: 44px;
		font-size: 16px;
	}

	body .wc-block-cart .wc-block-cart-item__remove-link {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		min-width: 44px;
		min-height: 44px;
	}
}

/* Cadre de focus laissé sur l'item après un tap : réservé au clavier. */
.lqd-mobile-main-nav a:focus:not(:focus-visible),
.lqd-mobile-main-nav .submenu-expander:focus:not(:focus-visible) {
	outline: none;
}

.lqd-mobile-main-nav .nav-item-children > li > a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding-top: 10px;
	padding-bottom: 10px;
	font-size: 15px;
	line-height: 1.35;
}
