/* =====================================================
   BSA PRO — Calendario personalizado CPD
   ===================================================== */

.bsa-cal-wrap {
	display: inline-block;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 13px;
	user-select: none;
	-webkit-user-select: none;
}

/* Navegación mes */
.bsa-cal-wrap .bsa-cal-nav {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	padding: 10px 12px 8px;
	background: #f8f8f8;
	border: 1px solid #ddd;
	border-bottom: none;
	border-radius: 4px 4px 0 0;
}
.bsa-cal-nav-btn {
	background: none;
	border: 1px solid #ccc;
	border-radius: 3px;
	cursor: pointer;
	padding: 3px 10px;
	font-size: 16px;
	color: #555;
	line-height: 1;
	transition: background .15s;
}
.bsa-cal-nav-btn:hover { background: #e8e8e8; }
.bsa-cal-nav-btn:disabled { opacity: .35; cursor: default; }
.bsa-cal-month-label {
	font-weight: 600;
	font-size: 14px;
	color: #333;
	text-transform: capitalize;
}

/* Grid de días */
.bsa-cal-grid {
	border: 1px solid #ddd;
	border-radius: 0 0 4px 4px;
	overflow: hidden;
}
.bsa-cal-wrap .bsa-cal-weekdays {
	display: grid !important;
	grid-template-columns: repeat(7, 1fr) !important;
	background: #f0f0f0;
	border-bottom: 1px solid #ddd;
}
.bsa-cal-weekday {
	text-align: center;
	padding: 6px 0;
	font-size: 11px;
	font-weight: 600;
	color: #777;
	text-transform: uppercase;
}
.bsa-cal-wrap .bsa-cal-days {
	display: grid !important;
	grid-template-columns: repeat(7, 1fr) !important;
	background: #fff;
}
.bsa-cal-wrap .bsa-cal-day {
	position: relative;
	text-align: center;
	padding: 6px 2px 4px;
	cursor: pointer;
	border-right: 1px solid #f0f0f0;
	border-bottom: 1px solid #f0f0f0;
	min-height: 46px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 2px;
	transition: background .1s;
}
.bsa-cal-day:nth-child(7n) { border-right: none; }

/* Número del día */
.bsa-cal-day-num {
	font-size: 13px;
	font-weight: 500;
	color: #333;
	line-height: 1;
}

/* Día actual */
.bsa-cal-day.bsa-today .bsa-cal-day-num {
	background: #333;
	color: #fff;
	border-radius: 50%;
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
}

/* Días deshabilitados (pasados o sin disponibilidad) */
.bsa-cal-day.bsa-disabled {
	background: #fafafa;
	cursor: default;
	pointer-events: none;
}
.bsa-cal-day.bsa-disabled .bsa-cal-day-num { color: #ccc; }

/* Celda vacía (relleno del mes) */
.bsa-cal-day.bsa-empty {
	background: #fafafa;
	cursor: default;
	pointer-events: none;
}

/* Día seleccionado */
.bsa-cal-day.bsa-selected {
	background: #e8f5e9;
}
.bsa-cal-day.bsa-selected .bsa-cal-day-num { color: #2e7d32; font-weight: 700; }

/* Primer día seleccionado — borde izquierdo verde */
.bsa-cal-day.bsa-sel-start {
	background: #e8f5e9;
	border-left: 3px solid #4CAF50;
}
/* Último día seleccionado — borde derecho verde */
.bsa-cal-day.bsa-sel-end {
	background: #e8f5e9;
	border-right: 3px solid #4CAF50 !important;
}
/* Un solo día seleccionado — ambos bordes */
.bsa-cal-day.bsa-sel-start.bsa-sel-end {
	border-left: 3px solid #4CAF50;
	border-right: 3px solid #4CAF50 !important;
}

/* Hover en días disponibles */
.bsa-cal-day:not(.bsa-disabled):not(.bsa-empty):hover {
	background: #f1f8e9;
}

/* Badge de disponibilidad */
.bsa-cal-avail {
	font-size: 10px;
	font-weight: 700;
	background: #4CAF50;
	color: #fff;
	border-radius: 50%;
	width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}
.bsa-cal-avail.bsa-avail-low { background: #FF9800; }   /* 1 lugar */
.bsa-cal-avail.bsa-avail-zero { background: #ccc; color: #999; } /* 0 lugares */

/* Resumen de días seleccionados */
.bsa-cal-summary {
	margin-top: 10px;
	padding: 10px 12px;
	background: #f8f8f8;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 12px;
	color: #555;
	min-height: 38px;
}
.bsa-cal-summary strong { color: #333; }
.bsa-cal-summary .bsa-cal-total {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	font-weight: 700;
	color: #2e7d32;
}
.bsa-cal-summary .bsa-cal-clear {
	float: right;
	cursor: pointer;
	color: #d63638;
	font-size: 11px;
	text-decoration: underline;
	background: none;
	border: none;
	padding: 0;
}

/* Input hidden */
.bsa-cal-input { display: none; }

/* Responsive */
@media (max-width: 480px) {
	.bsa-cal-day { min-height: 38px; padding: 4px 1px 2px; }
	.bsa-cal-day-num { font-size: 12px; }
	.bsa-cal-avail { width: 14px; height: 14px; font-size: 9px; }
}
