/*
 * Druette — boutique, catégories, recherche de produits, bonnes affaires, fiche produit.
 * Chargée seulement sur ces pages (inc/woocommerce.php). Les cartes « étiquette » sont dans theme.css.
 */

.dru-main--shop .dru-page-title {
	margin-top: calc(24 * var(--px));
	margin-bottom: 0;
}

/* Texte de présentation de la catégorie (description saisie sur la catégorie). */
.dru-term-intro {
	max-width: 44em;
	margin-inline: auto;
	color: var(--dru-doux);
	font-weight: 500;
	text-align: center;
}

.dru-term-intro > * {
	margin-block: 0;
}

.dru-term-intro > * + * {
	margin-top: 0.8em;
}

/* ---------- Liste de produits ---------- */

.dru-main > .dru-product-list {
	margin-top: calc(48 * var(--px));
}

.dru-product-list__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	margin-bottom: calc(40 * var(--px));
	padding-bottom: 0.9rem;
	border-bottom: 2px dotted var(--dru-sable);
}

.dru-product-list__count {
	margin: 0;
	color: var(--dru-doux);
	font-weight: 600;
}

.dru-sort {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.dru-sort label {
	font-weight: 600;
}

.dru-sort select,
.dru-sort button {
	min-height: 44px;
	padding: 0.4em 2.2em 0.4em 0.8em;
	border: 1px solid var(--dru-sable);
	border-radius: 4px;
	background: var(--dru-blanc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23424242' stroke-width='2'/%3E%3C/svg%3E") right 0.8em center / 0.75em no-repeat;
	color: var(--dru-texte);
	font: inherit;
	appearance: none;
	cursor: pointer;
}

.dru-sort button {
	padding-right: 0.8em;
	background-image: none;
}

.dru-product-grid--list {
	row-gap: calc(48 * var(--px));
}

.dru-product-list__empty {
	margin: 0 0 1.5rem;
	font-size: 1.125rem;
	font-weight: 600;
	text-align: center;
}

.dru-product-list:has(.dru-product-list__empty) {
	text-align: center;
}

/* ---------- Fiche produit ---------- */

.dru-product {
	display: grid;
	grid-template-columns: minmax(0, 600px) minmax(0, 1fr);
	gap: calc(80 * var(--px));
	align-items: start;
	margin-top: calc(40 * var(--px));
}

.dru-product > * {
	margin-block: 0;
}

/* Galerie de photos. */
.dru-gallery {
	position: relative;
}

.dru-gallery__track {
	display: flex;
	overflow-x: auto;
	border-radius: var(--dru-radius);
	background: var(--dru-blanc);
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.dru-gallery__track::-webkit-scrollbar {
	display: none;
}

.dru-gallery__slide {
	flex: 0 0 100%;
	margin: 0;
	aspect-ratio: 1;
	scroll-snap-align: start;
}

.dru-gallery__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dru-gallery__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 0.9rem 0 0;
	padding: 0;
	list-style: none;
}

.dru-gallery__thumbs a {
	display: block;
	width: 76px;
	height: 76px;
	overflow: hidden;
	border: 3px solid transparent;
	border-radius: 10px;
}

.dru-gallery__thumbs a[aria-current] {
	border-color: var(--dru-corail);
}

.dru-gallery__thumbs img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Résumé : catégorie, nom, prix. */
.dru-product__info > * {
	margin-block: 0;
}

.dru-product-summary > * {
	margin: 0;
}

.dru-product-summary .dru-surtitre {
	justify-content: flex-start;
	font-size: 0.9375rem;
}

.dru-product-summary .dru-surtitre::after {
	display: none;
}

.dru-product-summary .dru-surtitre a {
	color: inherit;
	text-decoration: none;
}

.dru-product-summary .dru-surtitre a:hover {
	color: var(--dru-rouge);
}

.dru-product-summary__title {
	margin-top: 0.6rem;
	font-weight: 400;
	line-height: 1;
}

.dru-product-summary__name {
	display: block;
	font-family: var(--dru-font-titre);
	font-size: clamp(2.25rem, 4.5vw, 3.25rem);
	text-transform: uppercase;
	overflow-wrap: anywhere;
}

.dru-product-summary__subtitle {
	display: block;
	margin-top: 0.5rem;
	color: var(--dru-fort);
	font-family: var(--dru-font-texte);
	font-size: clamp(1rem, 2vw, 1.25rem);
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
}

.dru-product-summary__price {
	margin-top: 1.4rem !important;
	color: var(--dru-corail);
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1.1;
}

.dru-product-summary__price del {
	margin-right: 0.3em;
	color: var(--dru-doux);
	font-size: 0.55em;
	font-weight: 400;
}

.dru-product-summary__price ins {
	text-decoration: none;
}

.dru-product-summary__unit {
	margin-top: 0.3rem !important;
	color: var(--dru-doux);
	font-size: 0.9375rem;
}

.dru-product-summary__intro {
	margin-top: 1.4rem !important;
	line-height: 1.6;
}

.dru-product-summary__intro > * {
	margin-block: 0;
}

.dru-product-summary__intro > * + * {
	margin-top: 0.8em;
}

/* Ajout au panier : quantité − / + et bouton. */
.dru-buy {
	margin-top: 1.8rem !important;
}

.dru-buy form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 0.8rem;
	margin: 0;
}

.dru-buy .quantity {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--dru-sable);
	border-radius: 4px;
	background: var(--dru-blanc);
}

