/* WhatsApp Panier & Commande – styles front */
:root {
	--wpc-green: #25d366;
	--wpc-green-dark: #1ebe5b;
	--wpc-text: #222;
	--wpc-muted: #666;
	--wpc-border: #e3e3e3;
	--wpc-bg: #fff;
	--wpc-radius: 10px;
}

.wpc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 18px;
	border: 2px solid var(--wpc-green);
	border-radius: var(--wpc-radius);
	background: var(--wpc-green);
	color: #fff;
	font-weight: 600;
	font-size: 15px;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s, transform .1s;
}
.wpc-btn:hover { background: var(--wpc-green-dark); color: #fff; }
.wpc-btn:active { transform: scale(.98); }
.wpc-btn-outline { background: transparent; color: var(--wpc-green); }
.wpc-btn-outline:hover { background: var(--wpc-green); color: #fff; }
.wpc-btn-lg { padding: 14px 26px; font-size: 17px; width: 100%; }
.wpc-btn-disabled { background: #ccc; border-color: #ccc; cursor: not-allowed; }
.wpc-btn.is-loading { opacity: .6; pointer-events: none; }
.wpc-btn.is-added { background: #128c4a; border-color: #128c4a; }

.wpc-wa-icon::before { content: "\1F4AC"; }

/* Grille produits */
.wpc-grid { display: grid; gap: 22px; margin: 20px 0; }
.wpc-cols-1 { grid-template-columns: 1fr; }
.wpc-cols-2 { grid-template-columns: repeat(2, 1fr); }
.wpc-cols-3 { grid-template-columns: repeat(3, 1fr); }
.wpc-cols-4 { grid-template-columns: repeat(4, 1fr); }
.wpc-cols-5 { grid-template-columns: repeat(5, 1fr); }
.wpc-cols-6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .wpc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .wpc-grid { grid-template-columns: 1fr; } }

.wpc-card {
	border: 1px solid var(--wpc-border);
	border-radius: var(--wpc-radius);
	overflow: hidden;
	background: var(--wpc-bg);
	display: flex;
	flex-direction: column;
	transition: box-shadow .2s;
}
.wpc-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.wpc-card-img { display: block; aspect-ratio: 1 / 1; background: #fff; }
.wpc-card-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wpc-noimg { display: block; width: 100%; height: 100%; }
.wpc-card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.wpc-card-title { margin: 0; font-size: 17px; }
.wpc-card-title a { text-decoration: none; color: var(--wpc-text); }
.wpc-card-excerpt { margin: 0; color: var(--wpc-muted); font-size: 14px; }
.wpc-card-price { font-weight: 700; font-size: 18px; margin-top: auto; }
.wpc-add-wrap { display: flex; gap: 8px; align-items: stretch; }
.wpc-add-wrap .wpc-btn { flex: 1; }
.wpc-qty-input { width: 70px; padding: 8px; border: 1px solid var(--wpc-border); border-radius: var(--wpc-radius); text-align: center; }

.wpc-single-buy { margin: 24px 0; padding: 18px; border: 1px solid var(--wpc-border); border-radius: var(--wpc-radius); display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.wpc-single-price { font-size: 24px; font-weight: 700; }

.wpc-pagination { margin: 20px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.wpc-pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--wpc-border); border-radius: 6px; text-decoration: none; }
.wpc-pagination .current { background: var(--wpc-green); color: #fff; border-color: var(--wpc-green); }

/* Panier */
.wpc-table-wrap { overflow-x: auto; }
.wpc-cart-table, .wpc-summary-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.wpc-cart-table th, .wpc-cart-table td, .wpc-summary-table th, .wpc-summary-table td {
	padding: 12px 10px; border-bottom: 1px solid var(--wpc-border); text-align: left; vertical-align: middle;
}
.wpc-cart-table tfoot th, .wpc-summary-table tfoot th { font-size: 17px; border-bottom: 0; }
.wpc-cart-total { color: var(--wpc-green-dark); }
.wpc-cell-product { display: flex; align-items: center; gap: 10px; }
.wpc-cell-product img { border-radius: 6px; object-fit: contain; }
.wpc-line-qty { width: 70px; padding: 6px; text-align: center; border: 1px solid var(--wpc-border); border-radius: 6px; }
.wpc-remove { background: none; border: 0; color: #c00; font-size: 22px; cursor: pointer; line-height: 1; padding: 4px 8px; }
.wpc-cart-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-top: 12px; }
.wpc-cart-empty { text-align: center; padding: 30px 0; }
.wpc-cart-empty p { margin-bottom: 14px; }
.wpc-cart.is-busy { opacity: .5; pointer-events: none; }

@media (max-width: 600px) {
	.wpc-cart-table thead { display: none; }
	.wpc-cart-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--wpc-border); }
	.wpc-cart-table td { border: 0; padding: 4px 0; }
	.wpc-cart-table td[data-label]::before { content: attr(data-label) " : "; color: var(--wpc-muted); }
	.wpc-cart-table .wpc-cell-product { grid-column: 1 / -1; }
	.wpc-cart-table tfoot tr { display: flex; justify-content: space-between; }
}

/* Compteur */
.wpc-counter { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; font-weight: 600; }
.wpc-counter-count { background: var(--wpc-green); color: #fff; border-radius: 12px; padding: 1px 8px; font-size: 13px; }

/* Validation de commande */
.wpc-checkout { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 28px; align-items: start; }
.wpc-summary-table td:last-child, .wpc-summary-table th:last-child,
.wpc-cart-table td:nth-child(2), .wpc-cart-table td:nth-child(4), .wpc-cart-total { white-space: nowrap; text-align: right; }
.wpc-summary-table th:last-child, .wpc-cart-table th:nth-child(2), .wpc-cart-table th:nth-child(4) { text-align: right; }
.wpc-checkout h3 { margin-top: 0; }
.wpc-checkout-summary { border: 1px solid var(--wpc-border); border-radius: var(--wpc-radius); padding: 18px; background: #fafafa; }
.wpc-checkout-form { border: 1px solid var(--wpc-border); border-radius: var(--wpc-radius); padding: 22px; background: var(--wpc-bg); }
.wpc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 520px) { .wpc-row { grid-template-columns: 1fr; } }
.wpc-field { margin: 0 0 14px; }
.wpc-field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; }
.wpc-field label em { font-weight: 400; color: var(--wpc-muted); }
.wpc-field select { width: 100%; padding: 11px 12px; border: 1px solid var(--wpc-border); border-radius: 8px; font-size: 15px; box-sizing: border-box; background: #fff; }
.wpc-field select:focus { outline: 2px solid var(--wpc-green); border-color: var(--wpc-green); }
.wpc-delivery-info { display: block; margin-top: 6px; font-size: 14px; color: var(--wpc-green-dark); }
.wpc-delivery-info[hidden], #wpc-delivery-row[hidden] { display: none; }
.wpc-delivery-recap { color: var(--wpc-muted); font-size: 14px; }
.wpc-notice.wpc-success { background: #e6f7ec; border-color: #a9e2bd; color: #14532d; }
.wpc-field input { width: 100%; padding: 11px 12px; border: 1px solid var(--wpc-border); border-radius: 8px; font-size: 15px; box-sizing: border-box; }
.wpc-field input:focus { outline: 2px solid var(--wpc-green); border-color: var(--wpc-green); }
.wpc-field-error input { border-color: #c00; }
.wpc-error-msg { display: block; color: #c00; font-size: 13px; margin-top: 4px; }
.wpc-req { color: #c00; }
.wpc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.wpc-hint { color: var(--wpc-muted); font-size: 13px; margin: 10px 0 0; text-align: center; }
.wpc-link { font-size: 14px; }
.wpc-notice { padding: 12px 14px; border-radius: 8px; background: #fff8e1; border: 1px solid #ffe08a; }
.wpc-notice.wpc-error { background: #fdecea; border-color: #f5c2c0; color: #8a1f1b; }

/* Moyens de paiement */
.wpc-pay { border: 0; padding: 0; margin: 4px 0 16px; }
.wpc-pay legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
.wpc-pay-option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--wpc-border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.wpc-pay-option.is-selected { border-color: var(--wpc-green); box-shadow: 0 0 0 2px rgba(37,211,102,.2); }
.wpc-pay-option input { margin: 0; }
.wpc-pay-icon { font-size: 20px; width: 26px; text-align: center; }
.wpc-pay-label { font-weight: 600; flex: 1; }
.wpc-pay-badge { font-size: 11px; color: var(--wpc-green-dark); background: #e6f7ec; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.wpc-pay-info { background: #f6fbf7; border: 1px dashed #b7e4c7; border-radius: 8px; padding: 10px 14px; font-size: 14px; margin: 4px 0 10px; }
.wpc-pay-info[hidden] { display: none; }
.wpc-pay-info p { margin: 0 0 6px; }
.wpc-pay-ref[hidden] { display: none; }
.wpc-pay-status { margin: 16px 0; padding: 14px 16px; border-radius: 8px; background: #fff8e1; border: 1px solid #ffe08a; text-align: left; }
.wpc-pay-status-paid { background: #e6f7ec; border-color: #a9e2bd; }
.wpc-pay-status-failed { background: #fdecea; border-color: #f5c2c0; }
.wpc-pay-status p { margin: 8px 0 0; }
.wpc-pay-status form { margin-top: 10px; }

/* Confirmation */
.wpc-confirmation { text-align: center; max-width: 640px; margin: 0 auto; }
.wpc-confirmation-icon { width: 70px; height: 70px; border-radius: 50%; background: var(--wpc-green); color: #fff; font-size: 36px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.wpc-confirmation .wpc-summary-table { text-align: left; }
.wpc-message-preview { text-align: left; margin-top: 20px; }
.wpc-message-preview pre { white-space: pre-wrap; background: #f4f4f4; padding: 14px; border-radius: 8px; font-size: 13px; }

/* Toast */
.wpc-toast {
	position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
	background: #222; color: #fff; padding: 12px 18px; border-radius: 8px; z-index: 9999;
	display: flex; flex-direction: column; gap: 10px; align-items: stretch; opacity: 0; transition: opacity .25s, transform .25s; font-size: 14px;
	width: max-content; max-width: min(520px, 92vw);
}
.wpc-toast__row { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.wpc-toast__items { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.wpc-toast__item { position: relative; flex: 0 0 auto; width: 54px; height: 54px; border-radius: 10px; background: #fff; }
.wpc-toast__item img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.wpc-toast__qty { position: absolute; top: -6px; right: -6px; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px;
	background: var(--wpc-green); color: #fff; font-size: 11px; font-weight: 700; line-height: 21px; text-align: center; }
.wpc-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.wpc-toast a { color: var(--wpc-green); font-weight: 600; text-decoration: none; }
/* Sur mobile : la notification prend la largeur de l'écran, les miniatures défilent */
@media (max-width: 640px) {
	.wpc-toast { left: 12px; right: 12px; width: auto; max-width: none; transform: translateY(20px); }
	.wpc-toast.is-visible { transform: translateY(0); }
}

/* Code promo et opt-in */
.wpc-coupon-row { display: flex; gap: 8px; }
.wpc-coupon-row input { flex: 1; text-transform: uppercase; }
.wpc-coupon-row .wpc-btn { padding: 8px 14px; white-space: nowrap; }
.wpc-coupon-msg { display: block; font-size: 13px; margin-top: 4px; }
.wpc-coupon-msg.is-ok { color: var(--wpc-green-dark); }
.wpc-coupon-msg.is-error { color: #c00; }
.wpc-field-optin label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.wpc-field-optin input { width: auto; margin-top: 3px; }

/* Miniatures et vue rapide */
.wpc-thumb { position: relative; display: inline-block; width: 56px; height: 56px; padding: 0; border: 1px solid var(--wpc-border); border-radius: 8px; background: #fff; cursor: zoom-in; overflow: hidden; vertical-align: middle; flex: 0 0 auto; }
.wpc-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wpc-thumb-empty { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 22px; opacity: .5; }
.wpc-thumb-zoom { position: absolute; right: 2px; bottom: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.92); font-size: 11px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.wpc-thumb:hover .wpc-thumb-zoom, .wpc-thumb:focus .wpc-thumb-zoom { opacity: 1; }
.wpc-thumb:focus { outline: 2px solid var(--wpc-green); }
.wpc-col-img { width: 56px; padding-right: 0 !important; }
.wpc-summary-table td.wpc-col-img, .wpc-summary-table th.wpc-col-img { padding: 8px 4px 8px 0; }
.wpc-cell-product .wpc-thumb { margin-right: 4px; }

.wpc-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.wpc-modal[hidden] { display: none; }
.wpc-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.wpc-modal-box { position: relative; background: #fff; border-radius: 14px; max-width: 760px; width: 100%; max-height: 90vh; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
@media (max-width: 640px) { .wpc-modal-box { grid-template-columns: 1fr; } }
.wpc-modal-media { background: #fff; min-height: 260px; display: flex; align-items: center; justify-content: center; }
.wpc-modal-media img { width: 100%; height: 100%; max-height: 90vh; object-fit: contain; display: block; }
.wpc-modal-media img[hidden] { display: none; }
.wpc-modal-noimg { font-size: 64px; opacity: .35; }
.wpc-modal-content { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.wpc-modal-content h3 { margin: 0; font-size: 22px; padding-right: 30px; }
.wpc-modal-price { font-size: 24px; font-weight: 700; color: var(--wpc-green-dark); }
.wpc-modal-stock { font-size: 13px; color: var(--wpc-muted); }
.wpc-modal-stock.is-out { color: #c00; }
.wpc-modal-desc { font-size: 14px; color: #333; line-height: 1.5; }
.wpc-modal-desc p { margin: 0 0 8px; }
.wpc-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; }
.wpc-modal-close { position: absolute; top: 8px; right: 8px; z-index: 2; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 24px; line-height: 1; cursor: pointer; color: #222; }
.wpc-modal-close:hover { background: #fff; }
.wpc-modal-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.8); color: var(--wpc-muted); }
.wpc-modal-loading[hidden] { display: none; }
body.wpc-modal-open { overflow: hidden; }

/* Volet latéral du panier : glisse depuis la droite, par-dessus la page */
.wpc-drawer { position: fixed; inset: 0; z-index: 9998; display: flex; justify-content: flex-end; }
.wpc-drawer[hidden] { display: none; }
.wpc-drawer__scrim { position: absolute; inset: 0; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .3s ease; }
.wpc-drawer.is-open .wpc-drawer__scrim { opacity: 1; }
.wpc-drawer__panel { position: relative; width: min(100%, 440px); height: 100%; display: flex; flex-direction: column; background: var(--wpc-bg); color: var(--wpc-text);
	box-shadow: -20px 0 60px rgba(0,0,0,.18); transform: translateX(100%); transition: transform .32s cubic-bezier(.32,.72,0,1); outline: none; }
.wpc-drawer.is-open .wpc-drawer__panel { transform: none; }
body.wpc-drawer-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
	.wpc-drawer__panel { transform: none; opacity: 0; transition: opacity .2s ease; }
	.wpc-drawer.is-open .wpc-drawer__panel { opacity: 1; }
}
.wpc-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--wpc-border); }
.wpc-drawer__title { margin: 0; font-size: 20px; }
.wpc-drawer__count { display: inline-block; min-width: 24px; padding: 0 7px; border-radius: 999px; background: var(--wpc-green); color: #fff; font-size: 13px; line-height: 24px; text-align: center; vertical-align: middle; }
.wpc-drawer__close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: inherit; }
.wpc-drawer__close:hover { background: #f1f1f1; }
.wpc-drawer__content { flex: 1; display: flex; flex-direction: column; min-height: 0; transition: opacity .2s; }
.wpc-drawer__content.is-busy { opacity: .55; pointer-events: none; }
.wpc-drawer__lines { list-style: none; margin: 0; padding: 8px 20px; flex: 1; overflow: auto; overscroll-behavior: contain; }
.wpc-drawer__line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--wpc-border); }
.wpc-drawer__thumb { display: block; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: #f4f4f4; }
.wpc-drawer__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wpc-drawer__thumb .wpc-thumb-empty { display: grid; place-items: center; height: 100%; font-size: 26px; opacity: .4; }
.wpc-drawer__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wpc-drawer__name { font-weight: 600; text-decoration: none; color: inherit; overflow-wrap: anywhere; }
.wpc-drawer__price { font-size: 13px; color: var(--wpc-muted); }
.wpc-stepper { display: inline-flex; align-items: center; margin-top: 6px; border: 1px solid var(--wpc-border); border-radius: 999px; }
.wpc-stepper__btn { width: 36px; height: 36px; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: inherit; }
.wpc-stepper .wpc-line-qty { width: 44px; min-height: 0; height: 36px; padding: 0; border: 0; background: transparent; text-align: center; font-weight: 600; -moz-appearance: textfield; }
.wpc-stepper .wpc-line-qty::-webkit-outer-spin-button, .wpc-stepper .wpc-line-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wpc-drawer__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.wpc-drawer__total { font-weight: 700; white-space: nowrap; }
.wpc-drawer__foot { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--wpc-border); display: grid; gap: 10px; }
.wpc-drawer__sum { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font-size: 18px; }
.wpc-drawer__note { margin: -4px 0 4px; font-size: 13px; color: var(--wpc-muted); }
.wpc-drawer__cta { width: 100%; }
.wpc-drawer__link { text-align: center; font-size: 14px; color: inherit; }
.wpc-drawer__empty { flex: 1; display: grid; place-content: center; gap: 16px; padding: 40px 20px; text-align: center; }
.wpc-drawer__empty p { margin: 0; font-size: 18px; }

/* Listes Pays → Ville → Quartier (wpc-lieux.js) */
[data-wpc-lieux] [hidden] { display: none !important; }
[data-wpc-lieux] select + input { margin-top: 8px; }
.wpc-combo { position: relative; display: block; }
.wpc-combo__liste { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: 264px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--wpc-border, #ddd); border-radius: 10px; box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .25); }
.wpc-combo__liste li { padding: 10px 12px; border-radius: 7px; cursor: pointer; font-size: 15px; line-height: 1.3; }
.wpc-combo__liste li:hover, .wpc-combo__liste li[aria-selected="true"] { background: rgba(0, 0, 0, .06); }
.wpc-field textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--wpc-border); border-radius: 8px; font: inherit; font-size: 15px; box-sizing: border-box; }
.wpc-field .wpc-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.wpc-field .wpc-check input { width: auto; margin-top: 3px; }

/* Téléphone : indicatif du pays devant le numéro */
.wpc-tel { position: relative; display: block; }
.wpc-tel__ind { position: absolute; left: 1px; top: 1px; bottom: 1px; display: flex; align-items: center; padding: 0 10px 0 13px; border-right: 1px solid var(--wpc-border, #ddd); color: #555; font-size: 15px; pointer-events: none; }
.wpc-tel__ind[hidden], .wpc-tel__ind.is-off { display: none; }
.wpc-tel__ind:not([hidden]):not(.is-off) + input { padding-left: 72px; }
.wpc-coupon-toggle { margin: 4px 0 16px; }
.wpc-coupon-toggle[hidden], .wpc-field-coupon[hidden] { display: none; }
