/*
 * LuckyPets / Olivara v2 — styles WooCommerce (boutique, produit, panier, commande, compte).
 * Chargée uniquement sur ces pages. Utilise les tokens --lp-* de main.css.
 */

.lp-wc-wrap {
	padding: 26px 0 var(--lp-section);
}

.lp-theme .woocommerce-breadcrumb {
	margin: 0 0 22px;
	color: var(--lp-muted);
	font-size: .8rem;
}

.lp-theme .woocommerce-breadcrumb a { color: var(--lp-teal); }

/* ---------- Notices ---------- */

.lp-theme .woocommerce-message,
.lp-theme .woocommerce-info,
.lp-theme .woocommerce-error {
	margin: 0 0 22px;
	padding: 14px 18px 14px 46px;
	border: 0;
	border-left: 4px solid var(--lp-teal);
	border-radius: 12px;
	color: var(--lp-navy);
	background: var(--lp-teal-pale);
	font-size: .9rem;
}

.lp-theme .woocommerce-error { border-left-color: var(--lp-danger); background: #fbe9e7; }
.lp-theme .woocommerce-message::before,
.lp-theme .woocommerce-info::before { color: var(--lp-teal); }

/* ---------- Boutons WooCommerce ---------- */

.lp-theme.woocommerce .button,
.lp-theme .woocommerce .button,
.lp-theme.woocommerce button.button.alt,
.lp-theme .woocommerce button.button.alt,
.lp-theme .woocommerce a.button.alt {
	min-height: 46px;
	padding: 12px 22px;
	border: 0;
	border-radius: 999px;
	color: var(--lp-navy);
	background: var(--lp-gold);
	font-weight: 800;
	line-height: 1.2;
}

.lp-theme.woocommerce .button:hover,
.lp-theme .woocommerce .button:hover,
.lp-theme .woocommerce button.button.alt:hover,
.lp-theme .woocommerce a.button.alt:hover {
	color: var(--lp-navy);
	background: var(--lp-gold-light);
}

/* WooCommerce colore les prix en #958e09 (3,4:1) : retour aux couleurs du thème. */
body.lp-theme ul.products li.product .price,
.lp-theme.woocommerce div.product p.price,
.lp-theme.woocommerce div.product span.price {
	color: var(--lp-navy);
}

body.lp-theme ul.products li.product .price del,
.lp-theme.woocommerce div.product p.price del,
.lp-theme.woocommerce div.product span.price del {
	color: var(--lp-gold-dark);
	opacity: 1;
}

/* ---------- Boutique ---------- */

.lp-shop-toolbar {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 24px;
	color: var(--lp-muted);
	font-size: .88rem;
}

.lp-theme .lp-shop-toolbar .woocommerce-result-count,
.lp-theme .lp-shop-toolbar .woocommerce-ordering {
	float: none;
	margin: 0;
}

.lp-shop-toolbar select {
	min-height: 40px;
	padding: 0 12px;
	border: 1px solid var(--lp-line);
	border-radius: 999px;
	color: var(--lp-navy);
	background: var(--lp-white);
}

.lp-pills ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lp-theme .lp-pill {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 999px;
	color: var(--lp-teal-dark);
	background: var(--lp-teal-pale);
	font-size: .78rem;
	font-weight: 800;
	text-decoration: none;
}

.lp-theme .lp-pill:hover,
.lp-theme .lp-pill.is-active {
	color: var(--lp-white);
	background: var(--lp-teal);
}

.lp-theme .woocommerce-pagination ul.page-numbers {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 32px;
	border: 0;
}

.lp-theme .woocommerce-pagination ul.page-numbers li { border: 0; }

.lp-theme .woocommerce-pagination .page-numbers a,
.lp-theme .woocommerce-pagination .page-numbers span {
	display: grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	border-radius: 50%;
	color: var(--lp-navy);
	background: var(--lp-cream);
	font-weight: 800;
}

.lp-theme .woocommerce-pagination .page-numbers .current {
	color: var(--lp-white);
	background: var(--lp-navy);
}

/* ---------- Fiche produit ---------- */

.lp-theme.single-product div.product {
	position: relative;
	display: grid;
	gap: 32px;
}

/* WooCommerce fixe largeur et flottants (sélecteurs avec #content) ; la grille les remplace. */
.lp-theme.single-product #content div.product .woocommerce-product-gallery,
.lp-theme.single-product #content div.product .summary {
	float: none;
	width: 100%;
	margin: 0;
}

