/* Ariston Offers — front-end styles */

:root {
	--ao-accent: #0e5f8a;
}

/* ---------------------------------------------------------------- card */
.ariston-offer-card {
	border: 1px solid var(--ao-accent);
	border-radius: 8px;
	margin: 18px 0;
	overflow: hidden;
	background: #fff;
	font-size: 0.95em;
}

/* Header: gift icon | offer title | end date. The title takes the free space and wraps;
   the date keeps its own width and never breaks. */
.ariston-offer-card__head {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 2px 10px;
	padding: 10px 14px;
	background: linear-gradient(90deg, var(--ao-accent), color-mix(in srgb, var(--ao-accent) 70%, #ffffff));
	color: #fff;
}

.ariston-offer-card__icon {
	font-size: 1.1em;
	line-height: 1;
}

.ariston-offer-card__title {
	margin: 0;
	font-size: 1em;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	overflow-wrap: anywhere;
}

.ariston-offer-card__validity {
	justify-self: end;
	font-size: 0.82em;
	line-height: 1.3;
	white-space: nowrap;
	opacity: 0.95;
}

/* Phones: the end date moves to its own line under the title.
   (A plain media query on purpose: `container-type` on the card makes the Elementor flex column
   that holds it reserve a very tall empty area.) */
@media (max-width: 600px) {
	.ariston-offer-card__head {
		grid-template-columns: auto minmax(0, 1fr);
		padding: 10px 12px;
	}

	.ariston-offer-card__validity {
		grid-column: 2;
		justify-self: start;
		white-space: normal;
	}
}

.ariston-offer-card__body {
	padding: 12px 14px;
}

/* Nothing to show under the header (no texts, no cart progress): no empty white strip. */
.ariston-offer-card__body:not(:has(> :not([hidden]))) {
	display: none;
}

.ariston-offer-card__body > .ariston-offer-card__progress:first-child {
	margin-top: 0;
}

.ariston-offer-slot:not(:has(.ariston-offer-card)) {
	display: none;
}

.ariston-offer-card__applies {
	margin: 0 0 6px;
}

.ariston-offer-card__short {
	margin: 0 0 6px;
	font-weight: 600;
}

.ariston-offer-card__description {
	margin: 0;
	color: #444;
}

.ariston-offer-card__progress.is-applied {
	border-style: solid;
	background: color-mix(in srgb, var(--ao-accent) 16%, #ffffff);
}
.ariston-offer-card__progress {
	margin-top: 10px;
	padding: 8px 12px;
	border-radius: 6px;
	background: color-mix(in srgb, var(--ao-accent) 8%, #ffffff);
	border: 1px dashed var(--ao-accent);
	font-weight: 600;
}

.ariston-offer-card__progress .ao-progress-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 6px 12px;
}

.ariston-offer-card__progress .ao-progress-row + .ao-progress-row {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px dashed color-mix(in srgb, var(--ao-accent) 45%, #ffffff);
}

.ariston-offer-card__progress .ao-progress-row .ao-progress-text {
	flex: 1 1 220px;
}

.ariston-offer-card__progress .ao-progress-row .ao-claim-btn,
.ariston-offer-card__progress .ao-progress-row button.ao-change-btn {
	flex: 0 0 auto;
	margin-left: 0;
}

/* --------------------------------------------------------------- badge */
.ariston-offer-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 5;
	background: var(--ao-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	padding: 3px 9px;
	border-radius: 3px;
	pointer-events: none;
}

/* ------------------------------------------------------- cart banner  */
.ariston-offers-banner {
	border: 1px solid var(--ao-accent);
	border-left-width: 5px;
	border-radius: 6px;
	background: color-mix(in srgb, var(--ao-accent) 6%, #ffffff);
	padding: 14px 16px;
	margin: 0 0 20px;
}

.ariston-offers-banner p {
	margin: 0 0 8px;
}

.ariston-offers-banner p:last-child {
	margin-bottom: 0;
}

.ariston-offers-banner .ao-claim-btn,
.ariston-offer-card__progress .ao-claim-btn {
	display: inline-block;
	margin-left: 10px;
	padding: 4px 14px;
	border: 0;
	border-radius: 4px;
	background: var(--ao-accent);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

/* "Change gift": quiet outline button (specific enough to beat theme button styles). */
.ariston-offer-card button.ao-change-btn,
.ariston-offers-banner button.ao-change-btn {
	display: inline-block;
	margin-left: 10px;
	padding: 3px 12px;
	min-height: 0;
	border: 1px solid var(--ao-accent);
	border-radius: 4px;
	background: transparent;
	color: var(--ao-accent);
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.5;
	text-transform: none;
	cursor: pointer;
}

.ariston-offer-card button.ao-change-btn:hover,
.ariston-offers-banner button.ao-change-btn:hover {
	background: var(--ao-accent);
	color: #fff;
}

.ariston-offers-banner .ao-claim-btn:hover,
.ariston-offer-card__progress .ao-claim-btn:hover {
	filter: brightness(1.1);
}

.ariston-offers-banner .ao-fulfillment {
	font-size: 0.9em;
	color: #555;
	border-top: 1px dashed #bbb;
	padding-top: 8px;
	margin-top: 8px;
}

/* ------------------------------------------------------- free line    */
.ariston-offer-free,
tr.ariston-offer-free td {
	background: color-mix(in srgb, var(--ao-accent) 5%, #ffffff);
}

/* --------------------------------------------------------------- modal */
.ao-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.ao-modal {
	background: #fff;
	border-radius: 8px;
	max-width: 520px;
	width: 100%;
	max-height: 80vh;
	overflow: auto;
	padding: 20px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.ao-modal h3 {
	margin: 0 0 14px;
	color: var(--ao-accent);
}

.ao-modal .ao-gift-option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid #eee;
}

.ao-modal .ao-gift-option img {
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: 4px;
	border: 1px solid #eee;
}

.ao-modal .ao-gift-option .ao-gift-name {
	flex: 1;
	font-weight: 600;
}

.ao-modal .ao-gift-option select {
	max-width: 170px;
}

.ao-modal .ao-modal-close {
	margin-top: 14px;
	background: none;
	border: 0;
	color: #777;
	cursor: pointer;
	text-decoration: underline;
}
