/**
 * Casa Bénin — front-end design system.
 * Brand tokens (--cb-primary / --cb-secondary / --cb-accent) are injected
 * inline from plugin options; fallbacks are declared here.
 */

:root {
	--cb-primary: #FF6B35;
	--cb-secondary: #1A1A2E;
	--cb-accent: #FFD700;

	--cb-ink: #1A1A2E;
	--cb-muted: #6b7280;
	--cb-line: #e5e7eb;
	--cb-bg: #ffffff;
	--cb-bg-soft: #f8f7f5;

	--cb-radius: 14px;
	--cb-radius-sm: 10px;
	--cb-shadow: 0 10px 30px rgba(26, 26, 46, 0.08);
	--cb-shadow-sm: 0 2px 8px rgba(26, 26, 46, 0.06);

	--cb-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cb-card,
.cb-form,
.cb-partner-register,
.cb-alert,
.cb-btn,
.cb-input,
.cb-label,
.cb-h2 {
	font-family: var(--cb-font);
	box-sizing: border-box;
}

/* Layout ------------------------------------------------------------------ */
.cb-card {
	background: var(--cb-bg);
	border: 1px solid var(--cb-line);
	border-radius: var(--cb-radius);
	box-shadow: var(--cb-shadow);
	padding: 32px;
	max-width: 780px;
	margin: 24px auto;
}

.cb-partner-register__head {
	margin-bottom: 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--cb-line);
}

.cb-h2 {
	font-size: 26px;
	font-weight: 800;
	color: var(--cb-secondary);
	margin: 0 0 6px;
	letter-spacing: -0.02em;
}

.cb-muted { color: var(--cb-muted); margin: 0; }
.cb-hint { color: var(--cb-muted); font-size: 13px; margin: 4px 0 12px; }

.cb-grid { display: grid; gap: 16px; }
.cb-grid--2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .cb-grid--2 { grid-template-columns: 1fr; } }

/* Fields ------------------------------------------------------------------ */
.cb-field { margin-bottom: 18px; display: flex; flex-direction: column; }
.cb-label {
	font-weight: 600;
	font-size: 14px;
	color: var(--cb-secondary);
	margin-bottom: 7px;
}
.cb-label--sm { font-weight: 500; font-size: 13px; }
.cb-req { color: var(--cb-primary); }

.cb-input {
	width: 100%;
	padding: 12px 14px;
	border: 1.5px solid var(--cb-line);
	border-radius: var(--cb-radius-sm);
	font-size: 15px;
	color: var(--cb-ink);
	background: #fff;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.cb-input:focus {
	outline: none;
	border-color: var(--cb-primary);
	box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}
.cb-file .cb-input { padding: 9px 12px; background: var(--cb-bg-soft); }

/* Segmented control (partner type) ---------------------------------------- */
.cb-segmented { display: flex; gap: 10px; flex-wrap: wrap; }
.cb-segmented__item {
	flex: 1 1 160px;
	position: relative;
	border: 1.5px solid var(--cb-line);
	border-radius: var(--cb-radius-sm);
	padding: 14px 16px;
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	color: var(--cb-secondary);
	background: #fff;
	transition: all .15s ease;
	text-align: center;
}
.cb-segmented__item input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.cb-segmented__item:has(input:checked) {
	border-color: var(--cb-primary);
	background: rgba(255, 107, 53, 0.06);
	box-shadow: inset 0 0 0 1px var(--cb-primary);
}

/* Checkbox ---------------------------------------------------------------- */
.cb-check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 14px;
	color: var(--cb-muted);
	margin: 8px 0 22px;
}
.cb-check input { margin-top: 3px; }

