/**
 * Rooms Display Manager — Frontend Styles
 *
 * Clean, minimal, theme-compatible defaults.
 * All classes are prefixed with `rdm-` to avoid collisions.
 *
 * @package RoomsDisplayManager
 */

/* ─── CSS Custom Properties ─── */
:root {
	--rdm-primary: #2c3e50;
	--rdm-accent: #3498db;
	--rdm-text: #333;
	--rdm-text-light: #666;
	--rdm-border: #e0e0e0;
	--rdm-bg-light: #f8f9fa;
	--rdm-radius: 8px;
	--rdm-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	--rdm-transition: 0.3s ease;
}

/* ─── Rooms Listing Section ─── */
.rdm-rooms-section {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px;
}

.rdm-rooms-heading {
	font-size: 2rem;
	font-weight: 700;
	color: var(--rdm-primary);
	text-align: center;
	margin: 0 0 40px;
}

/* ─── Grid Layout ─── */
.rdm-rooms-grid {
	display: grid;
	gap: 30px;
}

.rdm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.rdm-cols-3 { grid-template-columns: repeat(3, 1fr); }
.rdm-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
	.rdm-cols-3,
	.rdm-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
	.rdm-rooms-grid { grid-template-columns: 1fr; }
}

/* ─── Room Card ─── */
.rdm-room-card {
	background: #fff;
	border: 1px solid var(--rdm-border);
	border-radius: var(--rdm-radius);
	overflow: hidden;
	box-shadow: var(--rdm-shadow);
	transition: box-shadow var(--rdm-transition), transform var(--rdm-transition);
	display: flex;
	flex-direction: column;
	height: 100%;
}

.rdm-room-card:hover {
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

/* Card image */
.rdm-card-image {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--rdm-bg-light);
}

.rdm-card-image > img,
.rdm-card-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rdm-card-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #ccc;
	font-size: 48px;
}

/* Card slider */
.rdm-card-slider {
	position: relative;
	width: 100%;
	height: 100%;
}

.rdm-card-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.4s ease;
}

.rdm-card-slide.rdm-active {
	opacity: 1;
	position: relative;
}

.rdm-card-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: var(--rdm-primary);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.3s;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.rdm-card-slider:hover .rdm-card-arrow { opacity: 1; }
.rdm-card-prev { left: 8px; }
.rdm-card-next { right: 8px; }

.rdm-card-dots {
	position: absolute;
	bottom: 8px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 5px;
	z-index: 2;
}

.rdm-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.6);
	transition: background 0.3s;
	cursor: pointer;
}

.rdm-dot.rdm-active {
	background: #fff;
}

/* Card body */
.rdm-card-body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.rdm-room-card .rdm-card-title {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0 0 12px;
	line-height: 1.3;
}

.rdm-card-title a {
	color: var(--rdm-primary);
	text-decoration: none;
}

.rdm-card-title a:hover {
	color: var(--rdm-accent);
}

/* Card features list */
.rdm-card-features {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
}

.rdm-card-features li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	font-size: 0.9rem;
	color: var(--rdm-text);
	line-height: 1.4;
}

.rdm-icon {
	flex-shrink: 0;
	color: var(--rdm-accent);
}

/* Card price */
.rdm-card-price {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--rdm-primary);
	margin: 0 0 12px;
	line-height: 1.3;
}

/* Card link */
.rdm-card-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--rdm-accent);
	text-decoration: none;
	transition: gap var(--rdm-transition);
}

.rdm-card-link:hover {
	gap: 8px;
}

.rdm-card-link:focus-visible {
	outline: 2px solid var(--rdm-accent);
	outline-offset: 3px;
	border-radius: 3px;
}

/* Card actions row */
.rdm-card-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: auto;
	padding-top: 16px;
}

/* Book now CTA — shared across card, detail header and facts row */
.rdm-book-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 20px;
	box-sizing: border-box;
	max-width: 100%;
	border-radius: var(--rdm-radius);
	background: var(--rdm-primary);
	color: #fff;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	transition: background var(--rdm-transition);
}

.rdm-book-button:hover,
.rdm-book-button:focus {
	background: var(--rdm-accent);
	color: #fff;
}

.rdm-book-button:focus-visible {
	outline: 3px solid var(--rdm-primary);
	outline-offset: 2px;
}

/* ─── Single Room Detail ─── */
.rdm-single-room {
	max-width: 1000px;
	margin: 0 auto;
	padding: 30px 20px 60px;
}

/* Breadcrumbs */
.rdm-breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	font-size: 0.85rem;
	color: var(--rdm-text-light);
	margin-bottom: 20px;
}

.rdm-breadcrumbs a {
	color: var(--rdm-text-light);
	text-decoration: none;
}

.rdm-breadcrumbs a:hover {
	color: var(--rdm-accent);
	text-decoration: underline;
}

.rdm-breadcrumb-sep {
	color: var(--rdm-border);
}

.rdm-breadcrumb-current {
	color: var(--rdm-primary);
	font-weight: 600;
}

.rdm-detail {}

/* Gallery */
.rdm-gallery-wrap {
	margin-bottom: 30px;
}

.rdm-gallery-main {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--rdm-radius);
	background: var(--rdm-bg-light);
}

