/* Tabla de Contenidos - Estilos Base */
.ts-toc-wrapper {
	width: 100%;
}

.ts-toc-content-wrapper {
	display: flex;
	align-items: flex-start;
	gap: 30px;
}

.ts-toc-index {
	flex-shrink: 0;
	flex-grow: 0;
	position: relative;
	background-color: #f8f8f8;
	padding: 20px;
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
}

.ts-toc-content {
	flex: 1;
	min-width: 0;
}

/* Título del índice */
.ts-toc-title {
	font-weight: 400;
    font-size: 25px;
    text-transform: uppercase;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

/* Select dropdown para móvil */
.ts-toc-select-wrapper {
	display: none;
	margin-bottom: 15px;
}

.ts-toc-select {
	width: 100%;
	padding: 12px 40px 12px 15px;
	font-size: 14px;
    min-width: 100%;
	font-family: inherit;
	color: #333;
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 15px center;
	background-size: 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ts-toc-select:hover {
	border-color: #999;
}

.ts-toc-select:focus {
	outline: none;
	border-color: #000;
	box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.ts-toc-select option:first-child {
	color: #999;
}

/* Lista del índice */
.ts-toc-list, .ts-toc-list li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ts-toc-list li {
	margin-bottom: 10px;
}

.ts-toc-list a {
	color: #666666;
	text-decoration: none;
	display: block;
	transition: all 0.3s ease;
	position: relative;
	line-height: 1.6;
	word-wrap: break-word;
	overflow-wrap: break-word;
	hyphens: auto;
}

.ts-toc-list a:hover,
.ts-toc-list a.active {
	color: #000000;
    text-decoration: underline !important;
    font-weight: 500;
}


/* Sticky en Desktop */
.ts-toc-wrapper.sticky-desktop .ts-toc-index {
	position: sticky;
	top: 100px;
	align-self: flex-start;
}

/* Posicionamiento */
.ts-toc-wrapper.index-left .ts-toc-content-wrapper {
	flex-direction: row;
}

.ts-toc-wrapper.index-right .ts-toc-content-wrapper {
	flex-direction: row-reverse;
}

/* Estilos del contenido */
.ts-toc-content h2 {
	scroll-margin-top: 120px;
	margin-top: 30px;
	margin-bottom: 15px;
	font-weight: 600;
}

.ts-toc-content h1, .ts-toc-content h2 {
    font-size: 20px;
    font-weight: 600 !important;
    margin-bottom: 20px;
}
.ts-toc-content h3, .ts-toc-content h4, .ts-toc-content h5, .ts-toc-content h6 {
    font-size: 18px;
    font-weight: 600 !important;
    margin-bottom: 15px;
}

.ts-toc-content p {
	margin-bottom: 15px;
	line-height: 1.8;
}

/* Responsive - Tablet y móvil */
@media (max-width: 1024px) {
	.ts-toc-content-wrapper {
		gap: 20px;
	}
	
	.ts-toc-wrapper.sticky-desktop .ts-toc-index {
		top: 80px;
	}
}

@media (max-width: 768px) {
	/* Comportamiento: dropdown/select */
	.ts-toc-wrapper.mobile-dropdown .ts-toc-content-wrapper {
		flex-direction: column;
	}
	
	.ts-toc-wrapper.mobile-dropdown .ts-toc-index {
		width: 100%;
		position: static;
		margin-bottom: 20px;
		padding: 20px;
	}
	
	.ts-toc-wrapper.mobile-dropdown .ts-toc-select-wrapper {
		display: block;
	}
	
	.ts-toc-wrapper.mobile-dropdown .ts-toc-list {
		display: none;
	}
	
	.ts-toc-wrapper.mobile-dropdown .ts-toc-title {
		margin-bottom: 15px;
		font-size: 18px;
	}
	
	/* Sticky en dropdown móvil */
	.ts-toc-wrapper.sticky-mobile.mobile-dropdown .ts-toc-index {
		position: sticky;
		top: 0;
		z-index: 100;
		background-color: #f8f8f8;
		box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	}
	
	/* Comportamiento: mostrar arriba */
	.ts-toc-wrapper.mobile-top .ts-toc-content-wrapper {
		flex-direction: column;
	}
	
	.ts-toc-wrapper.mobile-top .ts-toc-index {
		width: 100%;
		position: static;
		margin-bottom: 20px;
	}
	
	/* Comportamiento: toggle colapsable */
	.ts-toc-wrapper.mobile-toggle .ts-toc-content-wrapper {
		flex-direction: column;
	}
	
	.ts-toc-wrapper.mobile-toggle .ts-toc-index {
		width: 100%;
		position: sticky;
		top: 0;
		z-index: 100;
		margin-bottom: 20px;
	}
	
	.ts-toc-wrapper.mobile-toggle .ts-toc-title {
		cursor: pointer;
		user-select: none;
		position: relative;
		padding-right: 30px;
	}
	
	.ts-toc-wrapper.mobile-toggle .ts-toc-title:after {
		content: '\25BC';
		position: absolute;
		right: 0;
		top: 50%;
		transform: translateY(-50%);
		font-size: 12px;
		transition: transform 0.3s ease;
	}
	
	.ts-toc-wrapper.mobile-toggle .ts-toc-list {
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.3s ease;
	}
	
	.ts-toc-wrapper.mobile-toggle.toc-open .ts-toc-title:after {
		transform: translateY(-50%) rotate(180deg);
	}
	
	.ts-toc-wrapper.mobile-toggle.toc-open .ts-toc-list {
		max-height: 1000px;
	}
	
	/* Comportamiento: ocultar */
	.ts-toc-wrapper.mobile-hide .ts-toc-index {
		display: none;
	}
	
	.ts-toc-wrapper.mobile-hide .ts-toc-content {
		width: 100%;
	}
	
	/* Sticky móvil si está habilitado */
	.ts-toc-wrapper.sticky-mobile.mobile-top .ts-toc-index,
	.ts-toc-wrapper.sticky-mobile.mobile-toggle .ts-toc-index {
		position: sticky;
		top: 0;
		z-index: 100;
	}
	
	/* Ajustes generales para móvil */
	.ts-toc-content h2 {
		scroll-margin-top: 80px;
	}
	
	.ts-toc-list a {
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.ts-toc-index {
		padding: 15px;
	}
	
	.ts-toc-title {
		font-size: 13px;
	}
	
	.ts-toc-list a {
		font-size: 13px;
	}
	
	.ts-toc-content h2 {
		font-size: 20px;
	}
}
