@import 'bootstrap/dist/css/bootstrap.min.css';

html {
	font-size: 18px;
}

.app-navbar {
	background: #ffb555;
	border-bottom: 1px solid #ffb13c;
}

.app-navbar .navbar-toggler {
	border-color: rgba(255, 255, 255, 0.45);
}

.app-navbar .navbar-toggler:focus {
	box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.2);
}

.app-navbar .navbar-toggler-icon {
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.92%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.app-navbar .navbar-nav {
	gap: 0.5rem;
}

.app-navbar-link {
	color: #4d4545;
	background: transparent;
	border: 2px solid transparent;
	font-weight: 600;
}

.app-navbar-link:hover,
.app-navbar-link:focus,
.app-navbar-link:active {
	color: #352e2e;
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.24);
}

.app-navbar-link.active,
.app-navbar-link[aria-current='page'] {
	color: #fff;
	background: rgba(255, 255, 255, 0.2);
	border-color: rgba(255, 255, 255, 0.3);
}

.app-navbar .navbar-brand,
.app-navbar .navbar-brand:hover,
.app-navbar .navbar-brand:focus {
	color: #fff;
	font-weight: 700;
}

.app-navbar-greeting {
	color: #fff;
	font-size: 0.95rem;
	font-weight: 700;
	white-space: nowrap;
}

@media (max-width: 991.98px) {
	.app-navbar-greeting {
		display: none;
	}
}

.app-footer {
	background: #ff9720;
	border-top: 1px solid #ec7f1a;
	color: #fff;
}

.app-footer h3,
.app-footer p,
.app-footer .small {
	color: inherit;
}

.app-footer a {
	color: #fff;
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.app-footer a:hover,
.app-footer a:focus {
	color: #fff;
	border-bottom-color: rgba(255, 255, 255, 0.85);
}

.servicio-card-img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	object-position: center;
}

html.sidebar-nav-pending .app-navbar #menuPrincipal > ul,
html.sidebar-nav-pending .app-navbar .navbar-toggler {
	visibility: hidden;
	pointer-events: none;
}

/* Evita el flash del menu horizontal en pantallas que luego se convierten a sidebar. */
.app-navbar #menuPrincipal > ul:has(a[href^='/administrador/']),
.app-navbar #menuPrincipal > ul:has(a[href^='/profesional/']) {
	visibility: hidden;
	pointer-events: none;
}

body:has(.app-navbar #menuPrincipal > ul:has(a[href^='/administrador/'])) .app-navbar .navbar-toggler,
body:has(.app-navbar #menuPrincipal > ul:has(a[href^='/profesional/'])) .app-navbar .navbar-toggler {
	visibility: hidden;
	pointer-events: none;
}

/* Reserva el ancho del sidebar antes de que JS agregue clases y evita el "flash" de layout full-width. */
@media (min-width: 992px) {
	body:has(.app-navbar #menuPrincipal > ul:has(a[href^='/administrador/'])) main,
	body:has(.app-navbar #menuPrincipal > ul:has(a[href^='/profesional/'])) main {
		margin-left: 250px;
		width: calc(100% - 250px);
	}

	html.sidebar-nav-pending main.sidebar-main-pending {
		visibility: hidden;
	}
}

.admin-sidebar {
	position: fixed;
	top: var(--admin-navbar-height, 74px);
	left: 0;
	width: 250px;
	height: calc(100vh - var(--admin-navbar-height, 74px));
	overflow-y: auto;
	background: #ffffff;
	border-right: 1px solid #f0d39c;
	padding: 1rem 0.75rem;
	z-index: 1030;
}

.admin-sidebar-nav {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.admin-sidebar-link {
	text-align: left;
	width: 100%;
}

.admin-sidebar-details {
	width: 100%;
}

.admin-sidebar-details > summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.admin-sidebar-details > summary::-webkit-details-marker {
	display: none;
}

.admin-sidebar-details > summary::after {
	content: '\203A';
	font-size: 1.1rem;
	line-height: 1;
	transition: transform 0.2s ease;
	display: inline-block;
}

.admin-sidebar-details[open] > summary::after {
	transform: rotate(90deg);
}

.admin-sidebar-sublink {
	padding-left: 1.5rem !important;
	font-size: 0.9em;
	width: 100%;
	text-align: left;
}

.admin-sidebar .admin-sidebar-link:hover,
.admin-sidebar .admin-sidebar-link:focus,
.admin-sidebar .admin-sidebar-link:active {
	color: #352e2e;
	background: #f6f7f9;
	border-color: #e6e9ef;
}

.admin-sidebar .admin-sidebar-link.active,
.admin-sidebar .admin-sidebar-link[aria-current='page'] {
	color: #352e2e;
	background: #ffe0b5;
	border-color: #ffb555;
}

.admin-main-content {
	margin-left: 250px;
	width: calc(100% - 250px);
}

@media (max-width: 991.98px) {
	.admin-sidebar {
		position: static;
		top: auto;
		left: auto;
		width: 100%;
		height: auto;
		border-right: 0;
		border-bottom: 1px solid #f0d39c;
	}

	.admin-main-content {
		margin-left: 0;
		width: 100%;
	}
}
