/* Casa Gimeno – Reservas (parte pública) */
.cgr {
	--cgr-accent: #e61e4d;
	--cgr-accent-2: #d70466;
	--cgr-text: #222;
	--cgr-muted: #717171;
	--cgr-line: #dddddd;
	--cgr-soft: #f7f7f7;
	--cgr-busy: #b4232c;
	--cgr-busy-bg: #fbe1e3;
	--cgr-radius: 12px;
	color: var(--cgr-text);
	font-size: 16px;
	line-height: 1.45;
	margin: 1.5em 0;
}
.cgr *, .cgr *::before, .cgr *::after { box-sizing: border-box; }

.cgr { container-type: inline-size; }
.cgr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .cgr-layout { grid-template-columns: 1fr; } }
/* Según el ancho del contenido del tema, no de la ventana: el calendario no queda estrecho. */
@container (max-width: 820px) {
	.cgr-layout { grid-template-columns: 1fr; }
	.cgr-form { position: static; }
}

.cgr-card {
	background: #fff;
	border: 1px solid var(--cgr-line);
	border-radius: var(--cgr-radius);
	box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
	padding: 24px;
	margin-bottom: 20px;
}
.cgr-form { position: sticky; top: 24px; }
.cgr h3 { margin: 0 0 12px; font-size: 1.25em; }

/* ---------- Calendario ---------- */
.cgr-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cgr-cal-hint { font-weight: 600; text-align: center; flex: 1; }
.cgr-nav {
	width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--cgr-line);
	background: #fff; font-size: 22px; line-height: 1; cursor: pointer; color: var(--cgr-text); padding: 0;
}
.cgr-nav:hover:not(:disabled) { background: var(--cgr-soft); }
.cgr-nav:disabled { opacity: .3; cursor: default; }

.cgr-calendar { display: grid; gap: 32px; grid-template-columns: 1fr; min-height: 320px; }
.cgr-calendar[data-months="2"] { grid-template-columns: 1fr 1fr; }
.cgr-month-title { text-align: center; font-weight: 600; text-transform: capitalize; margin-bottom: 12px; }
.cgr-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.cgr-dow { text-align: center; font-size: 12px; color: var(--cgr-muted); padding-bottom: 6px; }

