/* House del Mar – widget de contacto y formulario de reservas */
:root {
	--hdm-primary: #1f6f6b;
	--hdm-dark: #0f1a26;
	--hdm-wa: #25d366;
	--hdm-wa-dark: #128c4b;
	--hdm-airbnb: #ff385c;
	--hdm-bg: #ffffff;
	--hdm-soft: #f3f6f6;
	--hdm-line: #e3e8ea;
	--hdm-text: #1b2530;
	--hdm-muted: #5d6b78;
	--hdm-radius: 18px;
	--hdm-shadow: 0 18px 50px rgba(15, 26, 38, .22), 0 4px 12px rgba(15, 26, 38, .08);
	--hdm-font: inherit;
}

.hdm, .hdm *, .hdm-form, .hdm-form *, .hdm-btn { box-sizing: border-box; }

.hdm {
	position: fixed;
	bottom: 20px;
	z-index: 99990;
	font-family: var(--hdm-font);
	color: var(--hdm-text);
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
}
.hdm--right { right: 20px; }
.hdm--left { left: 20px; }
.hdm [hidden] { display: none !important; }
.hdm svg { width: 100%; height: 100%; display: block; }
.hdm button { font: inherit; cursor: pointer; }

/* Botón flotante */
.hdm-launcher {
	position: relative;
	width: 62px; height: 62px;
	border: 0; border-radius: 50%;
	background: var(--hdm-wa);
	color: #fff;
	box-shadow: 0 8px 24px rgba(37, 211, 102, .45), 0 2px 6px rgba(0,0,0,.15);
	display: grid; place-items: center;
	transition: transform .2s ease, background .2s ease;
	margin-left: auto;
	padding: 0;
}
.hdm--left .hdm-launcher { margin-left: 0; }
.hdm-launcher:hover { transform: scale(1.06); }
.hdm-launcher:focus-visible { outline: 3px solid var(--hdm-dark); outline-offset: 3px; }
.hdm-launcher__icon { position: absolute; width: 32px; height: 32px; transition: opacity .2s, transform .25s; }
.hdm-launcher__icon--close { width: 24px; height: 24px; opacity: 0; transform: rotate(-90deg); }
.hdm.is-open .hdm-launcher { background: var(--hdm-dark); box-shadow: 0 8px 24px rgba(15,26,38,.35); }
.hdm.is-open .hdm-launcher__icon--open { opacity: 0; transform: rotate(90deg); }
.hdm.is-open .hdm-launcher__icon--close { opacity: 1; transform: none; }
.hdm-launcher__badge {
	position: absolute; top: -2px; right: -2px;
	min-width: 22px; height: 22px; border-radius: 11px;
	background: #e53935; color: #fff; font-size: 12px; font-weight: 700;
	display: grid; place-items: center; border: 2px solid #fff;
}
.hdm-launcher::after {
	content: ""; position: absolute; inset: 0; border-radius: 50%;
	box-shadow: 0 0 0 0 rgba(37, 211, 102, .55);
	animation: hdm-pulse 2.4s infinite;
}
.hdm.is-open .hdm-launcher::after, .hdm.is-seen .hdm-launcher::after { animation: none; }
@keyframes hdm-pulse {
	0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); }
	70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
	100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Burbuja de saludo */
.hdm-teaser {
	position: absolute; bottom: 76px;
	width: 290px; max-width: calc(100vw - 40px);
	background: var(--hdm-bg);
	border-radius: 16px;
	box-shadow: var(--hdm-shadow);
	border-top: 4px solid var(--hdm-primary);
	animation: hdm-in .35s ease both;
}
.hdm--right .hdm-teaser { right: 0; }
.hdm--left .hdm-teaser { left: 0; }
.hdm-teaser::after {
	content: ""; position: absolute; bottom: -7px; width: 14px; height: 14px;
	background: var(--hdm-bg); transform: rotate(45deg);
}
.hdm--right .hdm-teaser::after { right: 24px; }
.hdm--left .hdm-teaser::after { left: 24px; }
.hdm-teaser__body {
	display: block; width: 100%; text-align: left;
	background: none; border: 0; padding: 14px 40px 16px 16px; color: var(--hdm-text);
}
.hdm-teaser__body strong { display: block; font-weight: 700; line-height: 1.3; font-size: 15px; color: var(--hdm-dark); margin-bottom: 4px; }
.hdm-teaser__body span { display: block; line-height: 1.45; font-size: 14px; color: var(--hdm-muted); }
.hdm-teaser__close {
	position: absolute; top: 8px; right: 8px; z-index: 1;
	width: 26px; height: 26px; padding: 6px;
	border: 0; border-radius: 50%; background: var(--hdm-soft); color: var(--hdm-muted);
}
.hdm-teaser__close:hover { background: var(--hdm-line); color: var(--hdm-text); }