.rdm-gallery-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.5s ease;
}

.rdm-gallery-slide.rdm-active {
	opacity: 1;
}

.rdm-gallery-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rdm-gallery-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: var(--rdm-primary);
	cursor: pointer;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	transition: background 0.3s;
	padding: 0;
}

.rdm-gallery-arrow:hover {
	background: #fff;
}

.rdm-gallery-prev { left: 16px; }
.rdm-gallery-next { right: 16px; }

.rdm-gallery-counter {
	position: absolute;
	bottom: 16px;
	right: 16px;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 0.85rem;
	z-index: 2;
}

/* Gallery thumbnails */
.rdm-gallery-thumbs {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	overflow-x: auto;
	padding: 4px 0;
}

.rdm-gallery-thumb {
	flex-shrink: 0;
	width: 80px;
	height: 60px;
	border: 2px solid transparent;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.3s, border-color 0.3s;
	padding: 0;
	background: none;
}

.rdm-gallery-thumb:hover {
	opacity: 0.85;
}

.rdm-gallery-thumb.rdm-active {
	opacity: 1;
	border-color: var(--rdm-accent);
}

.rdm-gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Detail header */
.rdm-detail-header {
	margin-bottom: 24px;
}

.rdm-detail-title-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px 20px;
	margin-bottom: 10px;
}

.rdm-detail-title {
	font-size: 1.8rem;
	font-weight: 700;
	color: var(--rdm-primary);
	margin: 0;
}

.rdm-detail-price {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--rdm-primary);
	margin: 0;
	white-space: nowrap;
}

/* Detail header booking block (price stacked above CTA) */
.rdm-detail-booking {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 10px;
	max-width: 100%;
	min-width: 0;
}

.rdm-detail-intro {
	font-size: 1.05rem;
	color: var(--rdm-text-light);
	line-height: 1.6;
	margin: 0;
}

@media (max-width: 640px) {
	.rdm-detail-title-row {
		flex-direction: column;
		align-items: flex-start;
	}
	.rdm-detail-price {
		white-space: normal;
	}
	.rdm-detail-booking {
		align-items: flex-start;
	}
}

/* Quick facts */
.rdm-detail-facts {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin-bottom: 30px;
	border: 1px solid var(--rdm-border);
	border-radius: var(--rdm-radius);
	overflow: hidden;
}

.rdm-fact {
	flex: 1 1 auto;
	min-width: 0;
	padding: 16px 20px;
	border-right: 1px solid var(--rdm-border);
	text-align: center;
}

.rdm-fact:last-child {
	border-right: none;
}

.rdm-fact-label {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--rdm-text-light);
	margin-bottom: 4px;
}

.rdm-fact-value {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	color: var(--rdm-primary);
}

/* Booking column in the quick-facts row */
.rdm-fact-booking {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 0;
	flex: 0 1 auto;
}

.rdm-fact-book-button {
	max-width: 100%;
}

@media (max-width: 640px) {
	.rdm-detail-facts {
		flex-direction: column;
	}
	.rdm-fact {
		border-right: none;
		border-bottom: 1px solid var(--rdm-border);
		text-align: left;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.rdm-fact:last-child { border-bottom: none; }
	.rdm-fact-label { margin-bottom: 0; }
	.rdm-fact-booking {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
	}
}

/* Description */
.rdm-detail-description {
	margin-bottom: 30px;
}

.rdm-detail-description h2 {
	font-size: 1.3rem;
	font-weight: 600;
	color: var(--rdm-primary);
	margin: 0 0 12px;
}

/* Amenities */
.rdm-detail-amenities {
	margin-bottom: 30px;
}

.rdm-detail-amenities > h2 {
	font-size: 1.3rem;
	font-weight: 600;
	color: var(--rdm-primary);
	margin: 0 0 20px;
}

.rdm-amenities-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 24px;
}

.rdm-amenity-section {}

.rdm-amenity-heading {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--rdm-primary);
	margin: 0 0 8px;
	padding-bottom: 6px;
	border-bottom: 2px solid var(--rdm-accent);
}

.rdm-amenity-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rdm-amenity-list li {
	padding: 5px 0;
	font-size: 0.9rem;
	color: var(--rdm-text);
	position: relative;
	padding-left: 16px;
}

.rdm-amenity-list li::before {
	content: '';
	position: absolute;
	left: 0;
	top: 12px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--rdm-accent);
}

/* Back link */
.rdm-detail-back {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--rdm-border);
}

.rdm-back-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--rdm-accent);
	text-decoration: none;
	font-weight: 500;
}

.rdm-back-link:hover {
	text-decoration: underline;
}

/* ─── Archive ─── */
.rdm-archive-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px;
}

.rdm-archive-header {
	margin-bottom: 30px;
}

.rdm-archive-title {
	font-size: 2rem;
	font-weight: 700;
	color: var(--rdm-primary);
	margin: 0 0 10px;
}

.rdm-no-rooms {
	text-align: center;
	font-size: 1.1rem;
	color: var(--rdm-text-light);
	padding: 60px 20px;
}

.rdm-pagination {
	margin-top: 40px;
	text-align: center;
}
