/* RD Product Cards: iHerb-style loop card for reservedaily.com
   Scope: everything lives under .rd-grid / .rd-card so nothing leaks into WoodMart. */

/* The rd-grid class is added to the theme's own products container (WoodMart .products / .wd-products),
   so the column rules carry !important to beat WoodMart's grid and column-count CSS on the same element. */
.rd-grid {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: 10px !important;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
	font-family: Montserrat, system-ui, sans-serif;
}
@media (min-width: 768px) {
	.rd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 16px !important; }
}
@media (min-width: 1025px) {
	.rd-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 20px !important; }
}
/* Theme clearfix pseudo-elements on .products become grid items and leave an empty first cell. Remove them. */
.rd-grid::before,
.rd-grid::after { display: none !important; content: none !important; }
/* Neutralise any per-item width, float or spacing the theme container may push onto its children. */
.rd-grid > .rd-card {
	float: none;
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0;
}
/* WoodMart "bordered grid" mode draws separator lines with borders, box-shadows and pseudo-elements on the
   container, its cells and carousel items. Our card has its own border, so switch all of that off. */
.rd-grid,
.rd-grid.products-bordered-grid,
.rd-grid > :not(.rd-card),
.wd-carousel-item:has(> .rd-card),
.wd-carousel-wrap:has(.rd-card),
.wd-carousel:has(.rd-card) {
	border: 0 !important;
	box-shadow: none !important;
	background-image: none !important;
	outline: 0 !important;
}
.rd-grid > :not(.rd-card)::before,
.rd-grid > :not(.rd-card)::after,
.wd-carousel-item:has(> .rd-card)::before,
.wd-carousel-item:has(> .rd-card)::after,
.wd-carousel:has(.rd-card)::before,
.wd-carousel:has(.rd-card)::after {
	display: none !important;
	content: none !important;
}

.rd-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	overflow: hidden;
	font-family: Montserrat, system-ui, sans-serif; /* also when the card sits in a WoodMart carousel, outside .rd-grid */
	background: #fff;
	border: 1px solid #E1E9EF;
	border-radius: 10px;
	transition: box-shadow .15s ease;
}
@media (min-width: 1025px) {
	.rd-card { border-radius: 12px; }
	.rd-card:hover { box-shadow: 0 6px 18px rgba(8, 94, 131, .14); }
}

/* Image: 3:2 to match the 900x600 listing photos, never cropped */
.rd-card__media {
	position: relative; /* anchors the promo pill overlay */
	display: block;
	aspect-ratio: 3 / 2;
	width: 100%;
	overflow: hidden;
	background: #F4F8FB;
}
.rd-card__media img,
.rd-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rd-card__body {
	display: flex;
	flex: 1 1 auto; /* grows to the card's full height so the button can pin to the bottom */
	flex-direction: column;
	gap: 6px;
	padding: 10px 10px 12px;
	min-width: 0;
}
@media (min-width: 1025px) {
	.rd-card__body { gap: 8px; padding: 14px 14px 16px; }
}

/* Promo pill, overlaid on the image's bottom-left corner (1.2.1, Shariar 2026-10-20: the empty slot above the
   title left an uneasy gap on desktop). Printed only when there is a pill; titles stay aligned either way. */
