/*
 * Hotel Booking Engine – base front-end styles.
 * Themes can restyle everything by overriding these custom properties.
 */
:root {
	--hbe-accent: #9c7a45;
	--hbe-accent-contrast: #ffffff;
	--hbe-ink: #24211e;
	--hbe-muted: #6b625a;
	--hbe-line: #e4ddd2;
	--hbe-surface: #ffffff;
	--hbe-soft: #f7f3ec;
	--hbe-radius: 6px;
	--hbe-success: #2f6b46;
	--hbe-warning: #8a5a00;
	--hbe-error: #a1302a;
	--hbe-focus: 0 0 0 3px rgba(156, 122, 69, 0.45);
}

.hbe-search, .hbe-checkout, .hbe-results, .hbe-result-panel, .hbe-contact, .hbe-rooms-grid, .hbe-confirmation-details { color: var(--hbe-ink); box-sizing: border-box; }
.hbe-search *, .hbe-checkout *, .hbe-results *, .hbe-contact * { box-sizing: border-box; }

/* Buttons */
.hbe-button { display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 44px; padding: .7em 1.4em; border: 1px solid var(--hbe-accent); border-radius: var(--hbe-radius); background: transparent; color: var(--hbe-accent); font: inherit; font-weight: 600; letter-spacing: .02em; text-decoration: none; cursor: pointer; transition: background .2s, color .2s, opacity .2s; }
.hbe-button:hover { background: var(--hbe-soft); }
.hbe-button--primary { background: var(--hbe-accent); color: var(--hbe-accent-contrast); }
.hbe-button--primary:hover { background: var(--hbe-ink); border-color: var(--hbe-ink); color: #fff; }
.hbe-button--large { width: 100%; min-height: 54px; font-size: 1.05rem; }
.hbe-button:focus-visible, .hbe-search input:focus-visible, .hbe-search select:focus-visible, .hbe-checkout input:focus-visible, .hbe-checkout textarea:focus-visible, .hbe-contact input:focus-visible, .hbe-contact textarea:focus-visible { outline: none; box-shadow: var(--hbe-focus); }
.hbe-button[aria-busy="true"] { opacity: .7; cursor: progress; }
.hbe-button[aria-busy="true"]::after { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: hbe-spin .7s linear infinite; }
@keyframes hbe-spin { to { transform: rotate(360deg); } }

/* Search form */
.hbe-search { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 18px; background: var(--hbe-surface); border-radius: var(--hbe-radius); box-shadow: 0 10px 40px rgba(20, 16, 12, .12); }
.hbe-search__title { grid-column: 1 / -1; margin: 0 0 4px; font-size: 1.25rem; }
.hbe-search__field { display: flex; flex-direction: column; gap: 4px; }
.hbe-search__field label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--hbe-muted); }
.hbe-search input, .hbe-search select { width: 100%; min-height: 46px; padding: 8px 10px; border: 1px solid var(--hbe-line); border-radius: var(--hbe-radius); background: #fff; color: var(--hbe-ink); font: inherit; }
.hbe-search__submit { grid-column: 1 / -1; display: flex; align-items: flex-end; }
.hbe-search__submit .hbe-button { width: 100%; min-height: 46px; }
.hbe-search__error { grid-column: 1 / -1; margin: 0; color: var(--hbe-error); font-weight: 600; }
.hbe-search--stacked { grid-template-columns: repeat(2, minmax(0, 1fr)); box-shadow: none; border: 1px solid var(--hbe-line); }
@media (min-width: 900px) {
	.hbe-search--hero, .hbe-search--inline { grid-template-columns: 1.3fr 1.3fr .8fr .8fr .8fr 1.4fr; align-items: end; }
	.hbe-search--hero .hbe-search__submit, .hbe-search--inline .hbe-search__submit { grid-column: auto; }
}

/* Notices */
.hbe-notice { padding: 14px 18px; margin: 16px 0; border-left: 4px solid var(--hbe-accent); background: var(--hbe-soft); border-radius: var(--hbe-radius); }
.hbe-notice ul { margin: .4em 0 0 1.2em; padding: 0; }
.hbe-notice--error { border-color: var(--hbe-error); background: #fbeeed; }
.hbe-notice--warning { border-color: var(--hbe-warning); background: #fdf5e6; }
.hbe-notice--success { border-color: var(--hbe-success); background: #edf6f0; }
.hbe-sample-flag { display: inline-block; padding: 4px 10px; background: #fff3cd; color: #7a5600; border: 1px dashed #c99a2e; border-radius: 4px; font-weight: 700; font-size: .85rem; }

/* Results */
.hbe-results { margin: 32px 0; }
.hbe-results__title { margin: 0; font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
.hbe-results__party { margin: 4px 0 20px; color: var(--hbe-muted); }
.hbe-results__list { display: grid; gap: 20px; }
.hbe-result { display: grid; grid-template-columns: 1fr; border: 1px solid var(--hbe-line); border-radius: var(--hbe-radius); overflow: hidden; background: var(--hbe-surface); }
.hbe-result__media img { display: block; width: 100%; height: 220px; object-fit: cover; }
.hbe-result__body, .hbe-result__price { padding: 18px 20px; }
.hbe-result__title { margin: 0 0 8px; font-size: 1.35rem; }
.hbe-result__title a { color: inherit; text-decoration: none; }
.hbe-result__facts, .hbe-result__amenities { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 10px; padding: 0; list-style: none; color: var(--hbe-muted); font-size: .92rem; }
.hbe-result__amenities li { padding: 2px 10px; background: var(--hbe-soft); border-radius: 20px; font-size: .82rem; }
.hbe-result__stock { margin: 0; font-weight: 600; color: var(--hbe-success); }
.hbe-result__stock--low { color: var(--hbe-warning); }
.hbe-result__price { border-top: 1px solid var(--hbe-line); display: flex; flex-direction: column; gap: 6px; }
.hbe-result__nightly, .hbe-result__incl { margin: 0; color: var(--hbe-muted); font-size: .9rem; }
.hbe-result__total { margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hbe-result__total strong { font-size: 1.5rem; }
@media (min-width: 900px) {
	.hbe-result { grid-template-columns: 300px 1fr 260px; }
	.hbe-result__media img { height: 100%; min-height: 230px; }
	.hbe-result__price { border-top: 0; border-left: 1px solid var(--hbe-line); justify-content: center; }
}
.hbe-results__unavailable { margin-top: 24px; color: var(--hbe-muted); }
.hbe-results__unavailable summary { cursor: pointer; font-weight: 600; }

/* Checkout */
.hbe-checkout { display: grid; grid-template-columns: 1fr; gap: 28px; margin: 24px 0; }
@media (min-width: 960px) { .hbe-checkout { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } .hbe-checkout__aside { position: sticky; top: 100px; } }
.hbe-fieldset { margin: 0 0 22px; padding: 20px; border: 1px solid var(--hbe-line); border-radius: var(--hbe-radius); background: var(--hbe-surface); }
.hbe-fieldset legend, .hbe-fieldset > summary { padding: 0 6px; font-weight: 700; font-size: 1.05rem; }
.hbe-fieldset > summary { cursor: pointer; padding: 0; }
.hbe-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; flex: 1; }
.hbe-field-row { display: flex; flex-wrap: wrap; gap: 0 16px; }
.hbe-field-row > .hbe-field { min-width: 220px; }
.hbe-field label { font-weight: 600; font-size: .92rem; }
.hbe-checkout input[type=text], .hbe-checkout input[type=email], .hbe-checkout input[type=tel], .hbe-checkout input[type=number], .hbe-checkout textarea, .hbe-contact input, .hbe-contact textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--hbe-line); border-radius: var(--hbe-radius); font: inherit; background: #fff; color: var(--hbe-ink); }
.hbe-checkout [aria-invalid="true"] { border-color: var(--hbe-error); }
.hbe-help { margin: 4px 0 0; color: var(--hbe-muted); font-size: .88rem; }
.hbe-field-error { color: var(--hbe-error); font-weight: 600; margin: 8px 0 0; }
.hbe-check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; }
.hbe-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--hbe-accent); }
.hbe-promo { display: flex; gap: 8px; }
.hbe-promo input { flex: 1; }
.hbe-allocation { display: grid; gap: 10px; }
.hbe-allocation__room { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 10px; background: var(--hbe-soft); border-radius: var(--hbe-radius); }
.hbe-allocation__label { font-weight: 700; min-width: 70px; }
.hbe-allocation__room label { display: flex; align-items: center; gap: 8px; }
.hbe-allocation__room input { width: 80px !important; }
.hbe-hold-note { color: var(--hbe-muted); font-size: .92rem; }
.hbe-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.hbe-card { border: 1px solid var(--hbe-line); border-radius: var(--hbe-radius); overflow: hidden; background: var(--hbe-surface); }
.hbe-card__image { display: block; width: 100%; height: 200px; object-fit: cover; }
.hbe-card__body { padding: 18px 20px; }
.hbe-card__title { margin: 0 0 10px; font-size: 1.3rem; }
.hbe-card__facts { margin: 0 0 14px; padding: 0; list-style: none; display: grid; gap: 4px; font-size: .95rem; }
.hbe-summary { margin: 0; border-top: 1px solid var(--hbe-line); }
.hbe-summary__row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hbe-line); }
.hbe-summary__row[hidden] { display: none; }
.hbe-summary dt { color: var(--hbe-muted); }
.hbe-summary dd { margin: 0; font-weight: 600; white-space: nowrap; }
.hbe-summary__row--discount dd { color: var(--hbe-success); }
.hbe-summary__row--total dt, .hbe-summary__row--total dd { color: var(--hbe-ink); font-size: 1.2rem; font-weight: 700; }
.hbe-summary__nightly { display: grid; gap: 2px; padding: 6px 0 8px; font-size: .8rem; color: var(--hbe-muted); border-bottom: 1px solid var(--hbe-line); }
.hbe-summary.is-loading { opacity: .5; transition: opacity .2s; }
.hbe-summary__status { min-height: 1.2em; margin: 6px 0 0; font-size: .85rem; color: var(--hbe-muted); }
.hbe-policy { margin: 10px 0; }
.hbe-policy summary { cursor: pointer; font-weight: 600; }

