/**
 * Styles for the [roomcloud_rooms] carousel shortcode.
 *
 * Carousel: CSS scroll-snap with prev/next arrow navigation.
 * Popup: port of hotel-room-selector/assets/popup.css with
 *        .wpr-rooms-* selectors instead of .hrs-*.
 *
 * @package wp_roomcloud
 * @since   1.5.0
 */

/* ==========================================================================
   1. CAROUSEL WRAPPER
   ========================================================================== */

.wpr-rooms-carousel-wrapper {
	position: relative;
}

/* ==========================================================================
   2. CAROUSEL TRACK
   ========================================================================== */

.wpr-rooms-carousel {
	display: flex;
	gap: 1.25rem;
	overflow-x: auto;
	scroll-behavior: smooth;
	padding: 0 0 1rem;
	/* Drag-to-scroll cursor (desktop) */
	cursor: grab;
	/* Hide scrollbar visually while keeping scroll functionality */
	scrollbar-width: none;        /* Firefox */
	-ms-overflow-style: none;     /* IE/Edge */
	overscroll-behavior-x: contain;
}

/* Active drag state — set by JS during mousedown/mousemove */
.wpr-rooms-carousel.is-dragging {
	cursor: grabbing;
	user-select: none;
	/* Disable smooth-scroll while dragging so scrollLeft updates are immediate */
	scroll-behavior: auto;
}

.wpr-rooms-carousel::-webkit-scrollbar {
	display: none; /* Chrome/Safari */
}

/* ==========================================================================
   3. ROOM CARD
   ========================================================================== */

.wpr-rooms-card {
	flex-shrink: 0;
	width: 340px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

/* --- Card image --- */

.wpr-rooms-card__image-wrapper {
	position: relative;
	height: 220px;
	overflow: hidden;
	cursor: pointer;
	background: #e9ecef;
}

.wpr-rooms-card__image-wrapper:focus {
	outline: 2px solid #0D3C60;
	outline-offset: -2px;
}

.wpr-rooms-card__image-wrapper img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.wpr-rooms-card__image-wrapper:hover img,
.wpr-rooms-card__image-wrapper:focus img {
	transform: scale(1.04);
}

/* Photo count badge */
.wpr-rooms-card__image-count {
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 20px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	pointer-events: none;
}

/* --- Card body --- */

.wpr-rooms-card__body {
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 0.75rem;
}

.wpr-rooms-card__name {
	font-size: 1.2rem;
	font-weight: 700;
	color: #0D3C60;
	margin: 0;
}

.wpr-rooms-card__description {
	font-size: 0.875rem;
	color: #555;
	line-height: 1.5;
	margin: 0;
}

/* --- Specs list --- */

.wpr-rooms-card__specs {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	border-top: 1px solid #f0f0f0;
	padding-top: 0.75rem;
}

.wpr-rooms-card__spec {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.8rem;
	color: #444;
	font-weight: 500;
}

.wpr-rooms-icon {
	font-style: normal;
	font-size: 0.9rem;
}

/* --- Amenities list --- */

.wpr-rooms-card__amenities {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.75rem;
}

.wpr-rooms-card__amenity {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.75rem;
	color: #666;
}

/* Service icon image (Media Library) — compact amenity list */
.wpr-rooms-amenity-icon.wpr-service-icon-img,
.wpr-service-icon-img {
	width: 16px;
	height: 16px;
	object-fit: contain;
	vertical-align: middle;
	flex-shrink: 0;
	filter: brightness(0) invert(0.4);
}

/* --- CTA button — pushed to card bottom --- */

.wpr-rooms-card__cta {
	display: block;
	width: 100%;
	margin-top: auto;
	padding: 13px 16px;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background-color: #0D3C60;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s;
}

.wpr-rooms-card__cta:hover,
.wpr-rooms-card__cta:focus {
	background-color: #0a2f4d;
	outline: 2px solid #0D3C60;
	outline-offset: 2px;
}

/* ==========================================================================
   4. NAV ARROWS (desktop only)
   ========================================================================== */

/*
 * Selectors are nested under .wpr-rooms-carousel-wrapper to reach specificity
 * [0,2,0], which overrides Elementor's .elementor-widget-container button [0,1,1]
 * that would otherwise force display:flex and an unwanted blue background.
 */
.wpr-rooms-carousel-wrapper .wpr-rooms-nav {
	position: absolute;
	top: 50%; /* vertically centred on the full carousel wrapper */
	transform: translateY(-50%);
	z-index: 2;
	width: 40px;
	height: 40px;
	background: #F3F3F3;
	border: 1px solid #ddd;
	border-radius: 50%;
	font-size: 1.5rem;
	line-height: 1;
	color: #444;
	cursor: pointer;
	display: none; /* hidden until JS detects overflow */
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	transition: background-color 0.15s, box-shadow 0.15s;
}

/* Shown only when carousel actually overflows */
.wpr-rooms-carousel-wrapper.wpr-rooms-has-overflow .wpr-rooms-nav {
	display: flex;
}

.wpr-rooms-carousel-wrapper .wpr-rooms-nav:hover,
.wpr-rooms-carousel-wrapper .wpr-rooms-nav:focus {
	background: #E0E0E0;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	outline: 2px solid #9E9E9E;
	outline-offset: 2px;
}

.wpr-rooms-carousel-wrapper .wpr-rooms-nav--prev {
	left: 8px;
}

.wpr-rooms-carousel-wrapper .wpr-rooms-nav--next {
	right: 8px;
}

/* ==========================================================================
   5. BOOKING WIZARD WRAPPER
   The [roomcloud_form] wizard is rendered inside this hidden container.
   The pill bar and other non-modal elements are visually hidden, while
   the wizard's fixed-position step-modals break out and render at
   viewport level — identical to a standalone [roomcloud_form].
   ========================================================================== */

/*
 * Off-screen container: pill bar is invisible, but position:fixed step-modals
 * rendered inside break out to their correct viewport positions.
 * Intentionally avoids clip/overflow:hidden which can interfere with
 * AirDatepicker initialisation on browsers that compute element dimensions
 * before rendering inline calendars.
 */
#wpr-rooms-booking-wizard {
	position: absolute;
	left: -99999px;
	top: -99999px;
	width: 0;
	height: 0;
	pointer-events: none;
	overflow: visible;
}

/* Re-enable pointer events on the fixed-position wizard modals. */
#wpr-rooms-booking-wizard .wpr-step-modal,
#wpr-rooms-booking-wizard .wpr-modal-overlay {
	pointer-events: auto;
}

/* ==========================================================================
   6. RESPONSIVE
   ========================================================================== */

/* Mobile: hide nav arrows, let natural scroll-snap handle swiping */
@media (max-width: 767px) {
	.wpr-rooms-carousel-wrapper.wpr-rooms-has-overflow .wpr-rooms-nav {
		display: none;
	}

	/*
	 * Narrow card width so the next card always peeks (~25-30 px),
	 * hinting to the user that more cards are available by swiping.
	 * 75 vw gives ~270-300 px on common phones.
	 */
	.wpr-rooms-card {
		width: 75vw;
		max-width: 300px;
	}
}


