/**
 * assets/css/rb-frontend.css
 *
 * Deliberately minimal. Font, base text color, and link color are left to
 * inherit from the theme. This file only handles layout (grid, spacing,
 * modal positioning) so the widget looks native on whatever theme it is
 * dropped into. Buttons use the theme's own button styles where present,
 * with a plain fallback below. Fine-tune further using the Custom CSS box
 * in Settings > Roomability, targeting these class names.
 */

.rb-booking-widget {
	max-width: 1100px;
	margin: 0 auto;
}

.rb-loading,
.rb-error {
	padding: 1em 0;
}

.rb-error {
	color: #c00;
}

.rb-rooms-grid {
	display: grid;
	gap: 1.5em;
}

/* Dynamic grid columns based on data attribute */
.rb-booking-widget[data-grid-columns="1"] .rb-rooms-grid {
	grid-template-columns: 1fr;
}

.rb-booking-widget[data-grid-columns="2"] .rb-rooms-grid {
	grid-template-columns: repeat(2, 1fr);
}

.rb-booking-widget[data-grid-columns="3"] .rb-rooms-grid {
	grid-template-columns: repeat(3, 1fr);
}

.rb-booking-widget[data-grid-columns="4"] .rb-rooms-grid {
	grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
	.rb-booking-widget[data-grid-columns="3"] .rb-rooms-grid,
	.rb-booking-widget[data-grid-columns="4"] .rb-rooms-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.rb-booking-widget[data-grid-columns="2"] .rb-rooms-grid {
		grid-template-columns: 1fr;
	}
}

.rb-room-card {
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #fff;
	cursor: pointer;
	transition: box-shadow 0.2s;
}

.rb-room-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rb-room-image {
	height: 160px;
	background-size: cover;
	background-position: center;
	background-color: #eee;
}

.rb-room-title {
	margin: 0.75em 1em 0.25em;
	font-size: 1.1em;
	font-weight: 600;
}

.rb-room-price {
	margin: 0 1em 1em;
	font-size: 1em;
}

.rb-room-price strong {
	font-size: 1.2em;
	color: #1a1a1a;
}

.rb-room-price span {
	font-size: 0.8em;
	opacity: 0.7;
}

/* Detail modal specific */
.rb-detail-modal {
	max-width: 600px;
}

.rb-detail-content {
	margin-bottom: 2em;
}

.rb-detail-image {
	width: 100%;
	height: 280px;
	background-size: cover;
	background-position: center;
	background-color: #eee;
	border-radius: 6px;
	margin-bottom: 1.5em;
}

.rb-detail-section {
	margin-bottom: 1.5em;
}

.rb-detail-section h3 {
	margin: 0 0 0.75em;
	font-size: 1em;
	font-weight: 600;
}

.rb-detail-summary {
	line-height: 1.6;
	opacity: 0.9;
	margin-bottom: 1em;
}

.rb-detail-amenities {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.rb-amenity-tag {
	display: inline-block;
	background: #f4f4f4;
	padding: 0.4em 0.8em;
	border-radius: 4px;
	font-size: 0.85em;
}

.rb-detail-occupancy {
	display: flex;
	gap: 1.5em;
	font-size: 0.9em;
}

.rb-detail-occupancy strong {
	display: block;
	font-weight: 600;
}

.rb-btn {
	display: inline-block;
	padding: 0.65em 1.25em;
	border-radius: 6px;
	border: 1px solid currentColor;
	background: transparent;
	cursor: pointer;
	font-size: 0.95em;
	text-align: center;
}

.rb-btn-primary {
	background: #1a1a1a;
	color: #fff;
	border-color: #1a1a1a;
}

.rb-btn-secondary {
	background: transparent;
	margin-right: 0.5em;
}

.rb-detail-buttons {
	display: flex;
	gap: 0.5em;
	margin-top: 1.5em;
}

.rb-book-btn {
	width: 100%;
}

.rb-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 1em;
}

.rb-modal {
	background: #fff;
	border-radius: 8px;
	max-width: 520px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 2em;
	position: relative;
}

.rb-modal-close {
	position: absolute;
	top: 0.75em;
	right: 0.75em;
	background: none;
	border: none;
	font-size: 1.5em;
	cursor: pointer;
	line-height: 1;
}

.rb-form-row {
	margin-bottom: 1em;
}

.rb-form-row label {
	display: block;
	margin-bottom: 0.35em;
	font-size: 0.9em;
	font-weight: 600;
}

.rb-form-row input,
.rb-form-row select,
.rb-form-row textarea {
	width: 100%;
	padding: 0.5em;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 4px;
	box-sizing: border-box;
}

.rb-form-row-split {
	display: flex;
	gap: 0.75em;
}

.rb-form-row-split > div {
	flex: 1;
}

.rb-message {
	min-height: 1.2em;
	font-size: 0.9em;
	color: #c00;
	margin-bottom: 0.75em;
}

.rb-availability-summary {
	background: #f4f4f4;
	padding: 0.75em 1em;
	border-radius: 6px;
	margin-bottom: 1em;
	font-size: 0.95em;
}
