/* ==========================================================================
   Controles propios de Tramon (assets/js/controles.js), iguales en el sitio y
   en el panel: listas de selección y calendario. Cada contexto ajusta el
   botón de la lista a sus campos; la lista y el calendario se ven igual.
   ========================================================================== */

/* Listas -------------------------------------------------------------------- */
.tselect { position: relative; min-width: 0; }
.tselect__native { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; pointer-events: none; }
.tselect__btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	width: 100%;
	padding: 12px 0;
	border: 0;
	border-bottom: 1px solid var(--line, #e2dcd2);
	border-radius: 0;
	background: transparent;
	font: inherit;
	font-size: 16px;
	color: var(--ink, #121a2c);
	text-align: left;
	cursor: pointer;
	transition: border-color .3s;
}
.tselect__btn:hover, .tselect.is-open .tselect__btn { border-color: var(--navy, #0a1f4a); }
.tselect__btn:focus-visible { outline: none; border-color: var(--navy, #0a1f4a); box-shadow: 0 1px 0 var(--navy, #0a1f4a); }
.tselect__btn:disabled { opacity: .5; cursor: default; }
.tselect__value { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tselect__chev { flex: none; width: 12px; height: 8px; transition: transform .35s var(--ease, ease); }
.tselect.is-open .tselect__chev { transform: rotate(180deg); }
.tselect__list {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 40;
	min-width: 100%;
	max-height: 300px;
	margin: 0;
	padding: 6px;
	overflow-y: auto;
	list-style: none;
	border-radius: var(--r, 12px);
	background: var(--navy, #0a1f4a);
	color: #dfe6f3;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transform-origin: top;
	transition: opacity .22s var(--ease, ease), transform .3s cubic-bezier(.16, 1, .3, 1), visibility 0s .3s;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, .3) transparent;
}
.tselect__list:focus { outline: none; }
.tselect.is-up .tselect__list { top: auto; bottom: calc(100% + 6px); transform: translateY(6px); transform-origin: bottom; }
.tselect.is-open .tselect__list { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.tselect__opt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	padding: 10px 14px;
	border-radius: var(--r-sm, 8px);
	font-size: 14.5px;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.tselect__opt svg { flex: none; width: 15px; height: 15px; opacity: 0; transform: scale(.6); transition: opacity .25s, transform .35s cubic-bezier(.16, 1, .3, 1); }
.tselect__opt[aria-selected="true"] { color: #fff; }
.tselect__opt[aria-selected="true"] svg { opacity: 1; transform: none; }
.tselect__opt.is-active { background: var(--navy-2, #16326e); color: #fff; }
.tselect__opt[aria-disabled="true"] { opacity: .4; cursor: default; }

/* Calendario ---------------------------------------------------------------- */
.tcal { --cal-size: 44px; display: grid; gap: 10px; max-width: 420px; font-family: inherit; }
.tcal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tcal__month { margin: 0; font-family: var(--serif, inherit); font-size: 20px; font-weight: 300; color: var(--ink, #121a2c); }
.tcal__nav { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--sand, #f1ece4); color: var(--ink, #121a2c); cursor: pointer; transition: background-color .2s; }
.tcal__nav svg { width: 8px; height: 12px; }
.tcal__nav:hover:not(:disabled) { background: #e7e0d5; }
.tcal__nav:disabled { opacity: .35; cursor: default; }
.tcal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.tcal__dow { padding: 4px 0; font-size: 12px; text-align: center; color: var(--muted, #6f6c68); }
.tcal__day {
	position: relative;
	display: grid;
	place-items: center;
	align-content: center;
	gap: 1px;
	min-height: var(--cal-size);
	padding: 2px;
	border: 0;
	border-radius: var(--r-sm, 8px);
	background: var(--white, #fff);
	color: var(--ink, #121a2c);
	font: inherit;
	font-size: 15px;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.tcal__day small { font-size: 10px; line-height: 1; color: var(--muted, #6f6c68); }
.tcal__day.is-libre:not(:disabled):hover { background: var(--sand, #f1ece4); }
.tcal__day.is-today span { text-decoration: underline; text-underline-offset: 3px; }
.tcal__day:disabled { cursor: default; }
.tcal__day.is-lleno { background: repeating-linear-gradient(135deg, #f3efe8 0 4px, #ece6dc 4px 8px); color: #9b958d; }
.tcal__day.is-bloqueado { background: #f6e1e4; color: #a3243b; }
.tcal__day.is-cerrado, .tcal__day.is-pasado, .tcal__day.is-fuera { background: transparent; color: #c2bcb3; }
.tcal__day.is-selected, .tcal__day.is-selected:hover { background: var(--navy, #0a1f4a) !important; color: #fff; }
.tcal__day.is-selected small { color: rgba(255, 255, 255, .75); }
.tcal__day:focus-visible { outline: 2px solid var(--navy, #0a1f4a); outline-offset: 2px; }
.tcal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted, #6f6c68); }
.tcal-legend li { display: inline-flex; align-items: center; gap: 6px; }
.tcal-legend i { width: 14px; height: 14px; border-radius: 4px; background: var(--white, #fff); box-shadow: inset 0 0 0 1px #e2dcd2; }
.tcal-legend .is-lleno { background: repeating-linear-gradient(135deg, #f3efe8 0 3px, #ece6dc 3px 6px); box-shadow: none; }
.tcal-legend .is-bloqueado { background: #f6e1e4; box-shadow: none; }
.tcal-legend .is-selected { background: var(--navy, #0a1f4a); box-shadow: none; }

/* Horas del día elegido */
.tslots { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tslot {
	min-width: 76px;
	min-height: 40px;
	padding: 0 14px;
	border: 0;
	border-radius: 999px;
	background: var(--white, #fff);
	color: var(--ink, #121a2c);
	font: inherit;
	font-size: 14.5px;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.tslot:hover:not(:disabled) { background: var(--sand, #f1ece4); }
.tslot[aria-pressed="true"] { background: var(--navy, #0a1f4a); color: #fff; }
.tslot:disabled { background: transparent; color: #b9b3aa; text-decoration: line-through; cursor: default; }
.tslot:focus-visible { outline: 2px solid var(--navy, #0a1f4a); outline-offset: 2px; }

/* Campo de fecha (mismo calendario en un desplegable) */
.tdate { position: relative; }
.tdate__icon { flex: none; width: 16px; height: 16px; }
.tdate__pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 45; width: 320px; padding: 14px; border-radius: var(--r, 12px); background: var(--white, #fff); box-shadow: 0 18px 40px -16px rgba(10, 31, 74, .35); }
.tdate__pop .tcal { --cal-size: 36px; }
.tdate__pop .tcal__day { background: var(--sand-2, #f8f5f0); font-size: 14px; }