/* Buttons ----------------------------------------------------------------- */
.cb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	border-radius: var(--cb-radius-sm);
	font-weight: 700;
	font-size: 15px;
	cursor: pointer;
	padding: 12px 22px;
	transition: transform .06s ease, filter .15s ease;
	text-decoration: none;
}
.cb-btn:active { transform: translateY(1px); }
.cb-btn--primary { background: var(--cb-primary); color: #fff; }
.cb-btn--primary:hover { filter: brightness(1.05); color: #fff; }
.cb-btn--lg { width: 100%; padding: 15px 22px; font-size: 16px; }

/* Alerts ------------------------------------------------------------------ */
.cb-alert {
	border-radius: var(--cb-radius-sm);
	padding: 16px 18px;
	margin: 16px auto;
	max-width: 780px;
	font-size: 15px;
	font-family: var(--cb-font);
}
.cb-alert--success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.cb-alert--error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Language switcher ------------------------------------------------------- */
.cb-lang-switcher { display: inline-flex; gap: 4px; }
.cb-lang {
	padding: 4px 10px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 13px;
	color: var(--cb-muted);
	text-decoration: none;
	border: 1px solid transparent;
}
.cb-lang--active { color: #fff; background: var(--cb-secondary); }

/* Verified badge ---------------------------------------------------------- */
.cb-badge-verified {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255, 215, 0, 0.16);
	color: #8a6d00;
	border: 1px solid var(--cb-accent);
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
}

/* ===================================================================== */
/* Phase 3 — Search, results, map, detail                                */
/* ===================================================================== */

/* Search form */
.cb-search {
	background: var(--cb-secondary);
	padding: 18px;
	border-radius: 16px;
	box-shadow: 0 12px 30px rgba(26, 26, 46, 0.18);
}
.cb-search__row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: flex-end;
}
.cb-search__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 150px;
}
.cb-search__field--small { flex: 0 1 110px; }
.cb-search__field > span {
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .02em;
}
.cb-search__field input,
.cb-search__field select {
	border: 1px solid transparent;
	border-radius: 10px;
	padding: 11px 12px;
	font: inherit;
	background: #fff;
	color: var(--cb-secondary);
}
.cb-search__submit { flex: 0 0 auto; }