.rd-card__pill {
	position: absolute;
	left: 8px;
	bottom: 8px;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	height: 20px;
	max-width: calc(100% - 16px);
	padding: 0 8px;
	border-radius: 999px;
	background: #085E83;
	color: #fff;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
@media (min-width: 1025px) {
	.rd-card__pill { left: 10px; bottom: 10px; height: 22px; padding: 0 10px; font-size: 11.5px; }
}

/* Title: 2 lines, clamped. Whole card is the link on mobile via ::after */
.rd-card__title {
	margin: 0;
	font-size: 13px;
	line-height: 1.3;
	font-weight: 600;
	color: #1F2A33;
	min-height: calc(13px * 1.3 * 2);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.rd-card__title a { color: inherit; text-decoration: none; }
.rd-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
@media (min-width: 1025px) {
	/* Desktop: one line only, ellipsis, full title in the link's title attribute (Shariar, 2026-10-20). */
	.rd-card__title { font-size: 15px; line-height: 1.35; min-height: calc(15px * 1.35); -webkit-line-clamp: 1; }
	.rd-card__title a:hover { color: #085E83; }
}

/* Trust badge or stars, same slot */
.rd-card__badge,
.rd-card__stars {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	gap: 4px;
	height: 20px;
	max-width: 100%;
	padding: 0 7px;
	border-radius: 6px;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.rd-card__badge { background: #EAF4FA; color: #085E83; }
.rd-card__badge--empty { background: none; padding: 0; } /* no badge resolved: keeps the slot height */
.rd-card__stars { padding: 0; color: #4A5A66; font-weight: 600; }
.rd-card__reviews { font-weight: 500; color: #6B7A86; }
@media (min-width: 1025px) {
	.rd-card__badge, .rd-card__stars { height: 22px; gap: 5px; font-size: 11.5px; }
	.rd-card__badge { padding: 0 8px; }
}

/* Price row. All parts are sized in em from the row, so rd-product-card.js can shrink the whole row
   (down to 11px) by setting one font-size when "From RM200.00 / package" would not fit the card.
   Without JS the row simply wraps, so the card can never widen. RM80,000 safe. */
.rd-card__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 5px;
	min-width: 0;
	font-size: 16px;
}
.rd-card__price.is-fit {
	flex-wrap: nowrap;
	white-space: nowrap;
	overflow: hidden;
}
.rd-card__from {
	font-size: .69em;
	font-weight: 600;
	color: #4A5A66;
}
.rd-card__now {
	font-size: 1em;
	font-weight: 800;
	color: #0F1B24;
	white-space: nowrap;
}
.rd-card__now .woocommerce-Price-amount,
.rd-card__now .woocommerce-Price-currencySymbol { font: inherit; color: inherit; }
.rd-card__now--enquire { font-size: .8em; font-weight: 700; color: #085E83; }
.rd-card__suffix {
	font-size: .72em;
	font-weight: 500;
	color: #6B7A86;
	white-space: nowrap;
}
.rd-card__was {
	display: block;
	height: 15px;
	font-size: 12px;
	line-height: 15px;
	color: #8A979F;
	text-decoration: line-through;
}
.rd-card__was .woocommerce-Price-amount { font: inherit; color: inherit; text-decoration: inherit; }
.rd-card__was--empty { visibility: hidden; }
.rd-card__was { margin-bottom: 0; }

/* Encouragement line (2026-10-17): "20+ booked", "New listing" or the neutral fallback. Fixed height so the
   button stays aligned across the row; the empty variant keeps the slot. Real data only, see rd_cards_note(). */
.rd-card__note {
	display: flex;
	align-items: center;
	gap: 5px;
	height: 16px;
	margin-bottom: 4px;
	font-size: 11.5px;
	font-weight: 600;
	line-height: 16px;
	color: #3F7D5C;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.rd-card__note::before {
	content: "";
	flex: 0 0 auto;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
}
.rd-card__note--empty { visibility: hidden; }
@media (min-width: 1025px) {
	.rd-card__price { font-size: 19px; }
	.rd-card__from { font-size: .63em; }
	.rd-card__suffix { font-size: .66em; }
	.rd-card__was { font-size: 13px; }
	.rd-card__note { font-size: 12.5px; }
}

/* View Details button on every card at every width (Shariar, 2026-10-16). On mobile the whole card is
   still tappable through .rd-card__link::after; the button sits above that overlay with z-index. */
.rd-card__btn {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 34px;
	margin-top: auto; /* bottom of the card, aligned across the row even when the price row wraps */
	padding-top: 0;
	border-radius: 8px;
	background: #085E83;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	transition: background .15s ease;
}
.rd-card__btn:hover,
.rd-card__btn:focus { background: #064A67; color: #fff; text-decoration: none; }
@media (min-width: 1025px) {
	.rd-card__btn { height: 40px; font-size: 13px; }
}

/* Kill WoodMart leftovers that may still target the loop */
.rd-grid .product-image-link,
.rd-grid .wd-add-btn,
.rd-grid .wd-buttons,
.rd-grid .wd-product-labels { display: none !important; }
