/**
 * Hotel PMS — guest-facing styles.
 *
 * Written phone-first, because most guests booking a Tanzanian hotel are on a
 * handset. Colours, fonts and radii come from custom properties so a theme or
 * an Elementor global style can change the look without touching this file,
 * and everything is scoped to .hpms so nothing leaks into the theme.
 */

.hpms {
	--hpms-accent: #0f6f5c;
	--hpms-accent-contrast: #ffffff;
	--hpms-text: #1d2327;
	--hpms-muted: #5b6770;
	--hpms-line: #dfe3e6;
	--hpms-surface: #ffffff;
	--hpms-surface-alt: #f6f7f7;
	--hpms-radius: 10px;
	--hpms-gap: 16px;

	box-sizing: border-box;
	color: var(--hpms-text);
	font-size: 16px;
	line-height: 1.5;
}

.hpms *,
.hpms *::before,
.hpms *::after {
	box-sizing: inherit;
}

/*
 * Anything the script hides stays hidden.
 *
 * The `hidden` attribute is only a browser default of `display: none`, so any
 * class below that sets `display: flex` or `grid` quietly beats it — which is
 * how an empty running-total bar once sat at the bottom of a real hotel's
 * page with nothing in it. `!important` is deliberate here: it has to survive
 * a theme or page builder styling our elements too.
 */
.hpms [hidden],
.hpms-basket[hidden],
.hpms-currencies[hidden] {
	display: none !important;
}

/* ---- form controls ---- */

.hpms-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.hpms-field label {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--hpms-muted);
}

.hpms-field input,
.hpms-field select,
.hpms-field textarea {
	width: 100%;
	padding: 12px;
	border: 1px solid var(--hpms-line);
	border-radius: var(--hpms-radius);
	background: var(--hpms-surface);
	color: inherit;
	/* 16px stops iOS zooming the page when a field is focused. */
	font: inherit;
	font-size: 16px;
}

.hpms-field input:focus,
.hpms-field select:focus,
.hpms-field textarea:focus {
	outline: 2px solid var(--hpms-accent);
	outline-offset: 1px;
}

.hpms-hint {
	font-size: 0.8rem;
	color: var(--hpms-muted);
}

.hpms-hint--center {
	text-align: center;
	display: block;
}

/* What happens to the guest's details, read before they press Confirm.
   Small but not hidden: it is a promise, not a disclaimer. */
.hpms-privacy {
	font-size: 0.8rem;
	line-height: 1.5;
	color: var(--hpms-muted);
	margin: 14px 0 10px;
}

.hpms-privacy a {
	color: inherit;
	text-decoration: underline;
}

.hpms-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* 44px tall: the smallest comfortable tap target on a phone. */
	min-height: 44px;
	padding: 12px 20px;
	border: 1px solid transparent;
	border-radius: var(--hpms-radius);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.hpms-button--primary {
	background: var(--hpms-accent);
	color: var(--hpms-accent-contrast);
}

.hpms-button--primary:hover,
.hpms-button--primary:focus {
	filter: brightness(0.93);
	color: var(--hpms-accent-contrast);
}

.hpms-button--secondary {
	background: var(--hpms-surface);
	border-color: var(--hpms-line);
	color: var(--hpms-text);
}

.hpms-button--wide {
	width: 100%;
}

.hpms-button[disabled] {
	opacity: 0.6;
	cursor: progress;
}

/* ---- search ---- */

.hpms-search {
	/* Flex, not a fixed grid: the form has to fit whatever column the theme or
	   Elementor puts it in, which is often much narrower than the window. */
	display: flex;
	flex-wrap: wrap;
	gap: var(--hpms-gap);
	padding: var(--hpms-gap);
	background: var(--hpms-surface-alt);
	border: 1px solid var(--hpms-line);
	border-radius: var(--hpms-radius);
}

.hpms-search .hpms-field {
	flex: 1 1 170px;
}

.hpms-search .hpms-field--small {
	flex: 0 1 92px;
}

.hpms-search .hpms-field--residency {
	flex: 1 1 190px;
}

.hpms-search .hpms-field--action {
	flex: 1 1 160px;
	align-self: flex-end;
}

.hpms-search .hpms-field--action .hpms-button {
	width: 100%;
}

.hpms-field--action {
	justify-content: flex-end;
}

.hpms-currencies {
	display: flex;
	gap: 6px;
	margin-top: 12px;
}

.hpms-currency {
	min-height: 36px;
	padding: 6px 14px;
	border: 1px solid var(--hpms-line);
	border-radius: 999px;
	background: var(--hpms-surface);
	color: var(--hpms-muted);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
}

.hpms-currency.is-active {
	background: var(--hpms-accent);
	border-color: var(--hpms-accent);
	color: var(--hpms-accent-contrast);
}

.hpms-stay-summary {
	margin: 12px 0 0;
	font-weight: 600;
}

.hpms-message {
	margin: 12px 0;
	padding: 12px 14px;
	border-radius: var(--hpms-radius);
	background: var(--hpms-surface-alt);
	border-left: 4px solid var(--hpms-muted);
}

