/* 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: #f4f4f4; }
.wpc-card-img img { width: 100%; height: 100%; object-fit: cover; 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: cover; }
.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; gap: 14px; align-items: center; opacity: 0; transition: all .25s; font-size: 14px; max-width: 90vw;
}
.wpc-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.wpc-toast a { color: var(--wpc-green); font-weight: 600; text-decoration: none; }

/* 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: #f4f4f4; cursor: zoom-in; overflow: hidden; vertical-align: middle; flex: 0 0 auto; }
.wpc-thumb img { width: 100%; height: 100%; object-fit: cover; 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: #f4f4f4; min-height: 260px; display: flex; align-items: center; justify-content: center; }
.wpc-modal-media img { width: 100%; height: 100%; max-height: 90vh; object-fit: cover; 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; }