/* Panel */
.hdm-panel {
	position: absolute; bottom: 76px;
	width: 370px; max-width: calc(100vw - 32px);
	max-height: min(640px, calc(100vh - 110px));
	background: var(--hdm-bg);
	border-radius: var(--hdm-radius);
	box-shadow: var(--hdm-shadow);
	display: flex; flex-direction: column;
	overflow: hidden;
	animation: hdm-in .28s ease both;
}
.hdm--right .hdm-panel { right: 0; }
.hdm--left .hdm-panel { left: 0; }
@keyframes hdm-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.hdm-panel__head {
	display: flex; align-items: center; gap: 12px;
	padding: 16px 14px 16px 18px;
	background: linear-gradient(135deg, var(--hdm-dark), var(--hdm-primary));
	color: #fff;
	flex-shrink: 0;
}
.hdm-panel__logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; object-fit: contain; padding: 3px; flex-shrink: 0; }
.hdm-panel__who { flex: 1; min-width: 0; }
.hdm-panel__who strong { display: block; font-weight: 700; font-size: 16px; }
.hdm-panel__who span { font-size: 12.5px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.hdm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hdm-wa); display: inline-block; box-shadow: 0 0 0 3px rgba(37,211,102,.25); }
.hdm-icon-btn {
	width: 34px; height: 34px; padding: 8px; border: 0; border-radius: 50%;
	background: rgba(255,255,255,.12); color: #fff; flex-shrink: 0;
}
.hdm-icon-btn:hover { background: rgba(255,255,255,.22); }
.hdm-panel__back { order: -1; margin-right: -4px; }

.hdm-panel__body { padding: 16px; overflow-y: auto; background: var(--hdm-soft); }

.hdm-bubble {
	background: var(--hdm-bg); border-radius: 4px 16px 16px 16px;
	padding: 12px 14px; margin-bottom: 14px;
	box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.hdm-bubble strong { display: block; font-weight: 700; margin-bottom: 4px; color: var(--hdm-dark); }
.hdm-bubble p { margin: 0; font-size: 14px; color: var(--hdm-muted); }

.hdm-label { margin: 16px 2px 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hdm-muted); }
.hdm-label:first-of-type { margin-top: 4px; }