.lp-theme.single-product div.product > *:not(.woocommerce-product-gallery):not(.summary):not(.lp-badge) {
	grid-column: 1 / -1;
}

.lp-badge--single { top: 16px; left: 16px; }

.lp-theme .woocommerce-product-gallery {
	overflow: hidden;
	border-radius: 20px;
	background: var(--lp-white);
	box-shadow: var(--lp-shadow-soft);
}

/* Diaporama WooCommerce : sans précaution, toutes les images s'empilent avant l'initialisation
   puis pendant ~100 ms à l'initialisation (la galerie monte à ~1 900 px) : le résumé saute (CLS).
   - Images 2+ masquées tant que le diaporama ne les a pas positionnées (il leur ajoute un style en ligne).
   - Place de la rangée de vignettes (100 px fixes) réservée tant qu'elle n'existe pas.
   Sélecteurs renforcés : WooCommerce affiche les images suivantes en inline-block. */
.lp-theme.single-product div.product div.images .woocommerce-product-gallery__image:nth-child(n+2):not([style]) {
	display: none;
}

.lp-theme.single-product div.product div.images:not(:has(.flex-control-thumbs)):has(.woocommerce-product-gallery__image:nth-child(2))::after {
	display: block;
	height: 100px;
	content: "";
}

/* Zone du diaporama toujours carrée : sa hauteur ne dépend plus de la mise en place des diapositives. */
.lp-theme.single-product div.product div.images .flex-viewport {
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.lp-theme .woocommerce-product-gallery__image img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: contain;
}

.lp-theme .woocommerce-product-gallery .flex-control-thumbs {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	height: 100px;
	gap: 10px;
	overflow-x: auto;
	overflow-y: hidden;
	margin: 0;
	padding: 12px;
	list-style: none;
}

/* WooCommerce impose 25 % de largeur à chaque vignette (.woocommerce div.product div.images
   .flex-control-thumbs li) : vignettes carrées de 76 px, dans la rangée de 100 px réservée. */
.lp-theme.single-product div.product div.images .flex-control-thumbs li {
	flex: 0 0 76px;
	float: none;
	width: 76px;
	height: 76px;
	margin: 0;
}

.lp-theme.single-product div.product div.images .flex-control-thumbs li img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lp-theme .woocommerce-product-gallery .flex-control-thumbs img {
	border: 2px solid var(--lp-line);
	border-radius: 12px;
	opacity: 1;
}

.lp-theme .woocommerce-product-gallery .flex-control-thumbs img.flex-active {
	border-color: var(--lp-gold);
}

.lp-theme .woocommerce-product-gallery__trigger {
	z-index: 2;
	top: 12px;
	right: 12px;
}

.lp-theme div.product .product_title {
	margin: 0 0 12px;
	font-size: clamp(2.1rem, 9vw, 3.9rem);
}

.lp-theme div.product .summary .price {
	margin: 14px 0 6px;
	font-size: 1.7rem;
}

/* Prix promo aussi gras qu'un prix normal (WooCommerce réduit la graisse de <ins>). */
body.lp-theme.woocommerce div.product .summary .price ins { font-weight: 900; }

.lp-saving {
	display: inline-block;
	margin: 0 0 10px;
	padding: 5px 12px;
	border-radius: 999px;
	color: var(--lp-gold-dark);
	background: var(--lp-gold-pale);
	font-size: .82rem;
	font-weight: 800;
}

.lp-theme div.product .woocommerce-variation { margin-bottom: 14px; }
.lp-theme div.product .woocommerce-variation-price .price { display: block; margin: 0 0 6px; }
.woocommerce-variation-price .lp-saving { display: table; }

.lp-shipping-note {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	color: var(--lp-muted);
	font-size: .82rem;
}

.lp-theme div.product .woocommerce-product-details__short-description {
	color: var(--lp-muted);
	line-height: 1.75;
}

.lp-theme div.product .stock { font-weight: 700; }
.lp-theme div.product .stock.in-stock { color: var(--lp-teal); }
.lp-theme div.product .stock.out-of-stock { color: var(--lp-danger); }

.lp-theme div.product form.cart {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 18px 0 12px;
}

/* Le clearfix WooCommerce comptait comme un élément de la rangée et décalait les boutons de 10 px. */
.lp-theme div.product form.cart::before,
.lp-theme div.product form.cart::after { display: none; }

.lp-theme div.product form.cart.variations_form,
.lp-theme div.product form.cart .single_variation_wrap {
	display: block;
	width: 100%;
}