.dru-buy .quantity input.qty {
	width: 3.5rem;
	min-height: 52px;
	border: 0;
	background: transparent;
	color: var(--dru-fort);
	font: inherit;
	font-weight: 700;
	text-align: center;
	-moz-appearance: textfield;
}

.dru-buy .quantity input.qty::-webkit-inner-spin-button,
.dru-buy .quantity input.qty::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.dru-qty__btn {
	width: 44px;
	border: 0;
	background: transparent;
	color: var(--dru-fort);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}

.dru-qty__btn:hover {
	color: var(--dru-corail);
}

.dru-buy .single_add_to_cart_button {
	flex: 1 1 14rem;
	min-height: 54px;
	padding: 0 2rem;
	border: 0;
	border-radius: 4px;
	background: var(--dru-rouge);
	color: var(--dru-blanc);
	font-family: var(--dru-font-texte);
	font-size: 1.0625rem;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.dru-buy .single_add_to_cart_button:hover {
	background: var(--dru-corail);
}

.dru-buy .stock {
	margin: 0 0 0.8rem;
	font-weight: 700;
}

.dru-buy .stock.out-of-stock {
	color: var(--dru-rouge);
}

/* Volets : description, ingrédients, informations. */
.dru-main > .dru-details {
	max-width: 900px;
	margin: calc(80 * var(--px)) auto 0;
}

.dru-details__panel {
	border-top: 2px dotted var(--dru-corail);
}

.dru-details__panel:last-child {
	border-bottom: 2px dotted var(--dru-corail);
}

.dru-details__panel summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 64px;
	padding: 0.5rem 0;
	cursor: pointer;
	list-style: none;
}

.dru-details__panel summary::-webkit-details-marker {
	display: none;
}

.dru-details__panel summary::after {
	content: "";
	flex: none;
	width: 0.6em;
	height: 0.6em;
	margin-right: 0.3em;
	border: solid var(--dru-corail);
	border-width: 0 0.18em 0.18em 0;
	transform: rotate(45deg) translateY(-25%);
	transition: transform 0.2s ease;
}

.dru-details__panel[open] summary::after {
	transform: rotate(-135deg) translateY(-25%);
}

.dru-details__title {
	margin: 0;
	font-family: var(--dru-font-texte);
	font-size: 1.125rem;
	font-weight: 700;
	text-transform: uppercase;
}

.dru-details__body {
	padding: 0 0 1.6rem;
	line-height: 1.6;
}

.dru-details__body > * {
	margin-block: 0;
}

.dru-details__body > * + * {
	margin-top: 0.8em;
}

.dru-details__facts {
	margin: 0;
}

.dru-details__facts div {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.4rem 0;
}

.dru-details__facts div + div {
	border-top: 1px solid var(--dru-sable);
}

.dru-details__facts dt {
	font-weight: 600;
}

.dru-details__facts dd {
	margin: 0;
	text-align: right;
}

/* Valeurs nutritionnelles : même lecture que les informations pratiques. */
.dru-details__nutrition {
	width: 100%;
	border-collapse: collapse;
}

.dru-details__nutrition th,
.dru-details__nutrition td {
	padding: 0.4rem 0;
	text-align: left;
	font-weight: 400;
}

.dru-details__nutrition td {
	text-align: right;
	white-space: nowrap;
}

.dru-details__nutrition thead th {
	font-weight: 600;
}

.dru-details__nutrition tbody th {
	font-weight: 600;
}

.dru-details__nutrition tbody tr {
	border-top: 1px solid var(--dru-sable);
}

.dru-details__nutrition tr.is-sub th {
	padding-left: 1rem;
	font-weight: 400;
}

/* Produits liés. */
.dru-main > .dru-related {
	margin-top: calc(110 * var(--px));
}

.dru-related .dru-product-grid {
	margin-top: calc(40 * var(--px));
}

/* ---------- Téléphone et tablette ---------- */

@media (max-width: 899px) {
	.dru-product {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.75rem;
		margin-top: 1rem;
	}

	.dru-gallery__track {
		border-radius: calc(var(--dru-radius) * 0.6);
	}
}

@media (max-width: 599px) {
	.dru-product-list__toolbar {
		justify-content: center;
	}

	.dru-product-summary__price {
		font-size: 1.875rem;
	}
}