/* Selectores con .cgr delante para que los estilos de botón del tema no los pisen. */
.cgr .cgr-day {
	aspect-ratio: 1 / 1; width: 100%; max-height: 48px; border: 0; background: transparent; box-shadow: none;
	font: inherit; font-size: 14px; font-weight: 600; color: var(--cgr-text); opacity: 1;
	border-radius: 50%; cursor: pointer; position: relative; padding: 0; margin: 0; min-width: 0; line-height: 1;
}
.cgr .cgr-day:hover:not(:disabled) { outline: 1.5px solid var(--cgr-text); outline-offset: -1.5px; }
.cgr .cgr-day:disabled { cursor: not-allowed; opacity: 1; }
.cgr .cgr-day.cgr-past { color: #c8c8c8; font-weight: 400; background: transparent; }
/* Ocupado (reservas de la web, Airbnb, Google…): franja roja continua. */
.cgr .cgr-day.cgr-busy { background: var(--cgr-busy-bg); color: var(--cgr-busy); font-weight: 400; text-decoration: line-through; border-radius: 0; }
.cgr .cgr-day.cgr-co-only { text-decoration: none; color: var(--cgr-text); font-weight: 600; cursor: pointer; }
.cgr .cgr-today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; }
.cgr .cgr-day.cgr-in-range { background: var(--cgr-soft); border-radius: 0; }
/* Entrada y salida: círculo fijo centrado (la celda puede ser más ancha que alta). */
.cgr .cgr-day { isolation: isolate; }
.cgr .cgr-day.cgr-start, .cgr .cgr-day.cgr-end { background: transparent; color: #fff; text-decoration: none; }
.cgr .cgr-day.cgr-start::before, .cgr .cgr-day.cgr-end::before {
	content: ""; position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px;
	border-radius: 50%; background: var(--cgr-text); z-index: -1;
}

.cgr-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: 13px; color: var(--cgr-muted); align-items: center; }
.cgr-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; border: 1px solid var(--cgr-line); }
.cgr-dot-free { background: #fff; }
.cgr-dot-busy { background: var(--cgr-busy-bg); border-color: var(--cgr-busy); border-radius: 2px; }
.cgr-dot-sel { background: var(--cgr-text); border-color: var(--cgr-text); }
.cgr-link { background: none; border: 0; padding: 0; color: var(--cgr-text); text-decoration: underline; cursor: pointer; font: inherit; font-weight: 600; margin-left: auto; }
.cgr-loading { color: var(--cgr-muted); }

/* ---------- Formulario ---------- */
.cgr-price { font-size: 1.1em; margin: 0 0 16px; }
.cgr-price strong { font-size: 1.3em; }
.cgr-price-from { font-size: .85em; color: var(--cgr-muted); }
.cgr-price-unit { color: var(--cgr-muted); }
.cgr-price-note { display: block; font-size: 12px; color: var(--cgr-muted); margin-top: 2px; }
.cgr-dates { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #b0b0b0; border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.cgr-dates label { display: block; padding: 8px 12px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.cgr-dates label + label { border-left: 1px solid #b0b0b0; }
/* Especificidad alta a propósito: Salient usa ".container-wrap input[type=text]". */
.cgr .cgr-dates input:not([type=checkbox]) { display: block; height: auto; line-height: 1.4; border-radius: 0; width: 100%; border: 0; padding: 2px 0 0; font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; background: transparent; cursor: pointer; color: var(--cgr-text); box-shadow: none; }
.cgr-dates input:focus { outline: none; }

/* El tema Salient colorea "label span" con el color de acento: aquí se anula. */
.cgr label span:not(.cgr-info) { color: inherit; }

/*
 * Adultos / Niños / Habitaciones: rejilla con una fila para las tres etiquetas
 * y otra para los tres desplegables. Cada columna mide al menos lo que su
 * etiqueta (que nunca se parte en dos líneas) y el espacio sobrante se reparte.
 */
.cgr .cgr-party {
	display: grid; grid-template-columns: auto auto auto; column-gap: 10px; row-gap: 4px; align-items: center;
	grid-template-areas: "la lc lr" "sa sc sr" "hint hint hint";
}
.cgr .cgr-party .cgr-label {
	display: flex; align-items: center; gap: 5px; white-space: nowrap; margin: 0; padding: 0;
	font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--cgr-text); text-transform: none; letter-spacing: 0;
}
.cgr-l-adults { grid-area: la; } .cgr-l-children { grid-area: lc; } .cgr-l-rooms { grid-area: lr; }
.cgr-s-adults { grid-area: sa; } .cgr-s-children { grid-area: sc; } .cgr-s-rooms { grid-area: sr; }
.cgr .cgr-party select:not([multiple]) {
	display: block; width: 100%; min-width: 0; height: auto; margin: 0; padding: 10px 12px; font: inherit; font-weight: 400; line-height: 1.4;
	border: 1px solid #b0b0b0; border-radius: 8px; background-color: #fff; color: var(--cgr-text); box-shadow: none;
}
.cgr .cgr-party select:not([multiple]):focus { outline: 2px solid var(--cgr-text); outline-offset: -1px; }
/* Tarjeta muy estrecha (móviles pequeños): Adultos y Niños arriba, Habitaciones debajo. */
@container (max-width: 380px) {
	.cgr .cgr-party {
		grid-template-columns: 1fr 1fr;
		grid-template-areas: "la lc" "sa sc" "lr lr" "sr sr" "hint hint";
	}
	.cgr .cgr-party .cgr-l-rooms { margin-top: 8px; }
}

/* Icono de información con globo (ratón, teclado o toque). */
.cgr .cgr-info {
	position: relative; display: inline-flex; align-items: center; justify-content: center;
	width: 16px; height: 16px; flex: none; border-radius: 50%; border: 1.5px solid var(--cgr-muted);
	color: var(--cgr-muted); font: italic 700 11px/1 Georgia, serif; cursor: help; user-select: none;
}
.cgr .cgr-info:hover, .cgr .cgr-info:focus { color: var(--cgr-text); border-color: var(--cgr-text); outline: none; }
.cgr .cgr-info::after {
	content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
	width: max-content; max-width: 220px; padding: 8px 10px; border-radius: 8px; background: #222; color: #fff;
	font: 400 13px/1.35 system-ui, sans-serif; white-space: normal; text-align: left;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .2); opacity: 0; visibility: hidden; transition: opacity .15s; z-index: 20; pointer-events: none;
}
.cgr .cgr-info::before {
	content: ""; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
	border: 5px solid transparent; border-top-color: #222; border-bottom: 0; opacity: 0; visibility: hidden; transition: opacity .15s; z-index: 20;
}
.cgr .cgr-info:hover::after, .cgr .cgr-info:focus::after,
.cgr .cgr-info:hover::before, .cgr .cgr-info:focus::before { opacity: 1; visibility: visible; }
/* El de la última columna se abre hacia la izquierda para no salirse de la tarjeta. */
/* Los globos de los extremos se abren hacia dentro para no salirse de la tarjeta. */
.cgr .cgr-l-adults .cgr-info::after { left: -8px; transform: none; }
.cgr .cgr-l-rooms .cgr-info::after { left: auto; right: -8px; transform: none; }
@container (max-width: 380px) {
	.cgr .cgr-info::after { max-width: 170px; }
	.cgr .cgr-l-rooms .cgr-info::after { left: -8px; right: auto; }
}
.cgr .cgr-party-hint { grid-area: hint; text-align: left; margin: 2px 0 16px; }
.cgr .cgr-party-hint.cgr-err { padding: 6px 10px; border-radius: 6px; }
.cgr-field { display: block; font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.cgr-field small { font-weight: 400; color: var(--cgr-muted); }
.cgr .cgr-field input:not([type=checkbox]), .cgr .cgr-field select:not([multiple]), .cgr .cgr-field textarea:not([readonly]) {
	display: block; width: 100%; height: auto; margin: 4px 0 0; padding: 10px 12px; font: inherit; font-weight: 400; line-height: 1.4;
	border: 1px solid #b0b0b0; border-radius: 8px; background: #fff; color: var(--cgr-text); box-shadow: none;
}
.cgr .cgr-field input:not([type=checkbox]):focus, .cgr .cgr-field select:not([multiple]):focus, .cgr .cgr-field textarea:not([readonly]):focus { outline: 2px solid var(--cgr-text); outline-offset: -1px; box-shadow: none; }
/* Salient añade padding-bottom a los párrafos. */
.cgr p { padding-bottom: 0; }
.cgr-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.cgr-check { display: flex; gap: 8px; font-size: 14px; margin: 8px 0 16px; align-items: flex-start; }
.cgr-check input { margin-top: 3px; }
.cgr-rules { font-size: 14px; margin: 4px 0 8px; }
.cgr-rules summary { cursor: pointer; font-weight: 600; }
.cgr-rules div { max-height: 220px; overflow: auto; padding: 8px 0; color: var(--cgr-muted); }

.cgr-btn {
	display: inline-block; width: 100%; padding: 14px 20px; border: 0; border-radius: 8px; cursor: pointer;
	background: linear-gradient(to right, var(--cgr-accent), var(--cgr-accent-2)); color: #fff !important;
	font: inherit; font-weight: 600; text-align: center; text-decoration: none !important;
}
/* Salient fuerza con !important el padding y las esquinas de los botones de envío. */
.cgr .cgr-btn, .cgr button.cgr-btn[type=submit] { width: 100% !important; padding: 14px 20px !important; border-radius: 8px !important; line-height: 1.3; letter-spacing: 0; }
.cgr .cgr-success .cgr-btn { width: auto !important; }
.cgr-btn:disabled { opacity: .6; cursor: wait; }
.cgr-btn-secondary { background: var(--cgr-text); }
.cgr-btn-danger { background: #fff; color: #c13515 !important; border: 1px solid #c13515; }
.cgr-small { font-size: 13px; color: var(--cgr-muted); text-align: center; margin: 10px 0 0; }

.cgr-quote { margin: 4px 0 16px; }
.cgr-lines { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0; border: 0; }
.cgr-lines td { padding: 6px 0; border: 0; text-decoration: none; }
.cgr-lines td:last-child { text-align: right; white-space: nowrap; }
.cgr-lines .cgr-total td { border-top: 1px solid var(--cgr-line); padding-top: 12px; font-weight: 700; }

.cgr-msg { margin-top: 12px; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.cgr-err { background: #fff0f0; color: #a3271a; }
.cgr-ok { background: #effaf3; color: #106c38; }

.cgr-success { text-align: center; max-width: 520px; margin: 0 auto; }
.cgr-success-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; background: #effaf3; color: #106c38; font-size: 28px; line-height: 56px; }
.cgr-success .cgr-btn { width: auto; }

/* ---------- Portal ---------- */
.cgr-portal .cgr-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) { .cgr-portal .cgr-layout { grid-template-columns: 1fr; } }
.cgr-portal-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.cgr-ref { font-size: 13px; color: var(--cgr-muted); letter-spacing: .02em; }
.cgr .cgr-status-help { margin: -4px 0 16px; color: var(--cgr-muted); }
.cgr-portal-locked { max-width: 560px; margin: 0 auto; text-align: center; }
.cgr-portal-locked .cgr-btn, .cgr .cgr-portal-locked button.cgr-btn { width: auto !important; }
.cgr-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.cgr-st-pending { background: #fff4e0; color: #8a5300; }
.cgr-st-confirmed { background: #effaf3; color: #106c38; }
.cgr-st-rejected, .cgr-st-cancelled { background: #f2f2f2; color: #555; }
.cgr-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; }
.cgr-dl dt { color: var(--cgr-muted); }
.cgr-dl dd { margin: 0; font-weight: 600; }
.cgr-collapsible summary { cursor: pointer; font-weight: 600; }
.cgr-collapsible[open] summary { margin-bottom: 16px; }
.cgr-collapsible .cgr-dates input { cursor: text; }

.cgr-chat { display: flex; flex-direction: column; }
.cgr-thread { max-height: 420px; overflow-y: auto; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.cgr-bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: 15px; background: var(--cgr-soft); align-self: flex-start; }
.cgr-bubble time { display: block; font-size: 11px; color: var(--cgr-muted); margin-top: 4px; }
.cgr-from-guest { align-self: flex-end; background: #222; color: #fff; }
.cgr-from-guest time { color: #bbb; }
.cgr-from-system { align-self: center; background: transparent; color: var(--cgr-muted); font-size: 13px; text-align: center; }