.lp-theme div.product form.cart .woocommerce-variation-add-to-cart {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.lp-theme div.product form.cart table.variations {
	width: 100%;
	margin-bottom: 12px;
	border: 0;
}

.lp-theme div.product form.cart table.variations th,
.lp-theme div.product form.cart table.variations td {
	padding: 6px 0;
	border: 0;
	background: none;
}

.lp-theme div.product form.cart table.variations select {
	width: 100%;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--lp-line);
	border-radius: 10px;
}

.lp-theme .quantity .qty {
	width: 72px;
	min-height: 48px;
	border: 1px solid var(--lp-line);
	border-radius: 999px;
	color: var(--lp-navy);
	font-weight: 800;
	text-align: center;
}

.lp-theme div.product form.cart .single_add_to_cart_button {
	flex: 1 1 160px;
	min-height: 48px;
	padding: 12px 22px;
	font-family: var(--lp-font-body);
	font-size: .95rem;
	font-weight: 800;
	line-height: 1.2;
}

/* Le bouton « Commander » partage la classe native pour la validation des variations. */
.lp-theme div.product form.cart .lp-buy-now {
	color: var(--lp-teal);
	border: 2px solid var(--lp-teal);
	background: var(--lp-white);
}

.lp-theme div.product form.cart .lp-buy-now:hover {
	color: var(--lp-white);
	background: var(--lp-teal);
}

/* Bouton en attente du choix d'une variation : grisé sans transparence, texte lisible (6:1). */
.lp-theme div.product form.cart .single_add_to_cart_button.disabled,
.lp-theme div.product form.cart .single_add_to_cart_button.disabled:hover {
	border-color: var(--lp-cream-deep);
	color: var(--lp-muted);
	background: var(--lp-cream-deep);
	box-shadow: none;
	cursor: not-allowed;
	opacity: 1;
}

.lp-highlights {
	display: grid;
	gap: 10px;
	margin: 22px 0 0;
	padding: 0;
	list-style: none;
}

.lp-highlights li {
	display: flex;
	gap: 10px;
	padding: 13px;
	border-radius: 14px;
	background: var(--lp-teal-pale);
	font-size: .82rem;
}

.lp-highlights .lp-icon { flex: 0 0 auto; color: var(--lp-teal); }
.lp-highlights strong,
.lp-highlights span { display: block; }
.lp-highlights span { color: var(--lp-muted); font-size: .78rem; }

.lp-accordions {
	display: grid;
	gap: 10px;
	margin-top: 26px;
}

.lp-accordions details {
	border: 1px solid var(--lp-line);
	border-radius: var(--lp-radius-sm);
	background: var(--lp-white);
}

.lp-accordions summary {
	display: flex;
	justify-content: space-between;
	padding: 15px 18px;
	font-weight: 800;
	list-style: none;
	cursor: pointer;
}

.lp-accordions summary::-webkit-details-marker { display: none; }
.lp-accordions summary::after { color: var(--lp-gold-dark); content: "+"; }
.lp-accordions details[open] summary::after { content: "–"; }

.lp-accordions details > p,
.lp-accordions details > ul,
.lp-accordions details > dl {
	margin: 0;
	padding: 0 18px 16px;
	color: var(--lp-muted);
	font-size: .88rem;
}

.lp-care dt {
	margin-top: 12px;
	color: var(--lp-navy);
	font-weight: 800;
}

.lp-care dt:first-child { margin-top: 0; }
.lp-care dd { margin: 2px 0 0; }

/* Onglets (description, avis). */
.lp-theme.woocommerce div.product .woocommerce-tabs ul.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 18px;
	padding: 0;
}

.lp-theme.woocommerce div.product .woocommerce-tabs ul.tabs::before,
.lp-theme.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.lp-theme.woocommerce div.product .woocommerce-tabs ul.tabs li::after { display: none; }

.lp-theme.woocommerce div.product .woocommerce-tabs ul.tabs li {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--lp-teal-pale);
}

.lp-theme.woocommerce div.product .woocommerce-tabs ul.tabs li a {
	padding: 9px 16px;
	color: var(--lp-teal-dark);
	font-weight: 800;
}

.lp-theme.woocommerce div.product .woocommerce-tabs ul.tabs li.active { background: var(--lp-teal); }
.lp-theme.woocommerce div.product .woocommerce-tabs ul.tabs li.active a { color: var(--lp-white); }

