/* Consultorio · piezas públicas: aviso de cookies y reserva en línea.
   Usa los tokens del sitio (--turquesa, --ink, --font-display…) con respaldo propio. */

.dfvc-cookies,
.dfvr {
	--r-t: var(--turquesa, #1fb3b3);
	--r-td: #137f80;
	--r-ink: var(--ink, #2c2723);
	--r-soft: var(--ink-soft, #6b6259);
	--r-tint: var(--bg-tint, #fff8f0);
	--r-line: #ece2d6;
	--r-out: cubic-bezier(0.16, 1, 0.3, 1);
	font-family: var(--font-body, "Nunito"), system-ui, sans-serif;
	color: var(--r-ink);
}

/* ---------- Aviso de cookies ---------- */
.dfvc-cookies {
	position: fixed;
	left: 16px;
	bottom: 16px;
	z-index: 300;
	max-width: 400px;
	padding: 18px 18px 16px;
	border-radius: 22px;
	background: #fff;
	box-shadow: 0 4px 10px rgba(44, 39, 35, 0.06), 0 24px 48px -18px rgba(44, 39, 35, 0.35);
	transform: translateY(24px);
	opacity: 0;
	transition: transform 0.45s var(--r-out), opacity 0.3s ease;
}
.dfvc-cookies.is-on { transform: none; opacity: 1; }
.dfvc-cookies p { margin: 0 0 14px; font-size: 0.92rem; line-height: 1.5; color: var(--r-soft); }
.dfvc-cookies a { color: var(--r-td); font-weight: 700; }
.dfvc-cookies-btns { display: flex; gap: 8px; justify-content: flex-end; }
.dfvc-cookies button {
	min-height: 44px;
	padding: 0 18px;
	border-radius: 999px;
	border: 2px solid var(--r-ink);
	background: #fff;
	color: var(--r-ink);
	font: 700 0.95rem var(--font-display, "Baloo 2"), sans-serif;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, transform 0.15s;
}
.dfvc-cookies .dfvc-c-si { background: var(--r-ink); color: #fff; }
.dfvc-cookies button:hover { transform: translateY(-1px); }
.dfvc-cookies button:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--r-t); }
@media (max-width: 767px) {
	.dfvc-cookies { left: 12px; right: 12px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); max-width: none; }
}

/* ---------- Reserva en línea ---------- */
html.dfvr-abierto { overflow: hidden; }
.dfvr {
	width: min(640px, calc(100vw - 32px));
	max-height: min(88vh, 900px);
	padding: 0;
	border: 0;
	border-radius: 30px;
	background: #fff;
	box-shadow: 0 30px 80px -20px rgba(44, 39, 35, 0.45);
	overflow: hidden;
}
.dfvr[open] { animation: dfvrIn 0.42s var(--r-out); }
.dfvr.is-closing { animation: dfvrOut 0.18s ease forwards; }
.dfvr::backdrop { background: rgba(28, 44, 44, 0.42); backdrop-filter: blur(3px); }
@keyframes dfvrIn { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes dfvrOut { to { opacity: 0; transform: translateY(12px); } }

.dfvr-in { display: flex; flex-direction: column; max-height: inherit; }
.dfvr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 14px; border-bottom: 1px solid var(--r-line); }
.dfvr-head h2 { margin: 0; font: 800 clamp(1.35rem, 3vw, 1.7rem)/1.1 var(--font-display, "Baloo 2"), sans-serif; }
.dfvr-x { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--r-tint); color: var(--r-ink); cursor: pointer; }
.dfvr-x svg { width: 20px; height: 20px; }
.dfvr-body { overflow-y: auto; overscroll-behavior: contain; padding: 6px 24px 24px; scroll-padding-top: 10px; }
.dfvr-foot { padding: 14px 24px 18px; border-top: 1px solid var(--r-line); font-size: 0.9rem; color: var(--r-soft); }
.dfvr-foot a { color: var(--r-td); font-weight: 700; }

.dfvr-paso { padding-top: 20px; }
.dfvr-paso h3 { margin: 0 0 12px; font: 700 1.1rem/1.2 var(--font-display, "Baloo 2"), sans-serif; }
.dfvr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dfvr-row h3 { margin: 0; }
.dfvr-sub { margin: 0 0 12px; color: var(--r-soft); font-size: 0.95rem; }
.dfvr-sub a { color: var(--r-td); font-weight: 700; }
.dfvr-aviso { margin: 8px 0 0; padding: 14px 16px; border-radius: 16px; background: var(--r-tint); color: var(--r-soft); font-size: 0.95rem; grid-column: 1 / -1; }
.dfvr-aviso a { color: var(--r-td); font-weight: 700; }

/* Opciones */
.dfvr-tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.dfvr-chip,
.dfvr-dia,
.dfvr-hora {
	border: 2px solid var(--r-line);
	background: #fff;
	color: var(--r-ink);
	cursor: pointer;
	font-family: inherit;
	transition: border-color 0.2s, background-color 0.2s, transform 0.15s var(--r-out), box-shadow 0.2s;
}
.dfvr-chip:hover,
.dfvr-dia:hover:not(:disabled),
.dfvr-hora:hover { border-color: var(--r-t); }
.dfvr-chip:active,
.dfvr-dia:active:not(:disabled),
.dfvr-hora:active { transform: scale(0.97); }
.dfvr-chip:focus-visible,
.dfvr-dia:focus-visible,
.dfvr-hora:focus-visible,
.dfvr-cta:focus-visible,
.dfvr-x:focus-visible,
.dfvr-nav button:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--r-t); }
.dfvr-tipo { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; border-radius: 18px; text-align: left; }
.dfvr-tipo strong { font: 700 1rem/1.2 var(--font-display, "Baloo 2"), sans-serif; }
.dfvr-tipo small { color: var(--r-soft); }
.dfvr-tipo[aria-checked="true"],
.dfvr-dia[aria-checked="true"],
.dfvr-hora[aria-pressed="true"] { border-color: var(--r-t); background: #e8f7f7; box-shadow: inset 0 0 0 1px var(--r-t); }

.dfvr-nav { display: flex; gap: 6px; }
.dfvr-nav button { display: grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--r-ink); border-radius: 50%; background: #fff; color: var(--r-ink); cursor: pointer; }
.dfvr-nav button:disabled { opacity: 0.25; cursor: default; }
.dfvr-nav svg { width: 16px; height: 16px; }

.dfvr-dias { display: grid; grid-auto-flow: column; grid-auto-columns: 72px; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.dfvr-dia { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 10px 4px; border-radius: 18px; scroll-snap-align: start; }
.dfvr-dia strong { font: 800 1.45rem/1.1 var(--font-display, "Baloo 2"), sans-serif; font-variant-numeric: tabular-nums; }
.dfvr-dia small { font-size: 0.78rem; color: var(--r-soft); text-transform: capitalize; }
.dfvr-dia i { margin-top: 4px; font-style: normal; font-size: 0.72rem; font-weight: 700; color: var(--r-td); }
.dfvr-dia:disabled { opacity: 0.45; cursor: not-allowed; background: #faf6f1; }
.dfvr-dia:disabled i { color: var(--r-soft); }

.dfvr-grupo { margin-bottom: 12px; }
.dfvr-grupo > span { display: block; margin-bottom: 8px; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--r-soft); }
.dfvr-grupo > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.dfvr-hora { min-height: 44px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; }

.dfvr-skel { display: block; height: 64px; border-radius: 18px; background: linear-gradient(90deg, #f5efe8 25%, #fbf8f4 50%, #f5efe8 75%); background-size: 200% 100%; animation: dfvrSkel 1.2s linear infinite; }
.dfvr-dias .dfvr-skel { height: 96px; }
@keyframes dfvrSkel { to { background-position: -200% 0; } }

/* Datos */
.dfvr-resumen { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 14px 16px; border-radius: 18px; background: #e8f7f7; }
.dfvr-resumen strong { display: block; font: 700 1rem/1.2 var(--font-display, "Baloo 2"), sans-serif; }
.dfvr-resumen span { font-size: 0.92rem; color: var(--r-soft); }
.dfvr-cambiar { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: #fff; color: var(--r-td); font-weight: 800; cursor: pointer; }
.dfvr-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.dfvr-f { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; font-weight: 700; }
.dfvr-f em { font-weight: 400; color: var(--r-soft); font-style: normal; }
.dfvr-f-full { grid-column: 1 / -1; }
.dfvr-f input,
.dfvr-f textarea {
	width: 100%;
	min-height: 48px;
	padding: 12px 14px;
	border: 2px solid var(--r-line);
	border-radius: 14px;
	background: #fff;
	font: 400 1rem/1.4 var(--font-body, "Nunito"), system-ui, sans-serif;
	color: var(--r-ink);
	transition: border-color 0.2s, box-shadow 0.2s;
}
.dfvr-f textarea { resize: vertical; }
.dfvr-f input::placeholder,
.dfvr-f textarea::placeholder { color: #8f857b; }
.dfvr-f input:focus,
.dfvr-f textarea:focus { outline: none; border-color: var(--r-t); box-shadow: 0 0 0 4px rgba(31, 179, 179, 0.18); }
.dfvr-f [aria-invalid="true"] { border-color: #c0392b; }
.dfvr-f-err { color: #b3261e; font-weight: 600; font-size: 0.82rem; }
.dfvr-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dfvr-acepto { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 6px; font-size: 0.88rem; line-height: 1.45; color: var(--r-soft); }
.dfvr-acepto input { width: 22px; height: 22px; margin-top: 1px; flex: none; accent-color: var(--r-t); }
.dfvr-acepto a { color: var(--r-td); font-weight: 700; }
.dfvr-error { margin: 10px 0 0; padding: 12px 14px; border-radius: 14px; background: #fdecea; color: #8c1d18; font-weight: 600; font-size: 0.92rem; }
.dfvr-error a { color: inherit; }
.dfvr-cta {
	width: 100%;
	min-height: 54px;
	margin-top: 16px;
	border: 0;
	border-radius: 999px;
	background: var(--r-ink);
	color: #fff;
	font: 700 1.08rem var(--font-display, "Baloo 2"), sans-serif;
	cursor: pointer;
	transition: transform 0.15s var(--r-out), opacity 0.2s, box-shadow 0.2s;
	box-shadow: 0 10px 24px -12px rgba(44, 39, 35, 0.6);
}
.dfvr-cta:hover:not(:disabled) { transform: translateY(-2px); }
.dfvr-cta:active:not(:disabled) { transform: scale(0.98); }
.dfvr-cta:disabled { opacity: 0.7; cursor: progress; }

/* Listo */
.dfvr-listo { text-align: center; padding-top: 28px; }
.dfvr-listo h3 { font-size: 1.6rem; margin-top: 10px; outline: none; }
.dfvr-cuando { margin: 0 0 8px; font-size: 1.08rem; line-height: 1.5; }
.dfvr-check { width: 84px; height: 84px; margin: 0 auto; }
.dfvr-check svg { width: 100%; height: 100%; fill: none; stroke: var(--r-t); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.dfvr-check circle { stroke-dasharray: 190; stroke-dashoffset: 190; animation: dfvrTrazo 0.7s var(--r-out) forwards; }
.dfvr-check path { stroke-dasharray: 50; stroke-dashoffset: 50; animation: dfvrTrazo 0.45s var(--r-out) 0.45s forwards; }
@keyframes dfvrTrazo { to { stroke-dashoffset: 0; } }
.dfvr-acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0; }
.dfvr-btn2 { display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px; border: 2px solid var(--r-ink); border-radius: 999px; color: var(--r-ink); font: 700 1rem var(--font-display, "Baloo 2"), sans-serif; text-decoration: none; }
.dfvr-btn2:hover { background: var(--r-ink); color: #fff; }

@media (max-width: 767px) {
	.dfvr {
		width: 100vw;
		max-width: 100vw;
		max-height: 92dvh;
		margin: auto 0 0;
		border-radius: 26px 26px 0 0;
	}
	.dfvr[open] { animation: dfvrSube 0.42s var(--r-out); }
	@keyframes dfvrSube { from { transform: translateY(100%); } to { transform: none; } }
	.dfvr-head,
	.dfvr-body,
	.dfvr-foot { padding-left: 18px; padding-right: 18px; }
	.dfvr-foot { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
	.dfvr-campos { grid-template-columns: 1fr; }
	.dfvr-tipos { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.dfvr[open],
	.dfvr.is-closing,
	.dfvc-cookies { animation: none; transition: none; }
	.dfvr-check circle,
	.dfvr-check path { animation: none; stroke-dashoffset: 0; }
	.dfvr-skel { animation: none; }
}