/* Confirmation */
.hbe-result-panel { margin: 24px 0; padding: 28px; border-radius: var(--hbe-radius); border: 1px solid var(--hbe-line); background: var(--hbe-soft); }
.hbe-result-panel h2 { margin-top: 0; }
.hbe-result-panel--success { background: #edf6f0; border-color: #b9d9c4; }
.hbe-result-panel--warning { background: #fdf5e6; border-color: #ecd3a0; }
.hbe-result-panel--error { background: #fbeeed; border-color: #e6bcb8; }
.hbe-reference { font-size: 1.1rem; }
.hbe-reference strong { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; font-size: 1.3rem; }
.hbe-confirmation-details { max-width: 720px; }

/* Rooms grid */
.hbe-rooms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 28px; }
.hbe-room-card { display: flex; flex-direction: column; background: var(--hbe-surface); border: 1px solid var(--hbe-line); border-radius: var(--hbe-radius); overflow: hidden; }
.hbe-room-card__media img { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; transition: transform .5s; }
.hbe-room-card:hover .hbe-room-card__media img { transform: scale(1.03); }
.hbe-room-card__media { overflow: hidden; }
.hbe-room-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.hbe-room-card__title { margin: 0 0 6px; font-size: 1.3rem; }
.hbe-room-card__title a { color: inherit; text-decoration: none; }
.hbe-room-card__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 10px; color: var(--hbe-muted); font-size: .88rem; }
.hbe-room-card__excerpt { color: var(--hbe-muted); flex: 1; }
.hbe-room-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hbe-room-card__price { margin: 0; }
.hbe-room-card__price strong { font-size: 1.25rem; color: var(--hbe-ink); }

/* Tables */
.hbe-table-wrap { overflow-x: auto; }
.hbe-table { width: 100%; border-collapse: collapse; }
.hbe-table th, .hbe-table td { padding: 10px; border-bottom: 1px solid var(--hbe-line); text-align: left; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) { .hbe-room-card__media img, .hbe-button { transition: none; } .hbe-button[aria-busy="true"]::after { animation: none; } }