.hpms-message--error {
	background: #fcf0f1;
	border-left-color: #d63638;
}

.hpms-message--warn {
	background: #fcf9e8;
	border-left-color: #dba617;
}

.hpms-message--info {
	border-left-color: var(--hpms-accent);
}

.hpms-front-notice {
	padding: 12px 14px;
	background: var(--hpms-surface-alt);
	border-left: 4px solid var(--hpms-muted);
	border-radius: var(--hpms-radius);
}

/* ---- offers ---- */

.hpms-results {
	display: grid;
	gap: var(--hpms-gap);
	margin-top: var(--hpms-gap);
}

.hpms-offer {
	display: flex;
	flex-wrap: wrap;
	border: 1px solid var(--hpms-line);
	border-radius: var(--hpms-radius);
	overflow: hidden;
	background: var(--hpms-surface);
}

.hpms-offer.is-selected {
	border-color: var(--hpms-accent);
	box-shadow: 0 0 0 1px var(--hpms-accent);
}

.hpms-offer__media {
	flex: 1 1 100%;
}

.hpms-offer__media img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
}

.hpms-offer__body {
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	gap: 8px;
	padding: var(--hpms-gap);
	flex: 1 1 260px;
	min-width: 0;
}

.hpms-offer__name,
.hpms-offer__plan,
.hpms-offer__description,
.hpms-offer__scarce {
	flex: 1 1 100%;
}

.hpms-offer__name {
	margin: 0;
	font-size: 1.15rem;
}

.hpms-offer__plan,
.hpms-offer__description {
	margin: 0;
	color: var(--hpms-muted);
	font-size: 0.92rem;
}

.hpms-offer__scarce {
	margin: 0;
	font-weight: 600;
	color: #b32d2e;
}

.hpms-offer__price {
	display: grid;
	gap: 4px;
	padding-top: 8px;
	border-top: 1px solid var(--hpms-line);
	flex: 1 1 100%;
}

.hpms-offer__total {
	font-size: 1.3rem;
}

.hpms-offer__per-night,
.hpms-offer__taxes {
	font-size: 0.82rem;
	color: var(--hpms-muted);
}

.hpms-offer__price .hpms-button {
	margin-top: 8px;
}

/* ---- room counter ---- */

.hpms-stepper {
	display: grid;
	gap: 4px;
	justify-items: start;
	margin-top: 10px;
}

.hpms-stepper__label {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--hpms-muted);
}

.hpms-stepper__controls {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--hpms-line);
	border-radius: var(--hpms-radius);
	overflow: hidden;
}

.hpms-stepper__button {
	width: 44px;
	min-height: 44px;
	font: inherit;
	font-size: 1.25rem;
	line-height: 1;
	color: var(--hpms-text);
	background: var(--hpms-surface);
	border: 0;
	cursor: pointer;
}

.hpms-stepper__button:disabled {
	color: var(--hpms-line);
	cursor: not-allowed;
}

.hpms-stepper__count {
	min-width: 48px;
	display: grid;
	place-items: center;
	font-weight: 700;
	border-inline: 1px solid var(--hpms-line);
}

/* ---- running total ---- */

.hpms-basket {
	position: sticky;
	bottom: 0;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-top: var(--hpms-gap);
	padding: 14px 16px;
	padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
	background: var(--hpms-text);
	color: var(--hpms-surface);
	border-radius: var(--hpms-radius);
}

.hpms-basket[data-short="true"] {
	background: #8a2c2d;
	color: #fff;
}

.hpms-basket__what { display: grid; gap: 2px; min-width: 0; font-size: 0.88rem; }
.hpms-basket__what strong { font-size: 1.2rem; }
.hpms-basket .hpms-button { min-width: 150px; }

/* ---- checkout ---- */

.hpms-checkout {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 2px solid var(--hpms-line);
}

.hpms-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--hpms-gap);
}

.hpms-field--full {
	grid-column: 1 / -1;
}

.hpms-payment {
	margin: var(--hpms-gap) 0;
	padding: var(--hpms-gap);
	border: 1px solid var(--hpms-line);
	border-radius: var(--hpms-radius);
}

.hpms-payment legend {
	font-weight: 600;
	padding: 0 6px;
}

.hpms-payment__option {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 12px;
	border-radius: var(--hpms-radius);
	cursor: pointer;
}

.hpms-payment__option:hover {
	background: var(--hpms-surface-alt);
}

.hpms-payment__text {
	display: grid;
	gap: 2px;
}

.hpms-payment__hint {
	font-size: 0.85rem;
	color: var(--hpms-muted);
}

/* The honeypot: present for robots, invisible and unreachable for people. */
.hpms-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.hpms-summary {
	margin: var(--hpms-gap) 0;
	padding: var(--hpms-gap);
	background: var(--hpms-surface-alt);
	border-radius: var(--hpms-radius);
}

.hpms-summary__list {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 6px 12px;
	margin: 0;
}

.hpms-summary__list dt {
	color: var(--hpms-muted);
}

