/*
 * BestBay widget overrides.
 *
 * The calendar below follows BuddyBoss Theme's template-v2 rules. Only the
 * variable names are mapped to BuddyX tokens; layout and interaction remain
 * the same.
 */

.widget_calendar,
.wp-block-calendar {
	position: relative;
	font-size: 14px;
}

.widget_calendar .calendar_wrap {
	position: relative;
}

.widget_calendar #wp-calendar,
.wp-block-calendar #wp-calendar {
	margin-top: 14px;
	margin-bottom: 0;
}

.widget_calendar #wp-calendar *,
.widget_calendar #wp-calendar,
.wp-block-calendar #wp-calendar *,
.wp-block-calendar #wp-calendar {
	border: none;
	font-weight: 500;
	font-size: 14px;
}

.widget_calendar #wp-calendar caption,
.wp-block-calendar #wp-calendar caption {
	padding: 0;
	margin-bottom: 25px;
	color: var(--global-title-color, #111);
	font-size: 18px;
	line-height: 21.48px;
	text-align: center;
	text-transform: none;
}

.widget_calendar #wp-calendar thead th,
.wp-block-calendar #wp-calendar thead th {
	background: none;
	text-align: center;
	padding: 10px;
	font-size: 12px;
	color: var(--global-title-color, #111);
}

.widget_calendar #wp-calendar tbody td,
.wp-block-calendar #wp-calendar tbody td {
	width: 34px;
	height: 34px;
	padding: 0;
	vertical-align: middle;
	text-align: center;
	border-radius: var(--global-border-radius, 25px);
}

.widget_calendar #wp-calendar tbody td a,
.wp-block-calendar #wp-calendar tbody td a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin: 2.5px;
	border-radius: var(--global-border-radius, 25px);
	background: var(--global-body-lightcolor, #fafafa);
	color: var(--global-font-color, #505050);
	font-weight: 600;
	text-decoration: none;
	transition: all linear 0.2s;
}

.widget_calendar #wp-calendar tbody td a:hover,
.wp-block-calendar #wp-calendar tbody td a:hover {
	background-color: var(--color-theme-primary, #1e73be);
	color: var(--color-theme-white-box, #fff);
	transition: all linear 0.2s;
}

.widget_calendar #wp-calendar tbody td#today,
.wp-block-calendar #wp-calendar tbody td#today {
	background-color: var(--color-theme-primary, #1e73be);
	color: var(--color-theme-white-box, #fff);
}

.widget_calendar table:where(:not(.has-text-color)),
.wp-block-calendar table:where(:not(.has-text-color)) {
	color: var(--global-font-color, #505050);
}

/* BuddyX paints empty calendar cells and the navigation spacer grey; BuddyBoss leaves them transparent. */
.widget_calendar .pad,
.wp-block-calendar .pad {
	background: transparent;
}

/* BuddyBoss template-v2 navigation, including the original bb-icons glyphs. */
.widget_calendar .wp-calendar-nav,
.wp-block-calendar .wp-calendar-nav {
	display: flex;
	justify-content: space-between;
	position: absolute;
	top: -9px;
	left: 20px;
	width: calc(100% - 40px);
	padding: 0;
	font-size: 14px;
}

/* BuddyX gives block widgets a more-specific top offset; match BuddyBoss. */
.widget_block.widget_calendar .wp-block-calendar .wp-calendar-nav {
	top: -9px;
}

.widget_calendar .wp-calendar-nav span:not(.pad),
.wp-block-calendar .wp-calendar-nav span:not(.pad) {
	width: 38px;
	height: 38px;
}

.widget_calendar .wp-calendar-nav span:not(.pad) a,
.wp-block-calendar .wp-calendar-nav span:not(.pad) a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 100%;
	background: var(--global-body-lightcolor, #fafafa);
	font-size: 0;
	text-decoration: none;
	transition: all linear 0.2s;
}

.widget_calendar .wp-calendar-nav span:not(.pad) a::before,
.wp-block-calendar .wp-calendar-nav span:not(.pad) a::before {
	font-family: bb-icons;
	font-weight: 300;
	color: var(--global-font-color, #505050);
	font-size: 16px;
}

.widget_calendar .wp-calendar-nav span:not(.pad) a:hover,
.wp-block-calendar .wp-calendar-nav span:not(.pad) a:hover {
	background-color: var(--color-theme-primary, #1e73be);
	transition: all linear 0.2s;
}

.widget_calendar .wp-calendar-nav span:not(.pad) a:hover::before,
.wp-block-calendar .wp-calendar-nav span:not(.pad) a:hover::before {
	color: var(--color-theme-white-box, #fff);
	transition: all linear 0.2s;
}

.widget_calendar .wp-calendar-nav span:not(.pad).wp-calendar-nav-prev a::before,
.wp-block-calendar .wp-calendar-nav span:not(.pad).wp-calendar-nav-prev a::before {
	content: "\e8ab";
}

.widget_calendar .wp-calendar-nav span:not(.pad).wp-calendar-nav-next a::before,
.wp-block-calendar .wp-calendar-nav span:not(.pad).wp-calendar-nav-next a::before {
	content: "\e827";
}

@media only screen and (max-width: 800px) {
	.widget_calendar #wp-calendar tbody td a,
	.wp-block-calendar #wp-calendar tbody td a {
		margin: 0 auto;
	}
}
