/* Aloe Farm – Widget de reservas
   Colores tomados del tema si existen (variables --af-*), con valores por defecto. */
.afr-booking {
	--afr-primary: var(--af-aloe, #2f7d4f);
	--afr-primary-dark: var(--af-aloe-dark, #1d5434);
	--afr-soft: var(--af-aloe-soft, #e4f1e6);
	--afr-accent: var(--af-gold, #d9a441);
	--afr-text: var(--af-ink, #1f2a22);
	--afr-muted: var(--af-muted, #6b7a6f);
	--afr-border: var(--af-line, #e2e6df);
	--afr-bg: var(--af-surface, #ffffff);
	--afr-radius: 18px;
	font-family: inherit;
	color: var(--afr-text);
	max-width: 760px;
	margin-inline: auto;
}
.afr-booking.afr-compact { max-width: 420px; margin: 1.5rem 0; }

.afr-form {
	background: var(--afr-bg);
	border: 1px solid var(--afr-border);
	border-radius: calc(var(--afr-radius) + 6px);
	padding: clamp(18px, 3vw, 28px);
	box-shadow: 0 24px 60px -28px rgba(22, 60, 36, .35);
	display: grid;
	gap: 16px;
}

.afr-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px; }
.afr-price-amount { font-size: 1.75rem; font-weight: 700; color: var(--afr-primary-dark); }
.afr-price-unit { color: var(--afr-muted); margin-left: 4px; }
.afr-price-note { display: block; color: var(--afr-muted); }
.afr-rules { display: flex; gap: 8px; flex-wrap: wrap; }
.afr-rules span { background: var(--afr-soft); color: var(--afr-primary-dark); border-radius: 999px; padding: 4px 12px; font-size: .82rem; font-weight: 600; }

.afr-dates { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--afr-border); border-radius: var(--afr-radius); overflow: hidden; }
.afr-date { all: unset; cursor: pointer; padding: 12px 16px; display: grid; gap: 2px; transition: background .2s; }
.afr-date + .afr-date { border-left: 1px solid var(--afr-border); }
.afr-date small { text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; font-weight: 700; color: var(--afr-muted); }
.afr-date strong { font-weight: 600; }
.afr-date.is-active { background: var(--afr-soft); box-shadow: inset 0 -3px 0 var(--afr-primary); }
.afr-date:focus-visible { outline: 3px solid var(--afr-accent); outline-offset: -3px; }

.afr-calendar { min-height: 300px; }
.afr-cal-loading, .afr-cal-error { display: grid; place-items: center; min-height: 300px; color: var(--afr-muted); text-align: center; }
.afr-cal-loading::before { content: ""; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--afr-soft); border-top-color: var(--afr-primary); animation: afr-spin 0.8s linear infinite; margin-bottom: -60px; }
@keyframes afr-spin { to { transform: rotate(360deg); } }

.afr-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.afr-cal-hint { font-size: .9rem; color: var(--afr-muted); font-weight: 600; }
.afr-nav { all: unset; cursor: pointer; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; line-height: 1; color: var(--afr-primary-dark); border: 1px solid var(--afr-border); transition: background .2s, transform .2s; }
.afr-nav:hover:not(:disabled) { background: var(--afr-soft); transform: scale(1.06); }
.afr-nav:disabled { opacity: .3; cursor: default; }

.afr-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.afr-month { animation: afr-fade .35s ease both; }
@keyframes afr-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.afr-month-title { text-align: center; font-weight: 700; margin-bottom: 8px; }
.afr-weekdays, .afr-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.afr-weekdays span { text-align: center; font-size: .72rem; text-transform: uppercase; color: var(--afr-muted); font-weight: 700; padding: 4px 0; }

.afr-day { all: unset; box-sizing: border-box; cursor: pointer; aspect-ratio: 1; display: grid; place-items: center; position: relative; font-size: .92rem; font-weight: 500; }
.afr-day span { width: 86%; height: 86%; display: grid; place-items: center; border-radius: 50%; transition: background .15s, color .15s, transform .15s; position: relative; z-index: 1; }
.afr-day:hover:not(:disabled) span { background: var(--afr-soft); transform: scale(1.06); }
.afr-day:focus-visible span { outline: 2px solid var(--afr-accent); }
.afr-day:disabled { cursor: default; }
.afr-day.is-past { color: #c4cbc5; }
.afr-day.is-booked span { color: #b3b9b4; text-decoration: line-through; }
.afr-day.is-booked.is-checkout-ok span { color: var(--afr-text); text-decoration: none; }
.afr-day.is-unreachable { color: #c4cbc5; }
.afr-day.is-min { color: var(--afr-muted); }
.afr-day.is-today span { box-shadow: inset 0 0 0 1.5px var(--afr-accent); }
.afr-day.is-in-range::before, .afr-day.is-preview::before,
.afr-day.is-start.has-end::before { content: ""; position: absolute; inset: 7% 0; background: var(--afr-soft); }
.afr-day.is-start span, .afr-day.is-end span { background: var(--afr-primary) !important; color: #fff !important; font-weight: 700; text-decoration: none; transform: none; box-shadow: 0 6px 16px -6px var(--afr-primary); }
.afr-day.is-preview span { color: var(--afr-primary-dark); }

.afr-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 10px; font-size: .8rem; color: var(--afr-muted); }
.afr-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.lg-free { border: 1.5px solid var(--afr-border); }
.lg-booked { background: #dfe3df; }
.lg-sel { background: var(--afr-primary); }
.afr-clear { all: unset; cursor: pointer; margin-left: auto; color: var(--afr-primary-dark); font-weight: 700; text-decoration: underline; }

.afr-guests { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--afr-border); border-radius: var(--afr-radius); padding: 12px 16px; }
.afr-guests small { display: block; color: var(--afr-muted); }
.afr-stepper { display: flex; align-items: center; gap: 6px; }
.afr-step { all: unset; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--afr-border); display: grid; place-items: center; font-size: 1.2rem; transition: background .2s; }
.afr-step:hover { background: var(--afr-soft); }
.afr-stepper input { width: 44px; text-align: center; border: 0; font-size: 1.05rem; font-weight: 700; background: transparent; color: inherit; -moz-appearance: textfield; }
.afr-stepper input::-webkit-inner-spin-button, .afr-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }

.afr-summary { background: linear-gradient(135deg, var(--afr-soft), #fff8ea); border-radius: var(--afr-radius); padding: 14px 18px; animation: afr-fade .3s ease both; transition: opacity .2s; }
.afr-summary.is-loading { opacity: .5; }
.afr-summary ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.afr-summary li, .afr-total { display: flex; justify-content: space-between; gap: 12px; }
.afr-summary li span:first-child { color: var(--afr-muted); }
.afr-total { border-top: 1px dashed rgba(0, 0, 0, .15); margin-top: 10px; padding-top: 10px; font-weight: 800; font-size: 1.15rem; }

.afr-message { margin: 0; background: #fff1f0; color: #a02d22; border-radius: 12px; padding: 10px 14px; font-weight: 600; }

.afr-submit {
	appearance: none; border: 0; cursor: pointer; width: 100%;
	padding: 16px 22px; border-radius: 999px; font-size: 1.05rem; font-weight: 700; color: #fff;
	background: linear-gradient(120deg, var(--afr-primary), var(--afr-primary-dark));
	box-shadow: 0 14px 30px -14px var(--afr-primary);
	transition: transform .2s, box-shadow .2s, opacity .2s;
}
.afr-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 36px -14px var(--afr-primary); }
.afr-submit:disabled { opacity: .45; cursor: not-allowed; }
.afr-submit.is-loading { opacity: .8; cursor: progress; }
.afr-footnote, .afr-times { margin: 0; text-align: center; font-size: .85rem; color: var(--afr-muted); }

.afr-admin-hint { padding: 12px; border: 2px dashed #d9a441; border-radius: 10px; }
.afr-thankyou { background: #e4f1e6; border-left: 4px solid #2f7d4f; padding: 14px 18px; border-radius: 10px; margin-bottom: 24px; }

@media (prefers-reduced-motion: reduce) {
	.afr-booking *, .afr-booking *::before { animation: none !important; transition: none !important; }
}