.lp-theme .woocommerce-Tabs-panel {
	padding: 22px;
	border: 1px solid var(--lp-line);
	border-radius: var(--lp-radius);
	color: var(--lp-muted);
}

.lp-theme .woocommerce-Tabs-panel h2 { margin-bottom: 12px; font-size: 1.4rem; }
.lp-theme .star-rating span::before,
.lp-theme .stars a { color: var(--lp-gold-dark); }

.lp-theme #reviews .commentlist {
	display: grid;
	gap: 12px;
	padding: 0;
}

.lp-theme #reviews .comment_container {
	padding: 16px;
	border-radius: 14px;
	background: var(--lp-cream);
}

.lp-theme .upsells h2,
.lp-theme .related h2 {
	margin: 20px 0 22px;
	font-size: clamp(1.6rem, 5vw, 2.3rem);
}

/* ---------- Barre de livraison offerte ---------- */

.lp-ship-bar {
	margin: 0 0 20px;
	padding: 14px 16px;
	border-radius: 14px;
	color: var(--lp-navy);
	background: var(--lp-gold-pale);
	font-size: .88rem;
}

.lp-ship-bar p {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 10px;
}

.lp-ship-bar__track {
	height: 8px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--lp-white);
}

.lp-ship-bar__track span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--lp-gold);
	transition: width .3s ease;
}

.lp-ship-bar.is-complete { background: var(--lp-teal-pale); }
.lp-ship-bar.is-complete .lp-ship-bar__track span { background: var(--lp-teal); }

.widget_shopping_cart .lp-ship-bar { margin: 12px 0; font-size: .8rem; }

/* ---------- Panier, commande, compte (classiques et blocs) ---------- */

.lp-theme.woocommerce-cart .entry-content > *,
.lp-theme.woocommerce-checkout .entry-content > *,
.lp-theme.woocommerce-account .entry-content > * {
	width: min(calc(100% - 2 * var(--lp-gutter)), var(--lp-container));
}

.lp-theme table.shop_table {
	overflow: hidden;
	border: 1px solid var(--lp-line);
	border-collapse: separate;
	border-radius: var(--lp-radius);
}

.lp-theme table.shop_table th,
.lp-theme table.shop_table td { padding: 14px; border-color: var(--lp-line); }

.lp-theme .cart_totals,
.lp-theme #order_review,
.lp-theme .wc-block-components-sidebar {
	border-radius: var(--lp-radius);
}

.lp-theme .cart_totals,
.lp-theme #order_review {
	padding: 22px;
	background: var(--lp-cream);
}

.lp-theme .woocommerce form .form-row input.input-text,
.lp-theme .woocommerce form .form-row textarea,
.lp-theme .woocommerce form .form-row select {
	min-height: 46px;
	padding: 10px 13px;
	border: 1px solid #cfd6dd;
	border-radius: 10px;
}

.lp-theme #payment {
	border-radius: 15px;
	background: var(--lp-teal-pale);
}

.lp-theme .wc-block-components-button:not(.is-link) {
	border-radius: 999px;
	color: var(--lp-navy);
	background: var(--lp-gold);
	font-weight: 800;
}

.lp-theme .wc-block-components-button:not(.is-link):hover { background: var(--lp-gold-light); }

.lp-theme .woocommerce-MyAccount-navigation ul {
	display: grid;
	gap: 6px;
	padding: 0;
	list-style: none;
}

.lp-theme .woocommerce-MyAccount-navigation a {
	display: block;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--lp-cream);
	font-weight: 700;
	text-decoration: none;
}

.lp-theme .woocommerce-MyAccount-navigation .is-active a {
	color: var(--lp-white);
	background: var(--lp-navy);
}

/* ---------- ≥ 660 px ---------- */

@media (min-width: 660px) {
	.lp-shop-toolbar {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
	}

	.lp-pills { flex: 1 1 100%; }
	.lp-highlights { grid-template-columns: 1fr 1fr; }
	.lp-theme .woocommerce-Tabs-panel { padding: 30px; }
}

/* ---------- ≥ 940 px ---------- */

@media (min-width: 940px) {
	.lp-wc-wrap { padding-top: 40px; }

	.lp-theme.single-product div.product {
		grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
		align-items: start;
		gap: 56px 63px;
	}

	/* Pas de galerie « collante » : WooCommerce la force en position relative, et le décalage
	   top restait appliqué (galerie descendue de 100 px sur la section suivante). */
	.lp-theme .woocommerce-product-gallery {
		border-radius: 26px;
	}
}