/* Buttons (shared) */
.cb-btn {
	display: inline-block;
	border: none;
	border-radius: 10px;
	padding: 12px 20px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	transition: transform .05s ease, opacity .15s ease;
}
.cb-btn:active { transform: translateY(1px); }
.cb-btn--primary { background: var(--cb-primary); color: #fff; }
.cb-btn--primary[disabled] { opacity: .55; cursor: not-allowed; }
.cb-btn--block { display: block; width: 100%; text-align: center; }

/* Results layout */
.cb-results {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 24px;
	align-items: start;
}
.cb-results__filters {
	position: sticky;
	top: 20px;
	background: #fff;
	border: 1px solid #ececf1;
	border-radius: 14px;
	padding: 16px;
}
.cb-results__filters h2 { margin: 0 0 12px; font-size: 16px; }
.cb-filter { display: block; margin-bottom: 14px; }
.cb-filter > span,
.cb-filter legend { font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px; }
.cb-filter select,
.cb-filter input { width: 100%; padding: 8px 10px; border: 1px solid #dcdce3; border-radius: 8px; font: inherit; }
.cb-filter__range { display: flex; gap: 8px; }
.cb-filter--amenities { border: none; padding: 0; margin: 0 0 14px; }
.cb-check { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 4px 0; font-weight: 400; }
.cb-check input { width: auto; }

.cb-results__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	flex-wrap: wrap;
	gap: 10px;
}
.cb-results__count { margin: 0; font-weight: 600; }
.cb-results__toggle { display: inline-flex; border: 1px solid #dcdce3; border-radius: 999px; overflow: hidden; }
.cb-toggle { border: none; background: #fff; padding: 8px 18px; cursor: pointer; font: inherit; font-weight: 600; color: #555; }
.cb-toggle.is-active { background: var(--cb-primary); color: #fff; }

.cb-results__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 20px;
}
/* [hidden] must win over the explicit display above when toggling views. */
.cb-results [data-view][hidden] { display: none !important; }
.cb-empty { grid-column: 1 / -1; color: #777; }

/* Card */
.cb-card {
	background: #fff;
	border: 1px solid #ececf1;
	border-radius: 14px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .15s ease, transform .15s ease;
}
.cb-card:hover { box-shadow: 0 12px 26px rgba(26,26,46,.12); transform: translateY(-2px); }
.cb-card__media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	background: linear-gradient(135deg, #ffe9df, #fff6e5);
	overflow: hidden;
}
.cb-card__media img { width: 100%; height: 100%; object-fit: cover; }
.cb-card__placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 44px; }
.cb-card__badge {
	position: absolute; top: 10px; left: 10px;
	background: rgba(26,26,46,.85); color: #fff;
	font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.cb-card__body { padding: 12px 14px 16px; }
.cb-card__title { margin: 0 0 4px; font-size: 16px; line-height: 1.3; }
.cb-card__title a { color: var(--cb-secondary); text-decoration: none; }
.cb-card__loc { margin: 0 0 8px; color: #777; font-size: 13px; }
.cb-card__price { margin: 0; font-size: 14px; }
.cb-card__price span { color: #888; font-size: 12px; }

/* Map */
.cb-map { width: 100%; height: 420px; border-radius: 14px; overflow: hidden; z-index: 0; }
.cb-map-picker { width: 100%; height: 260px; border-radius: 10px; overflow: hidden; margin-top: 8px; z-index: 0; }
.cb-coords { display: flex; gap: 12px; flex-wrap: wrap; }
.cb-pin__dot {
	display: block; width: 20px; height: 20px;
	background: var(--cb-primary);
	border: 3px solid #fff;
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	box-shadow: 0 2px 6px rgba(0,0,0,.35);
}

/* Detail page */
.cb-detail { max-width: 1040px; margin: 0 auto; }
.cb-detail__hero { position: relative; border-radius: 18px; overflow: hidden; margin-bottom: 24px; aspect-ratio: 16/7; background: linear-gradient(135deg, #ffe9df, #fff6e5); }
.cb-detail__hero img { width: 100%; height: 100%; object-fit: cover; }
.cb-detail__hero-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 80px; }
.cb-detail__badge { position: absolute; top: 16px; left: 16px; background: rgba(26,26,46,.85); color: #fff; font-weight: 700; padding: 6px 14px; border-radius: 999px; font-size: 13px; }
.cb-detail__grid { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.cb-detail__desc { font-size: 16px; line-height: 1.7; margin-bottom: 20px; }
.cb-detail__loc { color: #666; font-weight: 600; }
.cb-detail__h2 { font-size: 19px; margin: 24px 0 12px; }
.cb-detail__facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.cb-detail__facts li { font-weight: 600; }
.cb-detail__amenities { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 6px 14px; }
.cb-detail__amenities li { color: #2b7a3b; font-weight: 500; }
.cb-detail__rooms { width: 100%; border-collapse: collapse; }
.cb-detail__rooms td { padding: 10px 6px; border-bottom: 1px solid #eee; }
.cb-detail__policy { background: #fff7f2; border-left: 3px solid var(--cb-primary); padding: 10px 14px; border-radius: 6px; }
.cb-detail__maplink { margin-top: 8px; }

/* Booking box */
.cb-detail__booking { position: sticky; top: 20px; }
.cb-booking-box { background: #fff; border: 1px solid #ececf1; border-radius: 16px; padding: 20px; box-shadow: 0 8px 24px rgba(26,26,46,.08); }
.cb-booking-box__price { font-size: 22px; margin: 0 0 4px; }
.cb-booking-box__price span { font-size: 14px; color: #888; font-weight: 400; }
.cb-booking-box__free { color: #2b7a3b; font-weight: 600; font-size: 14px; margin: 4px 0 14px; }
.cb-booking-box__soon { font-size: 12px; color: #999; text-align: center; margin: 8px 0 0; }

@media (max-width: 900px) {
	.cb-results { grid-template-columns: 1fr; }
	.cb-results__filters { position: static; }
	.cb-detail__grid { grid-template-columns: 1fr; }
	.cb-detail__booking { position: static; }
}
