/* ============================================================
   MLFH Product Roundup - frontend styles
   Shares the Spotlight palette and button language.
   - Container queries first (responds to the list's own width),
     viewport media query as a fallback for older browsers.
   - Defensive resets + higher-specificity selectors so themes
     can't blow apart the h3/ul/li/a styling.
   ============================================================ */

.mlfh-rp {
	--mlfh-rp-card: #fdfaf5;
	--mlfh-rp-border: #e8e2d3;
	--mlfh-rp-accent: #8b6f47;
	--mlfh-rp-button: #1f1d1a;
	--mlfh-rp-button-hover: #3a3733;
	--mlfh-rp-text: #2d2a26;

	display: block;
	width: 100%;
	max-width: 100%;
	margin: 40px 0;
	font-family: inherit;
	color: var(--mlfh-rp-text);
	box-sizing: border-box;
	container-type: inline-size;
	container-name: rp;
}

.mlfh-rp *,
.mlfh-rp *::before,
.mlfh-rp *::after {
	box-sizing: border-box;
}

/* ----- List title ----- */
.mlfh-rp .mlfh-rp__title {
	margin: 0 0 18px;
	padding: 0 0 10px;
	font-family: inherit;
	font-size: 1.4rem;
	line-height: 1.25;
	font-weight: 700;
	color: var(--mlfh-rp-text);
	border-bottom: 2px solid var(--mlfh-rp-accent);
}

/* ----- List + rows (defensive resets) ----- */
.mlfh-rp .mlfh-rp__list {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mlfh-rp .mlfh-rp__item {
	margin: 0 !important;
	padding: 14px 18px;
	list-style: none !important;
	display: flex;
	align-items: center;
	gap: 18px;
	background: var(--mlfh-rp-card);
	border: 1px solid var(--mlfh-rp-border);
	border-left: 4px solid var(--mlfh-rp-accent);
	border-radius: 4px;
}

.mlfh-rp .mlfh-rp__item::before {
	content: none !important; /* kill theme list bullets */
}

/* ----- Media ----- */
.mlfh-rp .mlfh-rp__media {
	flex: 0 0 auto;
	display: block;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border-radius: 2px;
	background: #fff;
	border: 1px solid var(--mlfh-rp-border);
}

.mlfh-rp .mlfh-rp__image {
	width: 72px;
	height: 72px;
	display: block;
	object-fit: contain;
	background: #fff;
}

.mlfh-rp .mlfh-rp__image--placeholder {
	background: linear-gradient( 135deg, #f2ead9, #e7ddcb );
}

/* ----- Title ----- */
.mlfh-rp .mlfh-rp__name {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 1.02rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--mlfh-rp-text);
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.mlfh-rp .mlfh-rp__name a {
	color: inherit;
	text-decoration: none;
	background-image: linear-gradient( currentColor, currentColor );
	background-size: 0 1px;
	background-repeat: no-repeat;
	background-position: 0 100%;
	transition: background-size 0.3s ease;
}

.mlfh-rp .mlfh-rp__name a:hover {
	background-size: 100% 1px;
}

/* ----- Shop Now button ----- */
.mlfh-rp .mlfh-rp__action {
	flex: 0 0 auto;
}

.mlfh-rp .mlfh-rp__button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
	padding: 11px 22px;
	background: var(--mlfh-rp-button);
	color: #fff !important;
	text-decoration: none !important;
	border-radius: 2px;
	font-weight: 600;
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.2;
	border: none;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.04 );
	transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.mlfh-rp .mlfh-rp__button:hover {
	background: var(--mlfh-rp-button-hover);
	color: #fff !important;
	transform: translateY( -1px );
	box-shadow: 0 4px 12px rgba( 0, 0, 0, 0.12 );
	text-decoration: none !important;
}

.mlfh-rp .mlfh-rp__button:active {
	transform: translateY( 0 );
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.04 );
}

.mlfh-rp .mlfh-rp__button:focus-visible {
	outline: 2px solid var(--mlfh-rp-accent);
	outline-offset: 3px;
}

.mlfh-rp .mlfh-rp__arrow {
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.mlfh-rp .mlfh-rp__button:hover .mlfh-rp__arrow {
	transform: translateX( 3px );
}

/* ============================================================
   Narrow CONTAINER (primary): image + title stay on the first
   line; the button drops to its own full-width line beneath.
   ============================================================ */
@container rp (max-width: 460px) {
	.mlfh-rp .mlfh-rp__item {
		flex-wrap: wrap;
		gap: 12px 14px;
	}
	.mlfh-rp .mlfh-rp__name {
		flex: 1 1 0;
	}
	.mlfh-rp .mlfh-rp__action {
		flex: 1 1 100%;
	}
	.mlfh-rp .mlfh-rp__button {
		width: 100%;
		justify-content: center;
	}
	.mlfh-rp .mlfh-rp__media,
	.mlfh-rp .mlfh-rp__image {
		width: 60px;
		height: 60px;
	}
}

/* ============================================================
   Viewport fallback for browsers without container-query support.
   Same intent as the container rule above.
   ============================================================ */
@supports not (container-type: inline-size) {
	@media (max-width: 600px) {
		.mlfh-rp .mlfh-rp__item {
			flex-wrap: wrap;
			gap: 12px 14px;
		}
		.mlfh-rp .mlfh-rp__name {
			flex: 1 1 0;
		}
		.mlfh-rp .mlfh-rp__action {
			flex: 1 1 100%;
		}
		.mlfh-rp .mlfh-rp__button {
			width: 100%;
			justify-content: center;
		}
		.mlfh-rp .mlfh-rp__media,
		.mlfh-rp .mlfh-rp__image {
			width: 60px;
			height: 60px;
		}
	}
}