.hdm-action {
	display: flex; align-items: center; gap: 12px; width: 100%;
	padding: 12px 14px; margin-bottom: 8px;
	background: var(--hdm-bg); border: 1px solid var(--hdm-line); border-radius: 14px;
	color: var(--hdm-text); text-decoration: none !important; text-align: left;
	transition: border-color .15s, transform .15s, box-shadow .15s;
}
.hdm-action:hover { border-color: var(--hdm-primary); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.06); color: var(--hdm-text); }
.hdm-action__icon { width: 40px; height: 40px; padding: 9px; border-radius: 12px; flex-shrink: 0; color: #fff; }
.hdm-action--wa .hdm-action__icon { background: var(--hdm-wa); padding: 7px; }
.hdm-action--form .hdm-action__icon { background: var(--hdm-primary); }
.hdm-action__txt { flex: 1; min-width: 0; }
.hdm-action__txt strong { display: block; font-weight: 700; font-size: 15px; }
.hdm-action__txt small { display: block; font-size: 12.5px; color: var(--hdm-muted); }
.hdm-action__go { width: 18px; height: 18px; color: var(--hdm-muted); flex-shrink: 0; }

.hdm-villas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hdm-villa {
	display: flex; flex-direction: column; gap: 2px;
	padding: 12px; border-radius: 14px;
	background: var(--hdm-bg); border: 1px solid var(--hdm-line);
	color: var(--hdm-text); text-decoration: none !important;
	transition: border-color .15s, transform .15s;
}
.hdm-villa:hover { border-color: var(--hdm-airbnb); transform: translateY(-1px); color: var(--hdm-text); }
.hdm-villa__icon { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--hdm-airbnb); color: #fff; margin-bottom: 6px; }
.hdm-villa strong { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.hdm-villa small { font-size: 12px; color: var(--hdm-airbnb); font-weight: 600; }

/* Botones reutilizables */
.hdm-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	padding: 12px 20px; border-radius: 999px; border: 0;
	font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2;
	text-decoration: none !important; cursor: pointer;
	transition: filter .15s, transform .15s;
}
.hdm-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.hdm-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.hdm-btn--wa { background: var(--hdm-wa); color: #fff !important; }
.hdm-btn--airbnb { background: var(--hdm-airbnb); color: #fff !important; }
.hdm-btn--primary { background: var(--hdm-primary); color: #fff !important; }
.hdm-btn[disabled] { opacity: .65; cursor: wait; transform: none; }

/* Formulario */
.hdm-form { font-size: 15px; color: var(--hdm-text); }
.hdm-form--page {
	max-width: 720px; margin: 0 auto;
	background: #fff; padding: 28px; border-radius: 20px;
	box-shadow: 0 10px 40px rgba(15,26,38,.08); border: 1px solid var(--hdm-line);
}
.hdm-form__title { margin: 0 0 16px; font-weight: 700; }
.hdm-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.hdm-form--page .hdm-form__grid { grid-template-columns: repeat(3, 1fr); }
.hdm-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hdm-field--full { grid-column: 1 / -1; }
.hdm-field label { font-size: 13px; font-weight: 600; color: var(--hdm-dark); margin: 0; }
.hdm-field small { font-weight: 400; color: var(--hdm-muted); }
.hdm-form input, .hdm-form select, .hdm-form textarea {
	width: 100%; margin: 0;
	padding: 10px 12px; min-height: 44px;
	font: inherit; font-size: 15px; color: var(--hdm-text);
	background: #fff; border: 1px solid #cfd8dc; border-radius: 10px;
	box-shadow: none; transition: border-color .15s, box-shadow .15s;
}
.hdm-form textarea { min-height: 76px; resize: vertical; }
.hdm-form input:focus, .hdm-form select:focus, .hdm-form textarea:focus {
	outline: none; border-color: var(--hdm-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hdm-primary) 20%, transparent);
}
.hdm-form .is-invalid { border-color: #d63638 !important; box-shadow: 0 0 0 3px rgba(214,54,56,.15) !important; }
.hdm-form__submit { width: 100%; margin-top: 16px; border-radius: 12px; padding: 14px; }
.hdm-form__msg { margin: 10px 0 0; font-size: 14px; min-height: 1em; }
.hdm-form__msg.is-error { color: #b32d2e; }
.hdm-form__done { text-align: center; padding: 8px 0 4px; }
.hdm-form__done .hdm-btn { width: 100%; margin-top: 10px; border-radius: 12px; }
.hdm-form__ok { font-size: 15px; background: #e7f7ee; color: #115c34; border-radius: 12px; padding: 14px; margin: 0 0 4px; }
.hdm-form.is-done .hdm-form__grid, .hdm-form.is-done .hdm-form__submit, .hdm-form.is-done .hdm-form__msg { display: none; }
.hdm-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 640px) {
	.hdm-form--page { padding: 20px; }
	.hdm-form--page .hdm-form__grid, .hdm-form__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
	.hdm { bottom: 14px; }
	.hdm--right { right: 14px; }
	.hdm--left { left: 14px; }
	.hdm-launcher { width: 56px; height: 56px; }
	.hdm-panel {
		position: fixed; left: 8px; right: 8px; bottom: 80px;
		width: auto; max-width: none; max-height: calc(100vh - 96px);
	}
	.hdm-teaser { bottom: 70px; }
	.hdm-form--page .hdm-form__grid, .hdm-form__grid { grid-template-columns: 1fr; }
	.hdm-form__grid .hdm-field:nth-child(2), .hdm-form__grid .hdm-field:nth-child(3) { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
	.hdm *, .hdm-btn { animation: none !important; transition: none !important; }
}
@media print { .hdm { display: none !important; } }

/* Reservar en Airbnb */
.hdm-action--airbnb { border-color: color-mix(in srgb, var(--hdm-airbnb) 35%, var(--hdm-line)); }
.hdm-action--airbnb .hdm-action__icon { background: var(--hdm-airbnb); }
.hdm-action--airbnb:hover { border-color: var(--hdm-airbnb); }
.hdm-action--airbnb + .hdm-villas { margin-bottom: 4px; }

.hdm-book__villas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.hdm-choice { position: relative; display: block; margin: 0; cursor: pointer; }
.hdm-choice input { position: absolute; opacity: 0; pointer-events: none; }
.hdm-choice span {
	display: flex; align-items: center; gap: 10px;
	padding: 12px; border-radius: 12px; min-height: 56px;
	background: #fff; border: 1.5px solid #cfd8dc;
	font-size: 14px; line-height: 1.25; transition: border-color .15s, box-shadow .15s;
}
.hdm-choice svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--hdm-muted); }
.hdm-choice strong { font-weight: 700; color: var(--hdm-text); }
.hdm-choice input:checked + span { border-color: var(--hdm-airbnb); box-shadow: 0 0 0 3px rgba(255, 56, 92, .15); }
.hdm-choice input:checked + span svg { color: var(--hdm-airbnb); }
.hdm-choice input:focus-visible + span { outline: 2px solid var(--hdm-dark); outline-offset: 2px; }
.hdm-book__grid { grid-template-columns: 1fr 1fr; }
.hdm-form--widget .hdm-book__grid .hdm-field:nth-child(3) { grid-column: 1 / -1; }
.hdm-form--page .hdm-book__grid { grid-template-columns: repeat(3, 1fr); }
.hdm-book .hdm-form__submit { gap: 10px; }
.hdm-book__note { margin: 12px 0 0; font-size: 13px; color: var(--hdm-muted); line-height: 1.45; }
.hdm-book__note a { color: var(--hdm-wa-dark); font-weight: 600; }
.hdm-form--page .hdm-form__grid:not(.hdm-book__grid) { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) {
	.hdm-book__villas { grid-template-columns: 1fr; }
	.hdm-form--page .hdm-book__grid { grid-template-columns: 1fr 1fr; }
	.hdm-form--page .hdm-book__grid .hdm-field:nth-child(3) { grid-column: 1 / -1; }
}

/* Accesos rápidos: ubicación y redes */
.hdm-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.hdm-quick a {
	padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
	background: #fff; border: 1px solid var(--hdm-line); color: var(--hdm-dark) !important; text-decoration: none !important;
}
.hdm-quick a:hover { border-color: var(--hdm-primary); color: var(--hdm-primary) !important; }