.hpms-summary__list dd {
	margin: 0;
	text-align: right;
	font-weight: 600;
}

.hpms-summary__total {
	display: flex;
	justify-content: space-between;
	margin: 12px 0 0;
	padding-top: 12px;
	border-top: 1px solid var(--hpms-line);
	font-size: 1.2rem;
}

/* ---- confirmation ---- */

.hpms-booking-card {
	padding: var(--hpms-gap);
	border: 2px solid var(--hpms-accent);
	border-radius: var(--hpms-radius);
	background: var(--hpms-surface);
}

.hpms-booking-card__status {
	margin: 0 0 8px;
}

.hpms-booking-card__reference strong {
	font-size: 1.2rem;
	letter-spacing: 0.04em;
}

.hpms-booking-card__message {
	margin: 8px 0 16px;
}

/* ---- rooms ---- */

.hpms-rooms {
	display: grid;
	/* Self-sizing: the cards fit the space they are given rather than the
	   width of the window, so they work inside any theme or page builder. */
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
	gap: var(--hpms-gap);
}

.hpms-rooms--cols-2 {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

.hpms-rooms--cols-4 {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}

.hpms-room {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--hpms-line);
	border-radius: var(--hpms-radius);
	overflow: hidden;
	background: var(--hpms-surface);
}

.hpms-room__media img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
}

.hpms-room__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: var(--hpms-gap);
	flex: 1;
}

.hpms-room__name {
	margin: 0;
	font-size: 1.15rem;
}

.hpms-room__meta,
.hpms-room__description {
	margin: 0;
	color: var(--hpms-muted);
	font-size: 0.92rem;
}

.hpms-room__amenities {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hpms-room__amenities li {
	padding: 4px 10px;
	background: var(--hpms-surface-alt);
	border-radius: 999px;
	font-size: 0.8rem;
}

.hpms-room__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-top: auto;
	padding-top: 12px;
}

.hpms-room__price {
	margin: 0;
	display: flex;
	flex-direction: column;
}

.hpms-room__price strong {
	font-size: 1.2rem;
}

.hpms-room__price-label {
	font-size: 0.8rem;
	color: var(--hpms-muted);
}

.hpms-room-single__gallery {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
}

.hpms-room-single__gallery .hpms-room-single__photo:first-child {
	grid-column: 1 / -1;
}

.hpms-room-single__gallery img {
	width: 100%;
	height: 180px;
	object-fit: cover;
	border-radius: var(--hpms-radius);
	display: block;
}

.hpms-room-single__body {
	padding-top: var(--hpms-gap);
	display: grid;
	gap: 10px;
}

.hpms-room-single__heading {
	margin: 8px 0 0;
	font-size: 1rem;
}

/* ---- rates table ---- */

.hpms-rates {
	width: 100%;
	border-collapse: collapse;
}

.hpms-rates th,
.hpms-rates td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--hpms-line);
	text-align: left;
}

.hpms-rates td:last-child,
.hpms-rates th:last-child {
	text-align: right;
}

/* ---- wider layouts ----
   Driven by the width of the element itself, not the window, because a booking
   form in a narrow theme column must not lay itself out as if it had the whole
   screen. Browsers without container queries keep the stacked layout, which is
   correct everywhere, just taller. */

.hpms-booking,
.hpms-lookup,
.hpms-room-single {
	container-type: inline-size;
}

@container (min-width: 560px) {
	.hpms-grid {
		grid-template-columns: 1fr 1fr;
	}

	.hpms-offer__media {
		flex: 0 0 220px;
	}

	.hpms-offer__media img {
		height: 100%;
		min-height: 190px;
	}
}

@container (min-width: 720px) {
	.hpms-offer__price {
		flex: 0 0 210px;
		border-top: 0;
		border-left: 1px solid var(--hpms-line);
		padding: 0 0 0 var(--hpms-gap);
		text-align: right;
		align-self: stretch;
	}

	.hpms-offer__name,
	.hpms-offer__plan,
	.hpms-offer__description,
	.hpms-offer__scarce {
		flex: 1 1 calc(100% - 230px);
	}
}

@media (min-width: 640px) {
	.hpms-room-single__gallery img {
		height: 220px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hpms * {
		scroll-behavior: auto !important;
	}
}

/* ---- staff note ---- */

/*
 * Shown to signed-in staff when a search comes back empty, never to a guest.
 * Deliberately plain and a little ugly: it is a maintenance message sitting on
 * a public page, and it should not look like part of the hotel's design.
 */
.hpms-staff-note {
	margin-top: var(--hpms-gap);
	padding: 12px 14px;
	border: 1px dashed #b58a00;
	border-radius: var(--hpms-radius);
	background: #fffaf0;
	color: #5c4700;
	font-size: 0.9rem;
}

.hpms-staff-note strong {
	display: block;
	margin-bottom: 6px;
}

.hpms-staff-note ul {
	margin: 0;
	padding-inline-start: 18px;
}

.hpms-staff-note li + li {
	margin-top: 4px;
}
