/**
 * Zerosix — Styles front panier / checkout.
 */

/* -----------------------------------------------------------------------
 * Mode "content_only" pour l'iframe preview admin (parité PS content_only=1).
 * Masque l'admin-bar WP, header/footer/sidebar du thème pour que l'iframe
 * n'affiche que le contenu panier + bloc fidélité.
 * ----------------------------------------------------------------------- */
body.zsx-content-only > header,
body.zsx-content-only > footer,
body.zsx-content-only .site-header,
body.zsx-content-only .site-footer,
body.zsx-content-only .wp-site-blocks > header,
body.zsx-content-only .wp-site-blocks > footer,
body.zsx-content-only .wp-block-template-part[role="banner"],
body.zsx-content-only .wp-block-template-part[role="contentinfo"],
body.zsx-content-only header.wp-block-template-part,
body.zsx-content-only footer.wp-block-template-part,
body.zsx-content-only #wpadminbar {
	display: none !important;
}

body.zsx-content-only,
html:has(body.zsx-content-only) {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Encart fidélité panier — portage du `#zerosix-shopping-cart-footer-wrapper`
 * du module PrestaShop (`views/css/front.css` l.233+) : carte blanche à bord
 * arrondi, ombre portée, image latérale pleine hauteur masquée en mobile.
 */

.zerosix-cartblock {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	justify-content: flex-start;
	align-items: flex-start;

	background: #fff;
	border-radius: 15px;

	margin-top: 1rem;
	margin-bottom: 1rem;

	box-shadow: 2px 2px 8px 0 rgba(0, 0, 0, 0.2);
	-webkit-box-shadow: 2px 2px 8px 0 rgba(0, 0, 0, 0.2);
	-moz-box-shadow: 2px 2px 8px 0 rgba(0, 0, 0, 0.2);
	overflow: hidden;
}

.zerosix-cartblock__image {
	/* Safeguard parité PS (`background-size: cover` sur un div) :
	 * la hauteur du container est dictée par le texte côté droit (align-self: stretch)
	 * et l'image est absolue pour ne jamais pousser cette hauteur — un upload
	 * d'image haute (ex. 1920×1000) ne fera plus gonfler tout le bloc. */
	width: 150px;
	flex: 0 0 150px;
	align-self: stretch;
	position: relative;
	overflow: hidden;
}

.zerosix-cartblock__image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

@media screen and (max-width: 480px) {
	.zerosix-cartblock__image {
		display: none;
	}
}

.zerosix-cartblock__body {
	padding: 1rem;
	max-width: 100%;

	flex: 1 1 auto;
}

.zerosix-cartblock__title {
	font-size: 1.2rem;
	font-weight: 600;
	margin: 0 0 0.5rem;
}

.zerosix-cartblock__subtitle {
	font-size: 1rem;
	margin: 0 0 2rem;
}

.zerosix-cartblock__actions {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: center;
	gap: 1rem;
}

/* Vouchers (panier + checkout). */

.zerosix-cart-vouchers,
.zerosix-checkout-vouchers {
	margin: 1rem 0;
	padding: 0.75rem;
	border-radius: 8px;
	background: #fafafa;
	border: 1px solid rgba(0, 0, 0, 0.06);
}

.zerosix-cart-vouchers__title,
.zerosix-checkout-vouchers__title {
	margin: 0 0 0.6rem;
	font-size: 0.95rem;
	font-weight: 600;
}

.zerosix-cart-vouchers__list,
.zerosix-checkout-vouchers__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.zerosix-cart-vouchers__item,
.zerosix-checkout-vouchers__item {
	margin: 0;
}

.zerosix-cart-vouchers__apply,
.zerosix-checkout-vouchers__apply {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.8rem;
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 999px;
	background: #fff;
	color: inherit;
	cursor: pointer;
	font-size: 0.9rem;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.zerosix-cart-vouchers__apply:hover,
.zerosix-checkout-vouchers__apply:hover,
.zerosix-cart-vouchers__apply:focus,
.zerosix-checkout-vouchers__apply:focus {
	background: #f3f4f6;
	border-color: rgba(0, 0, 0, 0.35);
}

.zerosix-cart-vouchers__item.is-cashback .zerosix-cart-vouchers__apply,
.zerosix-checkout-vouchers__item.is-cashback .zerosix-checkout-vouchers__apply {
	border-color: #8b5cf6;
	color: #4c1d95;
}

.zerosix-cart-vouchers__code,
.zerosix-checkout-vouchers__code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.zerosix-cart-vouchers__label,
.zerosix-checkout-vouchers__label {
	color: rgba(0, 0, 0, 0.7);
}

.zerosix-cart-vouchers__amount,
.zerosix-checkout-vouchers__amount {
	font-weight: 700;
}

.zerosix-cart-vouchers__min {
	font-size: 0.8em;
	color: rgba(0, 0, 0, 0.55);
}

.zerosix-cart-vouchers__feedback {
	font-size: 0.8em;
	font-weight: 600;
	padding: 0.15em 0.5em;
	border-radius: 999px;
	background: #ecfdf5;
	color: #065f46;
}

.zerosix-cart-vouchers__apply[data-zerosix-status="loading"] {
	opacity: 0.7;
	pointer-events: none;
}
.zerosix-cart-vouchers__apply[data-zerosix-status="error"] .zerosix-cart-vouchers__feedback,
.zerosix-cart-vouchers__apply[data-zerosix-status="copy-failed"] .zerosix-cart-vouchers__feedback {
	background: #fef2f2;
	color: #991b1b;
}
