/* ═══════════════════════════════════════════════════════════════════════
   MMX Deal of the Day — Shadow DOM Styles
   ═══════════════════════════════════════════════════════════════════════ */

:host {
	display: block;
	--deal-accent: var(--theme-color-primary, #e53e3e);
	--deal-accent-dark: var(--theme-color-primary-dark, #c53030);
	--deal-text: var(--theme-color-text, #1a202c);
	--deal-text-muted: var(--theme-color-text-secondary, #718096);
	--deal-surface: var(--theme-color-surface, #ffffff);
	--deal-border: var(--theme-color-border, #e2e8f0);
	--deal-radius: 12px;
	--deal-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
	--deal-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.14);
	--deal-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ─── Wrapper ────────────────────────────────────────────────────── */

[part~="wrapper"] {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding: 0 16px;
}


/* ─── Countdown Timer — Block Style ──────────────────────────────── */

[part~="countdown"] {
	display: flex;
	justify-content: center;
	margin-bottom: 32px;
}

.mmx-deal-of-the-day__timer-blocks {
	display: flex;
	align-items: center;
	gap: 8px;
}

.mmx-deal-of-the-day__timer-block {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: var(--timer-bg, var(--deal-accent));
	color: var(--timer-text, #ffffff);
	border-radius: 8px;
	padding: 12px 16px;
	min-width: 72px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mmx-deal-of-the-day__timer-value {
	font-size: 2rem;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.mmx-deal-of-the-day__timer-label {
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.85;
	margin-top: 4px;
}

.mmx-deal-of-the-day__timer-separator {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--timer-bg, var(--deal-accent));
	line-height: 1;
	padding-bottom: 18px;
}


/* ─── Countdown Timer — Badge Style ──────────────────────────────── */

.mmx-deal-of-the-day__timer-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--timer-bg, var(--deal-accent));
	color: var(--timer-text, #ffffff);
	border-radius: 100px;
	padding: 10px 24px;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mmx-deal-of-the-day__timer-badge-icon {
	font-size: 1.1em;
}

.mmx-deal-of-the-day__timer-badge-text {
	font-variant-numeric: tabular-nums;
}


/* ─── Expired State ──────────────────────────────────────────────── */

.mmx-deal-of-the-day__expired {
	text-align: center;
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--deal-text-muted);
	background: var(--deal-border);
	border-radius: 100px;
	padding: 10px 24px;
	display: inline-block;
}

.mmx-deal-of-the-day--expired [part~="content"] {
	opacity: 0.5;
	pointer-events: none;
	filter: grayscale(60%);
}


/* ─── Product Grid ───────────────────────────────────────────────── */

[part~="content"] {
	display: grid;
	gap: 24px;
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.mmx-deal-of-the-day__panel--count-2 ~ .mmx-deal-of-the-day__panel--count-2,
	.mmx-deal-of-the-day__panel--count-2:first-child {
		/* 2-column handled below */
	}

	[part~="content"]:has(.mmx-deal-of-the-day__panel--count-2) {
		grid-template-columns: repeat(2, 1fr);
	}

	[part~="content"]:has(.mmx-deal-of-the-day__panel--count-3) {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 640px) and (max-width: 899px) {
	[part~="content"]:has(.mmx-deal-of-the-day__panel--count-3) {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 900px) {
	[part~="content"]:has(.mmx-deal-of-the-day__panel--count-3) {
		grid-template-columns: repeat(3, 1fr);
	}
}


/* ─── Product Panel ──────────────────────────────────────────────── */

.mmx-deal-of-the-day__panel {
	position: relative;
	background: var(--panel-bg, var(--deal-surface));
	border-radius: var(--deal-radius);
	box-shadow: var(--deal-shadow);
	overflow: hidden;
	transition: box-shadow var(--deal-transition), transform var(--deal-transition);
	display: flex;
	flex-direction: column;
}

.mmx-deal-of-the-day__panel:hover {
	box-shadow: var(--deal-shadow-hover);
	transform: translateY(-4px);
}


/* ─── Badge ──────────────────────────────────────────────────────── */

.mmx-deal-of-the-day__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	background: var(--badge-bg, var(--deal-accent));
	color: var(--badge-text, #ffffff);
	font-size: 0.75rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 6px 12px;
	border-radius: 6px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}


/* ─── Product Image ──────────────────────────────────────────────── */

.mmx-deal-of-the-day__image-link {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f7fafc;
}

.mmx-deal-of-the-day__image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform var(--deal-transition);
	padding: 16px;
}

.mmx-deal-of-the-day__panel:hover .mmx-deal-of-the-day__image {
	transform: scale(1.05);
}

.mmx-deal-of-the-day__image-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #edf2f7, #e2e8f0);
}


/* ─── Product Details ────────────────────────────────────────────── */

.mmx-deal-of-the-day__details {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 12px;
	padding: 20px 20px 24px;
	flex: 1;
}

.mmx-deal-of-the-day__name {
	font-size: 1rem;
	font-weight: 600;
	color: var(--deal-text);
	text-decoration: none;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color var(--deal-transition);
}

.mmx-deal-of-the-day__name:hover {
	color: var(--deal-accent);
}


/* ─── Pricing ────────────────────────────────────────────────────── */

.mmx-deal-of-the-day__pricing {
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
}

.mmx-deal-of-the-day__sale-price {
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--sale-price-color, var(--deal-accent));
	letter-spacing: -0.02em;
}

.mmx-deal-of-the-day__original-price {
	font-size: 1rem;
	color: var(--deal-text-muted);
	text-decoration: line-through;
}

.mmx-deal-of-the-day__price {
	font-size: 1.5rem;
	font-weight: 800;
	color: var(--deal-text);
}


/* ─── CTA Button ─────────────────────────────────────────────────── */

.mmx-deal-of-the-day__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--cta-bg, var(--deal-accent));
	color: var(--cta-text, #ffffff);
	font-size: 0.875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	text-decoration: none;
	padding: 12px 28px;
	border-radius: 8px;
	margin-top: auto;
	transition: background var(--deal-transition), transform var(--deal-transition), color var(--deal-transition);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.mmx-deal-of-the-day__button:hover {
	background: var(--cta-hover, var(--deal-accent-dark));
	transform: scale(1.03);
}

.mmx-deal-of-the-day__button:active {
	transform: scale(0.98);
}


/* ─── Loading State ──────────────────────────────────────────────── */

.mmx-deal-of-the-day__loading {
	grid-column: 1 / -1;
	text-align: center;
	padding: 48px 16px;
	color: var(--deal-text-muted);
	font-size: 0.95rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.mmx-deal-of-the-day__spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid var(--deal-border);
	border-top-color: var(--deal-accent);
	border-radius: 50%;
	animation: mmx-deal-spin 0.7s linear infinite;
}

@keyframes mmx-deal-spin {
	to { transform: rotate(360deg); }
}


/* ─── Empty State ────────────────────────────────────────────────── */

.mmx-deal-of-the-day__empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 48px 16px;
	color: var(--deal-text-muted);
	font-style: italic;
}


/* ─── Search Hints (admin preview) ───────────────────────────────── */

.mmx-deal-of-the-day__search-hints {
	margin-top: 24px;
}

.mmx-deal-of-the-day__search-hint {
	background: #f0f7ff;
	border: 1px solid #bcd4f0;
	border-radius: 8px;
	padding: 14px 18px;
	margin-bottom: 12px;
	font-size: 0.85rem;
	color: var(--deal-text);
}

.mmx-deal-of-the-day__search-hint--empty {
	background: #fff8f0;
	border-color: #f0d4bc;
}

.mmx-deal-of-the-day__search-hint-label {
	display: block;
	font-weight: 700;
	margin-bottom: 6px;
}

.mmx-deal-of-the-day__search-hint-list {
	list-style: none;
	padding: 0;
	margin: 0 0 8px 0;
}

.mmx-deal-of-the-day__search-hint-list li {
	padding: 4px 0;
	border-bottom: 1px solid #e2ecf7;
}

.mmx-deal-of-the-day__search-hint-list li:last-child {
	border-bottom: none;
}

.mmx-deal-of-the-day__search-hint-tip {
	display: block;
	font-size: 0.78rem;
	color: var(--deal-text-muted);
	font-style: italic;
}


/* ─── Responsive Tweaks ──────────────────────────────────────────── */

@media (max-width: 639px) {
	.mmx-deal-of-the-day__timer-block {
		min-width: 56px;
		padding: 8px 10px;
	}

	.mmx-deal-of-the-day__timer-value {
		font-size: 1.5rem;
	}

	.mmx-deal-of-the-day__details {
		padding: 16px 16px 20px;
	}

	.mmx-deal-of-the-day__sale-price,
	.mmx-deal-of-the-day__price {
		font-size: 1.25rem;
	}
}
